Skip to content

Commit eab2813

Browse files
authored
Merge pull request #319 from brettz9/require-param-remove-deprecated
Remove deprecated settings specific to `require-param`
2 parents 9c9429e + 39c1e11 commit eab2813

File tree

6 files changed

+36
-84
lines changed

6 files changed

+36
-84
lines changed

.README/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,6 @@ The format of the configuration is as follows:
258258
}
259259
```
260260

261-
`settings.jsdoc.allowOverrideWithoutParam`,
262-
`settings.jsdoc.allowImplementsWithoutParam`, and
263-
`settings.jsdoc.allowAugmentsExtendsWithoutParam` performed a similar function
264-
but restricted to `@param`. These settings are now deprecated.
265-
266261
### Settings to Configure `check-types` and `no-undefined-types`
267262

268263
- `settings.jsdoc.preferredTypes` An option map to indicate preferred

README.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,6 @@ The format of the configuration is as follows:
303303
}
304304
```
305305

306-
`settings.jsdoc.allowOverrideWithoutParam`,
307-
`settings.jsdoc.allowImplementsWithoutParam`, and
308-
`settings.jsdoc.allowAugmentsExtendsWithoutParam` performed a similar function
309-
but restricted to `@param`. These settings are now deprecated.
310-
311306
<a name="eslint-plugin-jsdoc-settings-settings-to-configure-check-types-and-no-undefined-types"></a>
312307
### Settings to Configure <code>check-types</code> and <code>no-undefined-types</code>
313308

