Chore: enable eslint-plugin-jsdoc (refs #11146)#12332
Conversation
24e99fc to
f1b974f
Compare
| * @property {number} fixableWarningCount Number of fixable warnings for the result. | ||
| * @property {string=} [source] The source code of the file that was linted. | ||
| * @property {string=} [output] The source code of the file that was linted, with as many fixes applied as possible. | ||
| * @property {string} [source] The source code of the file that was linted. |
There was a problem hiding this comment.
jsdoc/check-syntax enforces this syntax for optional parameters.
| /** | ||
| * Collect used deprecated rules. | ||
| * @param {ConfigArray[]} usedConfigArrays The config arrays which were used. | ||
| * @param {Map<string, Object>} ruleMap The rule definitions which were used (built-ins). |
There was a problem hiding this comment.
This parameter no longer exists.
| /** | ||
| * Creates a new instance of the core CLI engine. | ||
| * @param {CLIEngineOptions} providedOptions The options for this instance. | ||
| * @constructor |
There was a problem hiding this comment.
ES2015 classes no longer need to be documented as @class or @constructor - the parser can now identify this case.
| } | ||
|
|
||
| /* eslint-disable valid-jsdoc */ | ||
| /* eslint-disable jsdoc/check-param-names, jsdoc/require-param */ |
There was a problem hiding this comment.
A really nice thing about the separate checks is that we can disable specific checks and still enforce other things we care about!
| * configuration or options. | ||
| * | ||
| * @typedef {array|number} ruleConfig | ||
| * @typedef {Array|number} ruleConfig |
There was a problem hiding this comment.
I'm not sure why valid-jsdoc didn't catch this.
| /** | ||
| * Stored valid rule configurations for this instance | ||
| * @type {array} | ||
| * @type {Array} |
There was a problem hiding this comment.
I'm not sure why valid-jsdoc didn't catch this.
|
|
||
| /** | ||
| * Returns the path inside of the fixture directory. | ||
| * @param {...string} args file path segments. |
There was a problem hiding this comment.
It doesn't seem like valid-jsdoc enforced documenting rest parameters.
5b1d393 to
60486d1
Compare
|
I'm not sure why the commit-message check is failing - it looks like it should accept |
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain:
refs #11146
Finally have the time to switch to
eslint-plugin-jsdocineslint-config-eslintnow that our core JSDoc rules are deprecated!What changes did you make? (Give an overview)
This PR disables the deprecated
valid-jsdocandrequire-jsdoccore rules in favor of a series of (mostly) corresponding rules ineslint-plugin-jsdoc. This should probably be a major release ofeslint-config-eslint, as the behavior isn't entirely the same and I've added a few extra rules (please let me know if this isn't desired).New warnings:
It seems like these rules catch some
valid-jsdocfalse negatives and it's actually really nice that we can disable individual rules when we need to. I think it would also be nice to add the following rules in a future PR:Is there anything you'd like reviewers to focus on?
I'd appreciate some eyes on the changes that I've made in the comments themselves. Will try to preemptively leave comments for the rationale for these changes.