Skip to content

Commit 38b8b9d

Browse files
committed
Refactor not implemented option warning
Report an error through eslint instead of throw.
1 parent 771d550 commit 38b8b9d

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

src/rules/checkLinesAlignment.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ export default iterateJsdoc(({
178178
indent,
179179
}) => {
180180
if (context.options[0] === 'never') {
181-
throw new Error('The `never` option is not yet implemented for this rule.');
181+
report('The `never` option is not yet implemented for this rule.');
182+
183+
return;
182184
}
183185

184186
if (context.options[0] !== 'always') {

test/rules/assertions/checkLinesAlignment.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,26 @@ export default {
364364
*/
365365
`,
366366
},
367+
{
368+
code: `
369+
/**
370+
* Not implemented yet.
371+
*
372+
* @param {string} lorem Description.
373+
* @param {int} sit Description multi words.
374+
*/
375+
const fn = ( lorem, sit ) => {}
376+
`,
377+
errors: [
378+
{
379+
message: 'The `never` option is not yet implemented for this rule.',
380+
type: 'Block',
381+
},
382+
],
383+
options: [
384+
'never',
385+
],
386+
},
367387
],
368388
valid: [
369389
{
@@ -533,7 +553,11 @@ export default {
533553
code: `
534554
/**
535555
* Not validating without option.
556+
*
557+
* @param {string} lorem Description.
558+
* @param {int} sit Description multi words.
536559
*/
560+
const fn = ( lorem, sit ) => {}
537561
`,
538562
},
539563
],

0 commit comments

Comments
 (0)