@@ -5255,7 +5250,7 @@ function quux (foo, bar) {
52555250
function quux (foo) {
52565251

52575252
}
5258-
// Settings: {"jsdoc":{"allowOverrideWithoutParam":false}}
5253+
// Settings: {"jsdoc":{"overrideReplacesDocs":false}}
52595254
// Message: Missing JSDoc @param "foo" declaration.
52605255

52615256
/**
@@ -5264,7 +5259,7 @@ function quux (foo) {
52645259
function quux (foo) {
52655260

52665261
}
5267-
// Settings: {"jsdoc":{"allowImplementsWithoutParam":false}}
5262+
// Settings: {"jsdoc":{"implementsReplacesDocs":false}}
52685263
// Message: Missing JSDoc @param "foo" declaration.
52695264

52705265
/**
@@ -5294,7 +5289,7 @@ class A {
52945289

52955290
}
52965291
}
5297-
// Settings: {"jsdoc":{"allowOverrideWithoutParam":false}}
5292+
// Settings: {"jsdoc":{"overrideReplacesDocs":false}}
52985293
// Message: Missing JSDoc @param "foo" declaration.
52995294

53005295
/**
@@ -5308,7 +5303,7 @@ class A {
53085303

53095304
}
53105305
}
5311-
// Settings: {"jsdoc":{"allowImplementsWithoutParam":false}}
5306+
// Settings: {"jsdoc":{"implementsReplacesDocs":false}}
53125307
// Message: Missing JSDoc @param "foo" declaration.
53135308

53145309
/**
@@ -5413,7 +5408,7 @@ class A {
54135408
function quux (foo) {
54145409

54155410
}
5416-
// Settings: {"jsdoc":{"allowOverrideWithoutParam":true}}
5411+
// Settings: {"jsdoc":{"overrideReplacesDocs":true}}
54175412

54185413
/**
54195414
* @implements
@@ -5440,7 +5435,7 @@ function quux (foo) {
54405435
function quux (foo) {
54415436

54425437
}
5443-
// Settings: {"jsdoc":{"allowImplementsWithoutParam":true}}
5438+
// Settings: {"jsdoc":{"implementsReplacesDocs":true}}
54445439

54455440
/**
54465441
* @implements
@@ -5456,7 +5451,7 @@ function quux (foo) {
54565451
function quux (foo) {
54575452

54585453
}
5459-
// Settings: {"jsdoc":{"allowAugmentsExtendsWithoutParam":true}}
5454+
// Settings: {"jsdoc":{"augmentsExtendsReplacesDocs":true}}
54605455

54615456
/**
54625457
* @augments
@@ -5472,7 +5467,7 @@ function quux (foo) {
54725467
function quux (foo) {
54735468

54745469
}
5475-
// Settings: {"jsdoc":{"allowAugmentsExtendsWithoutParam":true}}
5470+
// Settings: {"jsdoc":{"augmentsExtendsReplacesDocs":true}}
54765471

54775472
/**
54785473
* @extends
@@ -5521,7 +5516,7 @@ class A {
55215516

55225517
}
55235518
}
5524-
// Settings: {"jsdoc":{"allowOverrideWithoutParam":true}}
5519+
// Settings: {"jsdoc":{"overrideReplacesDocs":true}}
55255520

55265521
/**
55275522
* @implements
@@ -5534,7 +5529,7 @@ class A {
55345529

55355530
}
55365531
}
5537-
// Settings: {"jsdoc":{"allowImplementsWithoutParam":true}}
5532+
// Settings: {"jsdoc":{"implementsReplacesDocs":true}}
55385533

55395534
/**
55405535
* @implements
@@ -5559,7 +5554,7 @@ class A {
55595554

55605555
}
55615556
}
5562-
// Settings: {"jsdoc":{"allowAugmentsExtendsWithoutParam":true}}
5557+
// Settings: {"jsdoc":{"augmentsExtendsReplacesDocs":true}}
55635558

55645559
/**
55655560
* @augments
@@ -5584,7 +5579,7 @@ class A {
55845579

55855580
}
55865581
}
5587-
// Settings: {"jsdoc":{"allowAugmentsExtendsWithoutParam":true}}
5582+
// Settings: {"jsdoc":{"augmentsExtendsReplacesDocs":true}}
55885583

55895584
/**
55905585
* @extends

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@
6464
"build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps",
6565
"create-readme": "gitdown ./.README/README.md --output-file ./README.md && npm run add-assertions",
6666
"lint": "eslint ./src ./test",
67-
"test-cov": "BABEL_ENV=test nyc mocha --recursive --require @babel/register --reporter progress --timeout 7000",
68-
"test-no-cov": "BABEL_ENV=test mocha --recursive --require @babel/register --reporter progress --timeout 7000",
69-
"test-index": "BABEL_ENV=test mocha --recursive --require @babel/register --reporter progress --timeout 7000 test/rules/index.js",
70-
"test": "BABEL_ENV=test nyc --reporter text-summary mocha --recursive --require @babel/register --reporter progress --timeout 7000"
67+
"test-cov": "BABEL_ENV=test nyc mocha --recursive --require @babel/register --reporter progress --timeout 9000",
68+
"test-no-cov": "BABEL_ENV=test mocha --recursive --require @babel/register --reporter progress --timeout 9000",
69+
"test-index": "BABEL_ENV=test mocha --recursive --require @babel/register --reporter progress --timeout 9000 test/rules/index.js",
70+
"test": "BABEL_ENV=test nyc --reporter text-summary mocha --recursive --require @babel/register --reporter progress --timeout 9000"
7171
},
7272
"nyc": {
7373
"require": [

src/iterateJsdoc.js

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ const getUtils = (
3030
tagNamePreference,
3131
overrideReplacesDocs,
3232
implementsReplacesDocs,
33-
augmentsExtendsReplacesDocs,
34-
allowOverrideWithoutParam,
35-
allowImplementsWithoutParam,
36-
allowAugmentsExtendsWithoutParam
33+
augmentsExtendsReplacesDocs
3734
},
3835
report,
3936
context
@@ -98,42 +95,12 @@ const getUtils = (
9895
return jsdocUtils.hasTag(jsdoc, name);
9996
};
10097

101-
// These settings are deprecated and may be removed in the future along with this method.
102-
utils.avoidDocsParamOnly = () => {
103-
// These three checks are all for deprecated settings and may be removed in the future
104-
105-
// When settings.jsdoc.allowOverrideWithoutParam is true, override implies that all documentation is inherited.
106-
if ((utils.hasTag('override') || utils.classHasTag('override')) && allowOverrideWithoutParam !== false) {
107-
return true;
108-
}
109-
110-
// When settings.jsdoc.allowImplementsWithoutParam is true, implements implies that all documentation is inherited.
111-
// See https://github.com/gajus/eslint-plugin-jsdoc/issues/100
112-
if ((utils.hasTag('implements') || utils.classHasTag('implements')) && allowImplementsWithoutParam !== false) {
113-
return true;
114-
}
115-
116-
// When settings.jsdoc.allowAugmentsExtendsWithoutParam is true, augments or extends implies that all documentation is inherited.
117-
if ((utils.hasTag('augments') || utils.hasTag('extends') ||
118-
utils.classHasTag('augments') || utils.classHasTag('extends')) && allowAugmentsExtendsWithoutParam) {
119-
return true;
120-
}
121-
122-
return false;
123-
};
124-
125-
utils.avoidDocsParamConditionally = (param) => {
126-
// After deprecation, the `param` parameter can be removed, but for now,
127-
// don't default for `param` as it may have its own explicit settings to the contrary
128-
return (param && overrideReplacesDocs || !param && overrideReplacesDocs !== false) &&
129-
(utils.hasTag('override') || utils.classHasTag('override')) ||
130-
(param && implementsReplacesDocs || !param && implementsReplacesDocs !== false) &&
131-
(utils.hasTag('implements') || utils.classHasTag('implements'));
132-
};
133-
134-
utils.avoidDocs = (param) => {
135-
if (param && utils.avoidDocsParamOnly() ||
136-
utils.avoidDocsParamConditionally(param) ||
98+
utils.avoidDocs = () => {
99+
if (
100+
overrideReplacesDocs !== false &&
101+
(utils.hasTag('override') || utils.classHasTag('override')) ||
102+
implementsReplacesDocs !== false &&
103+
(utils.hasTag('implements') || utils.classHasTag('implements')) ||
137104

138105
// inheritdoc implies that all documentation is inherited; see https://jsdoc.app/tags-inheritdoc.html
139106
utils.hasTag('inheritdoc') ||
@@ -261,11 +228,6 @@ const getSettings = (context) => {
261228
settings.implementsReplacesDocs = _.get(context, 'settings.jsdoc.implementsReplacesDocs');
262229
settings.augmentsExtendsReplacesDocs = _.get(context, 'settings.jsdoc.augmentsExtendsReplacesDocs');
263230

264-
// `require-param` only (deprecated)
265-
settings.allowOverrideWithoutParam = _.get(context, 'settings.jsdoc.allowOverrideWithoutParam');
266-
settings.allowImplementsWithoutParam = _.get(context, 'settings.jsdoc.allowImplementsWithoutParam');
267-
settings.allowAugmentsExtendsWithoutParam = _.get(context, 'settings.jsdoc.allowAugmentsExtendsWithoutParam');
268-
269231
return settings;
270232
};
271233

src/rules/requireParam.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default iterateJsdoc(({
1111
return;
1212
}
1313

14-
if (utils.avoidDocs('param')) {
14+
if (utils.avoidDocs()) {
1515
return;
1616
}
1717

test/rules/assertions/requireParam.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default {
7474
],
7575
settings: {
7676
jsdoc: {
77-
allowOverrideWithoutParam: false
77+
overrideReplacesDocs: false
7878
}
7979
}
8080
},
@@ -94,7 +94,7 @@ export default {
9494
],
9595
settings: {
9696
jsdoc: {
97-
allowImplementsWithoutParam: false
97+
implementsReplacesDocs: false
9898
}
9999
}
100100
},
@@ -149,7 +149,7 @@ export default {
149149
],
150150
settings: {
151151
jsdoc: {
152-
allowOverrideWithoutParam: false
152+
overrideReplacesDocs: false
153153
}
154154
}
155155
},
@@ -174,7 +174,7 @@ export default {
174174
],
175175
settings: {
176176
jsdoc: {
177-
allowImplementsWithoutParam: false
177+
implementsReplacesDocs: false
178178
}
179179
}
180180
},
@@ -345,7 +345,7 @@ export default {
345345
`,
346346
settings: {
347347
jsdoc: {
348-
allowOverrideWithoutParam: true
348+
overrideReplacesDocs: true
349349
}
350350
}
351351
},
@@ -385,7 +385,7 @@ export default {
385385
`,
386386
settings: {
387387
jsdoc: {
388-
allowImplementsWithoutParam: true
388+
implementsReplacesDocs: true
389389
}
390390
}
391391
},
@@ -411,7 +411,7 @@ export default {
411411
`,
412412
settings: {
413413
jsdoc: {
414-
allowAugmentsExtendsWithoutParam: true
414+
augmentsExtendsReplacesDocs: true
415415
}
416416
}
417417
},
@@ -437,7 +437,7 @@ export default {
437437
`,
438438
settings: {
439439
jsdoc: {
440-
allowAugmentsExtendsWithoutParam: true
440+
augmentsExtendsReplacesDocs: true
441441
}
442442
}
443443
},
@@ -513,7 +513,7 @@ export default {
513513
`,
514514
settings: {
515515
jsdoc: {
516-
allowOverrideWithoutParam: true
516+
overrideReplacesDocs: true
517517
}
518518
}
519519
},
@@ -533,7 +533,7 @@ export default {
533533
`,
534534
settings: {
535535
jsdoc: {
536-
allowImplementsWithoutParam: true
536+
implementsReplacesDocs: true
537537
}
538538
}
539539
},
@@ -568,7 +568,7 @@ export default {
568568
`,
569569
settings: {
570570
jsdoc: {
571-
allowAugmentsExtendsWithoutParam: true
571+
augmentsExtendsReplacesDocs: true
572572
}
573573
}
574574
},
@@ -603,7 +603,7 @@ export default {
603603
`,
604604
settings: {
605605
jsdoc: {
606-
allowAugmentsExtendsWithoutParam: true
606+
augmentsExtendsReplacesDocs: true
607607
}
608608
}
609609
},

0 commit comments

Comments
 (0)