Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update: deprecate valid-jsdoc and require-jsdoc #11145

Merged
merged 1 commit into from Dec 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/rules/require-jsdoc.js
Expand Up @@ -43,7 +43,10 @@ module.exports = {
},
additionalProperties: false
}
]
],

deprecated: true,
replacedBy: []
},

create(context) {
Expand Down
5 changes: 4 additions & 1 deletion lib/rules/valid-jsdoc.js
Expand Up @@ -64,7 +64,10 @@ module.exports = {
}
],

fixable: "code"
fixable: "code",

deprecated: true,
replacedBy: []
},

create(context) {
Expand Down
1 change: 1 addition & 0 deletions lib/util/source-code.js
Expand Up @@ -316,6 +316,7 @@ class SourceCode extends TokenStore {
* @returns {Token|null} The Block comment token containing the JSDoc comment
* for the given node or null if not found.
* @public
* @deprecated
*/
getJSDocComment(node) {

Expand Down
12 changes: 9 additions & 3 deletions tests/lib/cli-engine.js
Expand Up @@ -733,6 +733,7 @@ describe("CLIEngine", () => {
it("should warn when deprecated rules are found in a config", () => {
engine = new CLIEngine({
cwd: originalDir,
useEslintrc: false,
configFile: "tests/fixtures/cli-engine/deprecated-rule-config/.eslintrc.yml"
});

Expand Down Expand Up @@ -1530,15 +1531,19 @@ describe("CLIEngine", () => {

assert.deepStrictEqual(
report.usedDeprecatedRules,
[{ ruleId: "indent-legacy", replacedBy: ["indent"] }]
[
{ ruleId: "indent-legacy", replacedBy: ["indent"] },
{ ruleId: "require-jsdoc", replacedBy: [] },
{ ruleId: "valid-jsdoc", replacedBy: [] }
]
);
});

it("should not warn when deprecated rules are not configured", () => {
engine = new CLIEngine({
cwd: originalDir,
configFile: ".eslintrc.js",
rules: { indent: 1 }
rules: { indent: 1, "valid-jsdoc": 0, "require-jsdoc": 0 }
});

const report = engine.executeOnFiles(["lib/cli*.js"]);
Expand All @@ -1549,7 +1554,8 @@ describe("CLIEngine", () => {
it("should warn when deprecated rules are found in a config", () => {
engine = new CLIEngine({
cwd: originalDir,
configFile: "tests/fixtures/cli-engine/deprecated-rule-config/.eslintrc.yml"
configFile: "tests/fixtures/cli-engine/deprecated-rule-config/.eslintrc.yml",
useEslintrc: false
});

const report = engine.executeOnFiles(["lib/cli*.js"]);
Expand Down