Codebase list eslint / fc7f404
Docs: add url to each of the rules (refs #6582) (#9788) * Docs: add url to each of the rules (refs #6582) Code mod: export default function transformer(file, api) { const j = api.jscodeshift; const name = file.path.split('/').pop().replace(/.js$/, ''); return j(file.source) .find(j.ObjectExpression) .filter(path => path.parentPath.node.key && path.parentPath.node.key.name === 'docs') .forEach(path => { const prop = j.property('init', j.identifier('url'), j.literal(`https://eslint.org/docs/rules/${name}`)); j(path).replaceWith(j.objectExpression([...path.node.properties, prop])); }) .toSource({lineTerminator: '\n'}); } * New: internal-rules/consistent-docs-url (refs #6582) Add a lint rule to ensure that each rule has a meta.docs.url property with the correct value. Patrick McElhaney authored 6 years ago Ilya Volodin committed 6 years ago
263 changed file(s) with 706 addition(s) and 259 deletion(s). Raw diff Collapse all Expand all
00 rules:
11 rulesdir/no-invalid-meta: "error"
22 rulesdir/consistent-docs-description: "error"
3 rulesdir/consistent-docs-url: "error"
7474 docs: {
7575 description: "enforce getter and setter pairs in objects",
7676 category: "Best Practices",
77 recommended: false
77 recommended: false,
78 url: "https://eslint.org/docs/rules/accessor-pairs"
7879 },
7980 schema: [{
8081 type: "object",
1515 docs: {
1616 description: "enforce linebreaks after opening and before closing array brackets",
1717 category: "Stylistic Issues",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/array-bracket-newline"
1920 },
2021 fixable: "whitespace",
2122 schema: [
1414 docs: {
1515 description: "enforce consistent spacing inside array brackets",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/array-bracket-spacing"
1819 },
1920 fixable: "whitespace",
2021 schema: [
141141 docs: {
142142 description: "enforce `return` statements in callbacks of array methods",
143143 category: "Best Practices",
144 recommended: false
144 recommended: false,
145 url: "https://eslint.org/docs/rules/array-callback-return"
145146 },
146147
147148 schema: [
1515 docs: {
1616 description: "enforce line breaks after each array element",
1717 category: "Stylistic Issues",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/array-element-newline"
1920 },
2021 fixable: "whitespace",
2122 schema: [
1818 docs: {
1919 description: "require braces around arrow function bodies",
2020 category: "ECMAScript 6",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/arrow-body-style"
2223 },
2324
2425 schema: {
1818 docs: {
1919 description: "require parentheses around arrow function arguments",
2020 category: "ECMAScript 6",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/arrow-parens"
2223 },
2324
2425 fixable: "code",
1818 docs: {
1919 description: "enforce consistent spacing before and after the arrow in arrow functions",
2020 category: "ECMAScript 6",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/arrow-spacing"
2223 },
2324
2425 fixable: "whitespace",
1212 docs: {
1313 description: "enforce the use of variables within the scope they are defined",
1414 category: "Best Practices",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/block-scoped-var"
1617 },
1718
1819 schema: []
1515 docs: {
1616 description: "disallow or enforce spaces inside of blocks after opening block and before closing block",
1717 category: "Stylistic Issues",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/block-spacing"
1920 },
2021
2122 fixable: "whitespace",
1515 docs: {
1616 description: "enforce consistent brace style for blocks",
1717 category: "Stylistic Issues",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/brace-style"
1920 },
2021
2122 schema: [
1212 docs: {
1313 description: "require `return` statements after callbacks",
1414 category: "Node.js and CommonJS",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/callback-return"
1617 },
1718
1819 schema: [{
1313 docs: {
1414 description: "enforce camelcase naming convention",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/camelcase"
1718 },
1819
1920 schema: [
112112 docs: {
113113 description: "enforce or disallow capitalization of the first letter of a comment",
114114 category: "Stylistic Issues",
115 recommended: false
115 recommended: false,
116 url: "https://eslint.org/docs/rules/capitalized-comments"
116117 },
117118 fixable: "code",
118119 schema: [
1313 docs: {
1414 description: "enforce that class methods utilize `this`",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/class-methods-use-this"
1718 },
1819 schema: [{
1920 type: "object",
7878 docs: {
7979 description: "require or disallow trailing commas",
8080 category: "Stylistic Issues",
81 recommended: false
81 recommended: false,
82 url: "https://eslint.org/docs/rules/comma-dangle"
8283 },
8384 fixable: "code",
8485 schema: {
1414 docs: {
1515 description: "enforce consistent spacing before and after commas",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/comma-spacing"
1819 },
1920
2021 fixable: "whitespace",
1515 docs: {
1616 description: "enforce consistent comma style",
1717 category: "Stylistic Issues",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/comma-style"
1920 },
2021 fixable: "code",
2122 schema: [
2222 docs: {
2323 description: "enforce a maximum cyclomatic complexity allowed in a program",
2424 category: "Best Practices",
25 recommended: false
25 recommended: false,
26 url: "https://eslint.org/docs/rules/complexity"
2627 },
2728
2829 schema: [
1414 docs: {
1515 description: "enforce consistent spacing inside computed property brackets",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/computed-property-spacing"
1819 },
1920
2021 fixable: "whitespace",
5555 docs: {
5656 description: "require `return` statements to either always or never specify values",
5757 category: "Best Practices",
58 recommended: false
58 recommended: false,
59 url: "https://eslint.org/docs/rules/consistent-return"
5960 },
6061
6162 schema: [{
1212 docs: {
1313 description: "enforce consistent naming when capturing the current execution context",
1414 category: "Stylistic Issues",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/consistent-this"
1617 },
1718
1819 schema: {
9494 docs: {
9595 description: "require `super()` calls in constructors",
9696 category: "ECMAScript 6",
97 recommended: true
97 recommended: true,
98 url: "https://eslint.org/docs/rules/constructor-super"
9899 },
99100
100101 schema: []
1818 docs: {
1919 description: "enforce consistent brace style for all control statements",
2020 category: "Best Practices",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/curly"
2223 },
2324
2425 schema: {
1414 docs: {
1515 description: "require `default` cases in `switch` statements",
1616 category: "Best Practices",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/default-case"
1819 },
1920
2021 schema: [{
1515 docs: {
1616 description: "enforce consistent newlines before and after dots",
1717 category: "Best Practices",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/dot-location"
1920 },
2021
2122 schema: [
2121 docs: {
2222 description: "enforce dot notation whenever possible",
2323 category: "Best Practices",
24 recommended: false
24 recommended: false,
25 url: "https://eslint.org/docs/rules/dot-notation"
2526 },
2627
2728 schema: [
1818 docs: {
1919 description: "require or disallow newline at the end of files",
2020 category: "Stylistic Issues",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/eol-last"
2223 },
2324 fixable: "whitespace",
2425 schema: [
1919 docs: {
2020 description: "require the use of `===` and `!==`",
2121 category: "Best Practices",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/eqeqeq"
2324 },
2425
2526 schema: {
1313 docs: {
1414 description: "enforce \"for\" loop update clause moving the counter in the right direction.",
1515 category: "Possible Errors",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/for-direction"
1718 },
1819 fixable: null,
1920 schema: []
1919 docs: {
2020 description: "require or disallow spacing between function identifiers and their invocations",
2121 category: "Stylistic Issues",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/func-call-spacing"
2324 },
2425
2526 fixable: "whitespace",
6969 docs: {
7070 description: "require function names to match the name of the variable or property to which they are assigned",
7171 category: "Stylistic Issues",
72 recommended: false
72 recommended: false,
73 url: "https://eslint.org/docs/rules/func-name-matching"
7374 },
7475
7576 schema: {
2828 docs: {
2929 description: "require or disallow named `function` expressions",
3030 category: "Stylistic Issues",
31 recommended: false
31 recommended: false,
32 url: "https://eslint.org/docs/rules/func-names"
3233 },
3334
3435 schema: [
1212 docs: {
1313 description: "enforce the consistent use of either `function` declarations or expressions",
1414 category: "Stylistic Issues",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/func-style"
1617 },
1718
1819 schema: [
1818 docs: {
1919 description: "enforce consistent line breaks inside function parentheses",
2020 category: "Stylistic Issues",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/function-paren-newline"
2223 },
2324 fixable: "whitespace",
2425 schema: [
2929 docs: {
3030 description: "enforce consistent spacing around `*` operators in generator functions",
3131 category: "ECMAScript 6",
32 recommended: false
32 recommended: false,
33 url: "https://eslint.org/docs/rules/generator-star-spacing"
3334 },
3435
3536 fixable: "whitespace",
4646 docs: {
4747 description: "enforce `return` statements in getters",
4848 category: "Possible Errors",
49 recommended: false
49 recommended: false,
50 url: "https://eslint.org/docs/rules/getter-return"
5051 },
5152 fixable: null,
5253 schema: [
5050 docs: {
5151 description: "require `require()` calls to be placed at top-level module scope",
5252 category: "Node.js and CommonJS",
53 recommended: false
53 recommended: false,
54 url: "https://eslint.org/docs/rules/global-require"
5455 },
5556
5657 schema: []
1313 docs: {
1414 description: "require `for-in` loops to include an `if` statement",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/guard-for-in"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "require error handling in callbacks",
1515 category: "Node.js and CommonJS",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/handle-callback-err"
1718 },
1819
1920 schema: [
1414 docs: {
1515 description: "disallow specified identifiers",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/id-blacklist"
1819 },
1920
2021 schema: {
1414 docs: {
1515 description: "enforce minimum and maximum identifier lengths",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/id-length"
1819 },
1920
2021 schema: [
1313 docs: {
1414 description: "require identifiers to match a specified regular expression",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/id-match"
1718 },
1819
1920 schema: [
1111 docs: {
1212 description: "enforce the location of arrow function bodies",
1313 category: "Stylistic Issues",
14 recommended: false
14 recommended: false,
15 url: "https://eslint.org/docs/rules/implicit-arrow-linebreak"
1516 },
1617 fixable: "whitespace",
1718 schema: [
2424 description: "enforce consistent indentation",
2525 category: "Stylistic Issues",
2626 recommended: false,
27 replacedBy: ["indent"]
27 replacedBy: ["indent"],
28 url: "https://eslint.org/docs/rules/indent-legacy"
2829 },
2930
3031 deprecated: true,
491491 docs: {
492492 description: "enforce consistent indentation",
493493 category: "Stylistic Issues",
494 recommended: false
494 recommended: false,
495 url: "https://eslint.org/docs/rules/indent"
495496 },
496497
497498 fixable: "whitespace",
4646 docs: {
4747 description: "require or disallow initialization in variable declarations",
4848 category: "Variables",
49 recommended: false
49 recommended: false,
50 url: "https://eslint.org/docs/rules/init-declarations"
5051 },
5152
5253 schema: {
4040 docs: {
4141 description: "enforce the consistent use of either double or single quotes in JSX attributes",
4242 category: "Stylistic Issues",
43 recommended: false
43 recommended: false,
44 url: "https://eslint.org/docs/rules/jsx-quotes"
4445 },
4546
4647 fixable: "whitespace",
130130 docs: {
131131 description: "enforce consistent spacing between keys and values in object literal properties",
132132 category: "Stylistic Issues",
133 recommended: false
133 recommended: false,
134 url: "https://eslint.org/docs/rules/key-spacing"
134135 },
135136
136137 fixable: "whitespace",
6767 docs: {
6868 description: "enforce consistent spacing before and after keywords",
6969 category: "Stylistic Issues",
70 recommended: false
70 recommended: false,
71 url: "https://eslint.org/docs/rules/keyword-spacing"
7172 },
7273
7374 fixable: "whitespace",
1414 docs: {
1515 description: "enforce position of line comments",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/line-comment-position"
1819 },
1920
2021 schema: [
1919 docs: {
2020 description: "enforce consistent linebreak style",
2121 category: "Stylistic Issues",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/linebreak-style"
2324 },
2425
2526 fixable: "whitespace",
5454 docs: {
5555 description: "require empty lines around comments",
5656 category: "Stylistic Issues",
57 recommended: false
57 recommended: false,
58 url: "https://eslint.org/docs/rules/lines-around-comment"
5859 },
5960
6061 fixable: "whitespace",
1717 description: "require or disallow newlines around directives",
1818 category: "Stylistic Issues",
1919 recommended: false,
20 replacedBy: ["padding-line-between-statements"]
20 replacedBy: ["padding-line-between-statements"],
21 url: "https://eslint.org/docs/rules/lines-around-directive"
2122 },
2223 schema: [{
2324 oneOf: [
1414 docs: {
1515 description: "require or disallow an empty line between class members",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/lines-between-class-members"
1819 },
1920
2021 fixable: "whitespace",
1313 docs: {
1414 description: "enforce a maximum depth that blocks can be nested",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/max-depth"
1718 },
1819
1920 schema: [
6767 docs: {
6868 description: "enforce a maximum line length",
6969 category: "Stylistic Issues",
70 recommended: false
70 recommended: false,
71 url: "https://eslint.org/docs/rules/max-len"
7172 },
7273
7374 schema: [
1919 docs: {
2020 description: "enforce a maximum number of lines per file",
2121 category: "Stylistic Issues",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/max-lines"
2324 },
2425
2526 schema: [
1313 docs: {
1414 description: "enforce a maximum depth that callbacks can be nested",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/max-nested-callbacks"
1718 },
1819
1920 schema: [
2121 docs: {
2222 description: "enforce a maximum number of parameters in function definitions",
2323 category: "Stylistic Issues",
24 recommended: false
24 recommended: false,
25 url: "https://eslint.org/docs/rules/max-params"
2526 },
2627
2728 schema: [
1818 docs: {
1919 description: "enforce a maximum number of statements allowed per line",
2020 category: "Stylistic Issues",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/max-statements-per-line"
2223 },
2324
2425 schema: [
2121 docs: {
2222 description: "enforce a maximum number of statements allowed in function blocks",
2323 category: "Stylistic Issues",
24 recommended: false
24 recommended: false,
25 url: "https://eslint.org/docs/rules/max-statements"
2526 },
2627
2728 schema: [
1414 docs: {
1515 description: "enforce a particular style for multiline comments",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/multiline-comment-style"
1819 },
1920 fixable: "whitespace",
2021 schema: [{ enum: ["starred-block", "separate-lines", "bare-block"] }]
1515 docs: {
1616 description: "enforce newlines between operands of ternary expressions",
1717 category: "Stylistic Issues",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/multiline-ternary"
1920 },
2021 schema: [
2122 {
7676 docs: {
7777 description: "require constructor names to begin with a capital letter",
7878 category: "Stylistic Issues",
79 recommended: false
79 recommended: false,
80 url: "https://eslint.org/docs/rules/new-cap"
8081 },
8182
8283 schema: [
2323 docs: {
2424 description: "require parentheses when invoking a constructor with no arguments",
2525 category: "Stylistic Issues",
26 recommended: false
26 recommended: false,
27 url: "https://eslint.org/docs/rules/new-parens"
2728 },
2829
2930 schema: [],
2121 description: "require or disallow an empty line after variable declarations",
2222 category: "Stylistic Issues",
2323 recommended: false,
24 replacedBy: ["padding-line-between-statements"]
24 replacedBy: ["padding-line-between-statements"],
25 url: "https://eslint.org/docs/rules/newline-after-var"
2526 },
2627
2728 schema: [
1414 description: "require an empty line before `return` statements",
1515 category: "Stylistic Issues",
1616 recommended: false,
17 replacedBy: ["padding-line-between-statements"]
17 replacedBy: ["padding-line-between-statements"],
18 url: "https://eslint.org/docs/rules/newline-before-return"
1819 },
1920 fixable: "whitespace",
2021 schema: [],
1616 docs: {
1717 description: "require a newline after each call in a method chain",
1818 category: "Stylistic Issues",
19 recommended: false
19 recommended: false,
20 url: "https://eslint.org/docs/rules/newline-per-chained-call"
2021 },
2122 fixable: "whitespace",
2223 schema: [{
8787 docs: {
8888 description: "disallow the use of `alert`, `confirm`, and `prompt`",
8989 category: "Best Practices",
90 recommended: false
90 recommended: false,
91 url: "https://eslint.org/docs/rules/no-alert"
9192 },
9293
9394 schema: []
1313 docs: {
1414 description: "disallow `Array` constructors",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-array-constructor"
1718 },
1819
1920 schema: []
2727 docs: {
2828 description: "disallow `await` inside of loops",
2929 category: "Possible Errors",
30 recommended: false
30 recommended: false,
31 url: "https://eslint.org/docs/rules/no-await-in-loop"
3132 },
3233 schema: []
3334 },
2424 docs: {
2525 description: "disallow bitwise operators",
2626 category: "Stylistic Issues",
27 recommended: false
27 recommended: false,
28 url: "https://eslint.org/docs/rules/no-bitwise"
2829 },
2930
3031 schema: [
1212 docs: {
1313 description: "disallow use of the Buffer() constructor",
1414 category: "Node.js and CommonJS",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/no-buffer-constructor"
1617 },
1718 schema: []
1819 },
1313 docs: {
1414 description: "disallow the use of `arguments.caller` or `arguments.callee`",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-caller"
1718 },
1819
1920 schema: []
1212 docs: {
1313 description: "disallow lexical declarations in case clauses",
1414 category: "Best Practices",
15 recommended: true
15 recommended: true,
16 url: "https://eslint.org/docs/rules/no-case-declarations"
1617 },
1718
1819 schema: []
1919 docs: {
2020 description: "disallow `catch` clause parameters from shadowing variables in the outer scope",
2121 category: "Variables",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/no-catch-shadow"
2324 },
2425
2526 schema: []
1515 docs: {
1616 description: "disallow reassigning class members",
1717 category: "ECMAScript 6",
18 recommended: true
18 recommended: true,
19 url: "https://eslint.org/docs/rules/no-class-assign"
1920 },
2021
2122 schema: []
1212 docs: {
1313 description: "disallow comparing against -0",
1414 category: "Possible Errors",
15 recommended: true
15 recommended: true,
16 url: "https://eslint.org/docs/rules/no-compare-neg-zero"
1617 },
1718 fixable: null,
1819 schema: []
2121 docs: {
2222 description: "disallow assignment operators in conditional expressions",
2323 category: "Possible Errors",
24 recommended: true
24 recommended: true,
25 url: "https://eslint.org/docs/rules/no-cond-assign"
2526 },
2627
2728 schema: [
2929 docs: {
3030 description: "disallow arrow functions where they could be confused with comparisons",
3131 category: "ECMAScript 6",
32 recommended: false
32 recommended: false,
33 url: "https://eslint.org/docs/rules/no-confusing-arrow"
3334 },
3435
3536 fixable: "code",
1919 docs: {
2020 description: "disallow the use of `console`",
2121 category: "Possible Errors",
22 recommended: true
22 recommended: true,
23 url: "https://eslint.org/docs/rules/no-console"
2324 },
2425
2526 schema: [
1515 docs: {
1616 description: "disallow reassigning `const` variables",
1717 category: "ECMAScript 6",
18 recommended: true
18 recommended: true,
19 url: "https://eslint.org/docs/rules/no-const-assign"
1920 },
2021
2122 schema: []
1313 docs: {
1414 description: "disallow constant expressions in conditions",
1515 category: "Possible Errors",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/no-constant-condition"
1718 },
1819
1920 schema: [
1313 docs: {
1414 description: "disallow `continue` statements",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-continue"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "disallow control characters in regular expressions",
1515 category: "Possible Errors",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/no-control-regex"
1718 },
1819
1920 schema: []
1515 docs: {
1616 description: "disallow the use of `debugger`",
1717 category: "Possible Errors",
18 recommended: true
18 recommended: true,
19 url: "https://eslint.org/docs/rules/no-debugger"
1920 },
2021 fixable: "code",
2122 schema: []
1313 docs: {
1414 description: "disallow deleting variables",
1515 category: "Variables",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/no-delete-var"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "disallow division operators explicitly at the beginning of regular expressions",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-div-regex"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "disallow duplicate arguments in `function` definitions",
1515 category: "Possible Errors",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/no-dupe-args"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "disallow duplicate class members",
1515 category: "ECMAScript 6",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/no-dupe-class-members"
1718 },
1819
1920 schema: []
8686 docs: {
8787 description: "disallow duplicate keys in object literals",
8888 category: "Possible Errors",
89 recommended: true
89 recommended: true,
90 url: "https://eslint.org/docs/rules/no-dupe-keys"
9091 },
9192
9293 schema: []
1414 docs: {
1515 description: "disallow duplicate case labels",
1616 category: "Possible Errors",
17 recommended: true
17 recommended: true,
18 url: "https://eslint.org/docs/rules/no-duplicate-case"
1819 },
1920
2021 schema: []
103103 docs: {
104104 description: "disallow duplicate module imports",
105105 category: "ECMAScript 6",
106 recommended: false
106 recommended: false,
107 url: "https://eslint.org/docs/rules/no-duplicate-imports"
107108 },
108109
109110 schema: [{
2020 docs: {
2121 description: "disallow `else` blocks after `return` statements in `if` statements",
2222 category: "Best Practices",
23 recommended: false
23 recommended: false,
24 url: "https://eslint.org/docs/rules/no-else-return"
2425 },
2526
2627 schema: [{
3131 docs: {
3232 description: "disallow empty character classes in regular expressions",
3333 category: "Possible Errors",
34 recommended: true
34 recommended: true,
35 url: "https://eslint.org/docs/rules/no-empty-character-class"
3536 },
3637
3738 schema: []
9292 docs: {
9393 description: "disallow empty functions",
9494 category: "Best Practices",
95 recommended: false
95 recommended: false,
96 url: "https://eslint.org/docs/rules/no-empty-function"
9697 },
9798
9899 schema: [
1212 docs: {
1313 description: "disallow empty destructuring patterns",
1414 category: "Best Practices",
15 recommended: true
15 recommended: true,
16 url: "https://eslint.org/docs/rules/no-empty-pattern"
1617 },
1718
1819 schema: []
1818 docs: {
1919 description: "disallow empty block statements",
2020 category: "Possible Errors",
21 recommended: true
21 recommended: true,
22 url: "https://eslint.org/docs/rules/no-empty"
2223 },
2324
2425 schema: [
1414 docs: {
1515 description: "disallow `null` comparisons without type-checking operators",
1616 category: "Best Practices",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/no-eq-null"
1819 },
1920
2021 schema: []
7878 docs: {
7979 description: "disallow the use of `eval()`",
8080 category: "Best Practices",
81 recommended: false
81 recommended: false,
82 url: "https://eslint.org/docs/rules/no-eval"
8283 },
8384
8485 schema: [
1515 docs: {
1616 description: "disallow reassigning exceptions in `catch` clauses",
1717 category: "Possible Errors",
18 recommended: true
18 recommended: true,
19 url: "https://eslint.org/docs/rules/no-ex-assign"
1920 },
2021
2122 schema: []
2626 docs: {
2727 description: "disallow extending native types",
2828 category: "Best Practices",
29 recommended: false
29 recommended: false,
30 url: "https://eslint.org/docs/rules/no-extend-native"
3031 },
3132
3233 schema: [
1818 docs: {
1919 description: "disallow unnecessary calls to `.bind()`",
2020 category: "Best Practices",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/no-extra-bind"
2223 },
2324
2425 schema: [],
1919 docs: {
2020 description: "disallow unnecessary boolean casts",
2121 category: "Possible Errors",
22 recommended: true
22 recommended: true,
23 url: "https://eslint.org/docs/rules/no-extra-boolean-cast"
2324 },
2425
2526 schema: [],
1919 docs: {
2020 description: "disallow unnecessary labels",
2121 category: "Best Practices",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/no-extra-label"
2324 },
2425
2526 schema: [],
1414 docs: {
1515 description: "disallow unnecessary parentheses",
1616 category: "Possible Errors",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/no-extra-parens"
1819 },
1920
2021 fixable: "code",
2020 docs: {
2121 description: "disallow unnecessary semicolons",
2222 category: "Possible Errors",
23 recommended: true
23 recommended: true,
24 url: "https://eslint.org/docs/rules/no-extra-semi"
2425 },
2526
2627 fixable: "code",
5757 docs: {
5858 description: "disallow fallthrough of `case` statements",
5959 category: "Best Practices",
60 recommended: true
60 recommended: true,
61 url: "https://eslint.org/docs/rules/no-fallthrough"
6162 },
6263
6364 schema: [
1919 docs: {
2020 description: "disallow leading or trailing decimal points in numeric literals",
2121 category: "Best Practices",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/no-floating-decimal"
2324 },
2425
2526 schema: [],
1515 docs: {
1616 description: "disallow reassigning `function` declarations",
1717 category: "Possible Errors",
18 recommended: true
18 recommended: true,
19 url: "https://eslint.org/docs/rules/no-func-assign"
1920 },
2021
2122 schema: []
1313 docs: {
1414 description: "disallow assignments to native objects or read-only global variables",
1515 category: "Best Practices",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/no-global-assign"
1718 },
1819
1920 schema: [
155155 docs: {
156156 description: "disallow shorthand type conversions",
157157 category: "Best Practices",
158 recommended: false
158 recommended: false,
159 url: "https://eslint.org/docs/rules/no-implicit-coercion"
159160 },
160161
161162 fixable: "code",
1313 docs: {
1414 description: "disallow variable and `function` declarations in the global scope",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-implicit-globals"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "disallow the use of `eval()`-like methods",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-implied-eval"
1718 },
1819
1920 schema: []
1414 docs: {
1515 description: "disallow inline comments after code",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/no-inline-comments"
1819 },
1920
2021 schema: []
1313 docs: {
1414 description: "disallow variable or `function` declarations in nested blocks",
1515 category: "Possible Errors",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/no-inner-declarations"
1718 },
1819
1920 schema: [
1818 docs: {
1919 description: "disallow invalid regular expression strings in `RegExp` constructors",
2020 category: "Possible Errors",
21 recommended: true
21 recommended: true,
22 url: "https://eslint.org/docs/rules/no-invalid-regexp"
2223 },
2324
2425 schema: [{
1919 docs: {
2020 description: "disallow `this` keywords outside of classes or class-like objects",
2121 category: "Best Practices",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/no-invalid-this"
2324 },
2425
2526 schema: []
2929 docs: {
3030 description: "disallow irregular whitespace outside of strings and comments",
3131 category: "Possible Errors",
32 recommended: true
32 recommended: true,
33 url: "https://eslint.org/docs/rules/no-irregular-whitespace"
3334 },
3435
3536 schema: [
1313 docs: {
1414 description: "disallow the use of the `__iterator__` property",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-iterator"
1718 },
1819
1920 schema: []
1919 docs: {
2020 description: "disallow labels that share a name with a variable",
2121 category: "Variables",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/no-label-var"
2324 },
2425
2526 schema: []
1818 docs: {
1919 description: "disallow labeled statements",
2020 category: "Best Practices",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/no-labels"
2223 },
2324
2425 schema: [
1313 docs: {
1414 description: "disallow unnecessary nested blocks",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-lone-blocks"
1718 },
1819
1920 schema: []
1212 docs: {
1313 description: "disallow `if` statements as the only statement in `else` blocks",
1414 category: "Stylistic Issues",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/no-lonely-if"
1617 },
1718
1819 schema: [],
158158 docs: {
159159 description: "disallow `function` declarations and expressions inside loop statements",
160160 category: "Best Practices",
161 recommended: false
161 recommended: false,
162 url: "https://eslint.org/docs/rules/no-loop-func"
162163 },
163164
164165 schema: []
1313 docs: {
1414 description: "disallow magic numbers",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-magic-numbers"
1718 },
1819
1920 schema: [{
7373 docs: {
7474 description: "disallow mixed binary operators",
7575 category: "Stylistic Issues",
76 recommended: false
76 recommended: false,
77 url: "https://eslint.org/docs/rules/no-mixed-operators"
7778 },
7879 schema: [
7980 {
1313 docs: {
1414 description: "disallow `require` calls to be mixed with regular variable declarations",
1515 category: "Node.js and CommonJS",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-mixed-requires"
1718 },
1819
1920 schema: [
1212 docs: {
1313 description: "disallow mixed spaces and tabs for indentation",
1414 category: "Stylistic Issues",
15 recommended: true
15 recommended: true,
16 url: "https://eslint.org/docs/rules/no-mixed-spaces-and-tabs"
1617 },
1718
1819 schema: [
1414 docs: {
1515 description: "disallow use of chained assignment expressions",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/no-multi-assign"
1819 },
1920 schema: []
2021 },
1515 docs: {
1616 description: "disallow multiple spaces",
1717 category: "Best Practices",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/no-multi-spaces"
1920 },
2021
2122 fixable: "whitespace",
1919 docs: {
2020 description: "disallow multiline strings",
2121 category: "Best Practices",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/no-multi-str"
2324 },
2425
2526 schema: []
1313 docs: {
1414 description: "disallow multiple empty lines",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-multiple-empty-lines"
1718 },
1819
1920 fixable: "whitespace",
1515 description: "disallow assignments to native objects or read-only global variables",
1616 category: "Best Practices",
1717 recommended: false,
18 replacedBy: ["no-global-assign"]
18 replacedBy: ["no-global-assign"],
19 url: "https://eslint.org/docs/rules/no-native-reassign"
1920 },
2021
2122 deprecated: true,
1212 docs: {
1313 description: "disallow negated conditions",
1414 category: "Stylistic Issues",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/no-negated-condition"
1617 },
1718
1819 schema: []
1515 description: "disallow negating the left operand in `in` expressions",
1616 category: "Possible Errors",
1717 recommended: false,
18 replacedBy: ["no-unsafe-negation"]
18 replacedBy: ["no-unsafe-negation"],
19 url: "https://eslint.org/docs/rules/no-negated-in-lhs"
1920 },
2021 deprecated: true,
2122
1313 docs: {
1414 description: "disallow nested ternary expressions",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-nested-ternary"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "disallow `new` operators with the `Function` object",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-new-func"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "disallow `Object` constructors",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-new-object"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "disallow `new` operators with calls to `require`",
1515 category: "Node.js and CommonJS",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-new-require"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "disallow `new` operators with the `Symbol` object",
1515 category: "ECMAScript 6",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/no-new-symbol"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "disallow `new` operators with the `String`, `Number`, and `Boolean` objects",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-new-wrappers"
1718 },
1819
1920 schema: []
1414 docs: {
1515 description: "disallow `new` operators outside of assignments or comparisons",
1616 category: "Best Practices",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/no-new"
1819 },
1920
2021 schema: []
1313 docs: {
1414 description: "disallow calling global object properties as functions",
1515 category: "Possible Errors",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/no-obj-calls"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "disallow octal escape sequences in string literals",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-octal-escape"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "disallow octal literals",
1515 category: "Best Practices",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/no-octal"
1718 },
1819
1920 schema: []
1414 docs: {
1515 description: "disallow reassigning `function` parameters",
1616 category: "Best Practices",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/no-param-reassign"
1819 },
1920
2021 schema: [
1212 docs: {
1313 description: "disallow string concatenation with `__dirname` and `__filename`",
1414 category: "Node.js and CommonJS",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/no-path-concat"
1617 },
1718
1819 schema: []
1414 docs: {
1515 description: "disallow the unary operators `++` and `--`",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/no-plusplus"
1819 },
1920
2021 schema: [
1212 docs: {
1313 description: "disallow the use of `process.env`",
1414 category: "Node.js and CommonJS",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/no-process-env"
1617 },
1718
1819 schema: []
1212 docs: {
1313 description: "disallow the use of `process.exit()`",
1414 category: "Node.js and CommonJS",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/no-process-exit"
1617 },
1718
1819 schema: []
1313 docs: {
1414 description: "disallow the use of the `__proto__` property",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-proto"
1718 },
1819
1920 schema: []
1212 docs: {
1313 description: "disallow calling some `Object.prototype` methods directly on objects",
1414 category: "Possible Errors",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/no-prototype-builtins"
1617 },
1718
1819 schema: []
1313 docs: {
1414 description: "disallow variable redeclaration",
1515 category: "Best Practices",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/no-redeclare"
1718 },
1819
1920 schema: [
1515 docs: {
1616 description: "disallow multiple spaces in regular expressions",
1717 category: "Possible Errors",
18 recommended: true
18 recommended: true,
19 url: "https://eslint.org/docs/rules/no-regex-spaces"
1920 },
2021
2122 schema: [],
1919 docs: {
2020 description: "disallow specified global variables",
2121 category: "Variables",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/no-restricted-globals"
2324 },
2425
2526 schema: {
5555 docs: {
5656 description: "disallow specified modules when loaded by `import`",
5757 category: "ECMAScript 6",
58 recommended: false
58 recommended: false,
59 url: "https://eslint.org/docs/rules/no-restricted-imports"
5960 },
6061
6162 schema: {
4949 docs: {
5050 description: "disallow specified modules when loaded by `require`",
5151 category: "Node.js and CommonJS",
52 recommended: false
52 recommended: false,
53 url: "https://eslint.org/docs/rules/no-restricted-modules"
5354 },
5455
5556 schema: {
1515 docs: {
1616 description: "disallow certain properties on certain objects",
1717 category: "Best Practices",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/no-restricted-properties"
1920 },
2021
2122 schema: {
1212 docs: {
1313 description: "disallow specified syntax",
1414 category: "Stylistic Issues",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/no-restricted-syntax"
1617 },
1718
1819 schema: {
2424 docs: {
2525 description: "disallow assignment operators in `return` statements",
2626 category: "Best Practices",
27 recommended: false
27 recommended: false,
28 url: "https://eslint.org/docs/rules/no-return-assign"
2829 },
2930
3031 schema: [
1616 docs: {
1717 description: "disallow unnecessary `return await`",
1818 category: "Best Practices",
19 recommended: false // TODO: set to true
19
20 // TODO: set to true
21 recommended: false,
22
23 url: "https://eslint.org/docs/rules/no-return-await"
2024 },
2125 fixable: null,
2226 schema: [
1515 docs: {
1616 description: "disallow `javascript:` urls",
1717 category: "Best Practices",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/no-script-url"
1920 },
2021
2122 schema: []
165165 docs: {
166166 description: "disallow assignments where both sides are exactly the same",
167167 category: "Best Practices",
168 recommended: true
168 recommended: true,
169 url: "https://eslint.org/docs/rules/no-self-assign"
169170 },
170171
171172 schema: [
1414 docs: {
1515 description: "disallow comparisons where both sides are exactly the same",
1616 category: "Best Practices",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/no-self-compare"
1819 },
1920
2021 schema: []
1919 docs: {
2020 description: "disallow comma operators",
2121 category: "Best Practices",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/no-sequences"
2324 },
2425
2526 schema: []
1212 docs: {
1313 description: "disallow identifiers from shadowing restricted names",
1414 category: "Variables",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/no-shadow-restricted-names"
1617 },
1718
1819 schema: []
1919 docs: {
2020 description: "disallow variable declarations from shadowing variables declared in the outer scope",
2121 category: "Variables",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/no-shadow"
2324 },
2425
2526 schema: [
1515 description: "disallow spacing between function identifiers and their applications (deprecated)",
1616 category: "Stylistic Issues",
1717 recommended: false,
18 replacedBy: ["func-call-spacing"]
18 replacedBy: ["func-call-spacing"],
19 url: "https://eslint.org/docs/rules/no-spaced-func"
1920 },
2021
2122 deprecated: true,
1212 docs: {
1313 description: "disallow sparse arrays",
1414 category: "Possible Errors",
15 recommended: true
15 recommended: true,
16 url: "https://eslint.org/docs/rules/no-sparse-arrays"
1617 },
1718
1819 schema: []
1515 docs: {
1616 description: "disallow synchronous methods",
1717 category: "Node.js and CommonJS",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/no-sync"
1920 },
2021
2122 schema: [
1818 docs: {
1919 description: "disallow all tabs",
2020 category: "Stylistic Issues",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/no-tabs"
2223 },
2324 schema: []
2425 },
1212 docs: {
1313 description: "disallow template literal placeholder syntax in regular strings",
1414 category: "Possible Errors",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/no-template-curly-in-string"
1617 },
1718
1819 schema: []
1313 docs: {
1414 description: "disallow ternary operators",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-ternary"
1718 },
1819
1920 schema: []
3838 docs: {
3939 description: "disallow `this`/`super` before calling `super()` in constructors",
4040 category: "ECMAScript 6",
41 recommended: true
41 recommended: true,
42 url: "https://eslint.org/docs/rules/no-this-before-super"
4243 },
4344
4445 schema: []
1515 docs: {
1616 description: "disallow throwing literals as exceptions",
1717 category: "Best Practices",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/no-throw-literal"
1920 },
2021
2122 schema: []
1818 docs: {
1919 description: "disallow trailing whitespace at the end of lines",
2020 category: "Stylistic Issues",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/no-trailing-spaces"
2223 },
2324
2425 fixable: "whitespace",
1515 docs: {
1616 description: "disallow initializing variables to `undefined`",
1717 category: "Variables",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/no-undef-init"
1920 },
2021
2122 schema: [],
2727 docs: {
2828 description: "disallow the use of undeclared variables unless mentioned in `/*global */` comments",
2929 category: "Variables",
30 recommended: true
30 recommended: true,
31 url: "https://eslint.org/docs/rules/no-undef"
3132 },
3233
3334 schema: [
1212 docs: {
1313 description: "disallow the use of `undefined` as an identifier",
1414 category: "Variables",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/no-undefined"
1617 },
1718
1819 schema: []
1313 docs: {
1414 description: "disallow dangling underscores in identifiers",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-underscore-dangle"
1718 },
1819
1920 schema: [
1818 docs: {
1919 description: "disallow confusing multiline expressions",
2020 category: "Possible Errors",
21 recommended: true
21 recommended: true,
22 url: "https://eslint.org/docs/rules/no-unexpected-multiline"
2223 },
2324
2425 schema: []
168168 docs: {
169169 description: "disallow unmodified loop conditions",
170170 category: "Best Practices",
171 recommended: false
171 recommended: false,
172 url: "https://eslint.org/docs/rules/no-unmodified-loop-condition"
172173 },
173174
174175 schema: []
2626 docs: {
2727 description: "disallow ternary operators when simpler alternatives exist",
2828 category: "Stylistic Issues",
29 recommended: false
29 recommended: false,
30 url: "https://eslint.org/docs/rules/no-unneeded-ternary"
3031 },
3132
3233 schema: [
103103 docs: {
104104 description: "disallow unreachable code after `return`, `throw`, `continue`, and `break` statements",
105105 category: "Possible Errors",
106 recommended: true
106 recommended: true,
107 url: "https://eslint.org/docs/rules/no-unreachable"
107108 },
108109
109110 schema: []
2222 docs: {
2323 description: "disallow control flow statements in `finally` blocks",
2424 category: "Possible Errors",
25 recommended: true
25 recommended: true,
26 url: "https://eslint.org/docs/rules/no-unsafe-finally"
2627 },
2728
2829 schema: []
4343 docs: {
4444 description: "disallow negating the left operand of relational operators",
4545 category: "Possible Errors",
46 recommended: true
46 recommended: true,
47 url: "https://eslint.org/docs/rules/no-unsafe-negation"
4748 },
4849 schema: [],
4950 fixable: "code"
1212 docs: {
1313 description: "disallow unused expressions",
1414 category: "Best Practices",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/no-unused-expressions"
1617 },
1718
1819 schema: [
1313 docs: {
1414 description: "disallow unused labels",
1515 category: "Best Practices",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/no-unused-labels"
1718 },
1819
1920 schema: [],
2020 docs: {
2121 description: "disallow unused variables",
2222 category: "Variables",
23 recommended: true
23 recommended: true,
24 url: "https://eslint.org/docs/rules/no-unused-vars"
2425 },
2526
2627 schema: [
138138 docs: {
139139 description: "disallow the use of variables before they are defined",
140140 category: "Variables",
141 recommended: false
141 recommended: false,
142 url: "https://eslint.org/docs/rules/no-use-before-define"
142143 },
143144
144145 schema: [
5151 docs: {
5252 description: "disallow unnecessary calls to `.call()` and `.apply()`",
5353 category: "Best Practices",
54 recommended: false
54 recommended: false,
55 url: "https://eslint.org/docs/rules/no-useless-call"
5556 },
5657
5758 schema: []
2020 docs: {
2121 description: "disallow unnecessary computed property keys in object literals",
2222 category: "ECMAScript 6",
23 recommended: false
23 recommended: false,
24 url: "https://eslint.org/docs/rules/no-useless-computed-key"
2425 },
2526
2627 schema: [],
6868 docs: {
6969 description: "disallow unnecessary concatenation of literals or template literals",
7070 category: "Best Practices",
71 recommended: false
71 recommended: false,
72 url: "https://eslint.org/docs/rules/no-useless-concat"
7273 },
7374
7475 schema: []
144144 docs: {
145145 description: "disallow unnecessary constructors",
146146 category: "ECMAScript 6",
147 recommended: false
147 recommended: false,
148 url: "https://eslint.org/docs/rules/no-useless-constructor"
148149 },
149150
150151 schema: []
8181 docs: {
8282 description: "disallow unnecessary escape characters",
8383 category: "Best Practices",
84 recommended: true
84 recommended: true,
85 url: "https://eslint.org/docs/rules/no-useless-escape"
8586 },
8687
8788 schema: []
1313 docs: {
1414 description: "disallow renaming import, export, and destructured assignments to the same name",
1515 category: "ECMAScript 6",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-useless-rename"
1718 },
1819 fixable: "code",
1920 schema: [
7575 docs: {
7676 description: "disallow redundant return statements",
7777 category: "Best Practices",
78 recommended: false
78 recommended: false,
79 url: "https://eslint.org/docs/rules/no-useless-return"
7980 },
8081 fixable: "code",
8182 schema: []
182182 docs: {
183183 description: "require `let` or `const` instead of `var`",
184184 category: "ECMAScript 6",
185 recommended: false
185 recommended: false,
186 url: "https://eslint.org/docs/rules/no-var"
186187 },
187188
188189 schema: [],
1212 docs: {
1313 description: "disallow `void` operators",
1414 category: "Best Practices",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/no-void"
1617 },
1718
1819 schema: []
1515 docs: {
1616 description: "disallow specified warning terms in comments",
1717 category: "Best Practices",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/no-warning-comments"
1920 },
2021
2122 schema: [
1818 docs: {
1919 description: "disallow whitespace before properties",
2020 category: "Stylistic Issues",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/no-whitespace-before-property"
2223 },
2324
2425 fixable: "whitespace",
1313 docs: {
1414 description: "disallow `with` statements",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/no-with"
1718 },
1819
1920 schema: []
1414 docs: {
1515 description: "enforce the location of single-line statements",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/nonblock-statement-body-position"
1819 },
1920 fixable: "whitespace",
2021 schema: [
9696 docs: {
9797 description: "enforce consistent line breaks inside braces",
9898 category: "Stylistic Issues",
99 recommended: false
99 recommended: false,
100 url: "https://eslint.org/docs/rules/object-curly-newline"
100101 },
101102 fixable: "whitespace",
102103 schema: [
1414 docs: {
1515 description: "enforce consistent spacing inside braces",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/object-curly-spacing"
1819 },
1920
2021 fixable: "whitespace",
1313 docs: {
1414 description: "enforce placing object properties on separate lines",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/object-property-newline"
1718 },
1819
1920 schema: [
2626 docs: {
2727 description: "require or disallow method and property shorthand syntax for object literals",
2828 category: "ECMAScript 6",
29 recommended: false
29 recommended: false,
30 url: "https://eslint.org/docs/rules/object-shorthand"
3031 },
3132
3233 fixable: "code",
1212 docs: {
1313 description: "require or disallow newlines around variable declarations",
1414 category: "Stylistic Issues",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/one-var-declaration-per-line"
1617 },
1718
1819 schema: [
1313 docs: {
1414 description: "enforce variables to be declared either together or separately in functions",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/one-var"
1718 },
1819
1920 schema: [
9191 docs: {
9292 description: "require or disallow assignment operator shorthand where possible",
9393 category: "Stylistic Issues",
94 recommended: false
94 recommended: false,
95 url: "https://eslint.org/docs/rules/operator-assignment"
9596 },
9697
9798 schema: [
1919 docs: {
2020 description: "enforce consistent linebreak style for operators",
2121 category: "Stylistic Issues",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/operator-linebreak"
2324 },
2425
2526 schema: [
1313 docs: {
1414 description: "require or disallow padding within blocks",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/padded-blocks"
1718 },
1819
1920 fixable: "whitespace",
393393 docs: {
394394 description: "require or disallow padding lines between statements",
395395 category: "Stylistic Issues",
396 recommended: false
396 recommended: false,
397 url: "https://eslint.org/docs/rules/padding-line-between-statements"
397398 },
398399 fixable: "whitespace",
399400 schema: {
133133 docs: {
134134 description: "require using arrow functions for callbacks",
135135 category: "ECMAScript 6",
136 recommended: false
136 recommended: false,
137 url: "https://eslint.org/docs/rules/prefer-arrow-callback"
137138 },
138139
139140 schema: [
232232 docs: {
233233 description: "require `const` declarations for variables that are never reassigned after declared",
234234 category: "ECMAScript 6",
235 recommended: false
235 recommended: false,
236 url: "https://eslint.org/docs/rules/prefer-const"
236237 },
237238
238239 fixable: "code",
1212 docs: {
1313 description: "require destructuring from arrays and/or objects",
1414 category: "ECMAScript 6",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/prefer-destructuring"
1617 },
1718 schema: [
1819 {
4040 docs: {
4141 description: "disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals",
4242 category: "ECMAScript 6",
43 recommended: false
43 recommended: false,
44 url: "https://eslint.org/docs/rules/prefer-numeric-literals"
4445 },
4546
4647 schema: [],
1414 docs: {
1515 description: "require using Error objects as Promise rejection reasons",
1616 category: "Best Practices",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/prefer-promise-reject-errors"
1819 },
1920 fixable: null,
2021 schema: [
1414 description: "require `Reflect` methods where applicable",
1515 category: "ECMAScript 6",
1616 recommended: false,
17 replacedBy: []
17 replacedBy: [],
18 url: "https://eslint.org/docs/rules/prefer-reflect"
1819 },
1920
2021 deprecated: true,
6464 docs: {
6565 description: "require rest parameters instead of `arguments`",
6666 category: "ECMAScript 6",
67 recommended: false
67 recommended: false,
68 url: "https://eslint.org/docs/rules/prefer-rest-params"
6869 },
6970
7071 schema: []
5151 docs: {
5252 description: "require spread operators instead of `.apply()`",
5353 category: "ECMAScript 6",
54 recommended: false
54 recommended: false,
55 url: "https://eslint.org/docs/rules/prefer-spread"
5556 },
5657
5758 schema: [],
102102 docs: {
103103 description: "require template literals instead of string concatenation",
104104 category: "ECMAScript 6",
105 recommended: false
105 recommended: false,
106 url: "https://eslint.org/docs/rules/prefer-template"
106107 },
107108
108109 schema: [],
1919 docs: {
2020 description: "require quotes around object literal property names",
2121 category: "Stylistic Issues",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/quote-props"
2324 },
2425
2526 schema: {
7878 docs: {
7979 description: "enforce the consistent use of either backticks, double, or single quotes",
8080 category: "Stylistic Issues",
81 recommended: false
81 recommended: false,
82 url: "https://eslint.org/docs/rules/quotes"
8283 },
8384
8485 fixable: "code",
8080 docs: {
8181 description: "enforce the consistent use of the radix argument when using `parseInt()`",
8282 category: "Best Practices",
83 recommended: false
83 recommended: false,
84 url: "https://eslint.org/docs/rules/radix"
8485 },
8586
8687 schema: [
3333 docs: {
3434 description: "disallow async functions which have no `await` expression",
3535 category: "Best Practices",
36 recommended: false
36 recommended: false,
37 url: "https://eslint.org/docs/rules/require-await"
3738 },
3839 schema: []
3940 },
88 docs: {
99 description: "require JSDoc comments",
1010 category: "Stylistic Issues",
11 recommended: false
11 recommended: false,
12 url: "https://eslint.org/docs/rules/require-jsdoc"
1213 },
1314
1415 schema: [
1313 docs: {
1414 description: "require generator functions to contain `yield`",
1515 category: "ECMAScript 6",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/require-yield"
1718 },
1819
1920 schema: []
1313 docs: {
1414 description: "enforce spacing between rest and spread operators and their expressions",
1515 category: "ECMAScript 6",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/rest-spread-spacing"
1718 },
1819 fixable: "whitespace",
1920 schema: [
1515 docs: {
1616 description: "enforce consistent spacing before and after semicolons",
1717 category: "Stylistic Issues",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/semi-spacing"
1920 },
2021
2122 fixable: "whitespace",
6767 docs: {
6868 description: "enforce location of semicolons",
6969 category: "Stylistic Issues",
70 recommended: false
70 recommended: false,
71 url: "https://eslint.org/docs/rules/semi-style"
7172 },
7273 schema: [{ enum: ["last", "first"] }],
7374 fixable: "whitespace"
1919 docs: {
2020 description: "require or disallow semicolons instead of ASI",
2121 category: "Stylistic Issues",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/semi"
2324 },
2425
2526 fixable: "code",
1313 docs: {
1414 description: "enforce sorted import declarations within modules",
1515 category: "ECMAScript 6",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/sort-imports"
1718 },
1819
1920 schema: [
7575 docs: {
7676 description: "require object keys to be sorted",
7777 category: "Stylistic Issues",
78 recommended: false
78 recommended: false,
79 url: "https://eslint.org/docs/rules/sort-keys"
7980 },
8081 schema: [
8182 {
1313 docs: {
1414 description: "require variables within the same declaration block to be sorted",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/sort-vars"
1718 },
1819
1920 schema: [
1515 docs: {
1616 description: "enforce consistent spacing before blocks",
1717 category: "Stylistic Issues",
18 recommended: false
18 recommended: false,
19 url: "https://eslint.org/docs/rules/space-before-blocks"
1920 },
2021
2122 fixable: "whitespace",
1818 docs: {
1919 description: "enforce consistent spacing before `function` definition opening parenthesis",
2020 category: "Stylistic Issues",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/space-before-function-paren"
2223 },
2324
2425 fixable: "whitespace",
1414 docs: {
1515 description: "enforce consistent spacing inside parentheses",
1616 category: "Stylistic Issues",
17 recommended: false
17 recommended: false,
18 url: "https://eslint.org/docs/rules/space-in-parens"
1819 },
1920
2021 fixable: "whitespace",
1212 docs: {
1313 description: "require spacing around infix operators",
1414 category: "Stylistic Issues",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/space-infix-ops"
1617 },
1718
1819 fixable: "whitespace",
1818 docs: {
1919 description: "enforce consistent spacing before or after unary operators",
2020 category: "Stylistic Issues",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/space-unary-ops"
2223 },
2324
2425 fixable: "whitespace",
157157 docs: {
158158 description: "enforce consistent spacing after the `//` or `/*` in a comment",
159159 category: "Stylistic Issues",
160 recommended: false
160 recommended: false,
161 url: "https://eslint.org/docs/rules/spaced-comment"
161162 },
162163
163164 fixable: "whitespace",
8282 docs: {
8383 description: "require or disallow strict mode directives",
8484 category: "Strict Mode",
85 recommended: false
85 recommended: false,
86 url: "https://eslint.org/docs/rules/strict"
8687 },
8788
8889 schema: [
1919 docs: {
2020 description: "enforce spacing around colons of switch statements",
2121 category: "Stylistic Issues",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/switch-colon-spacing"
2324 },
2425 schema: [
2526 {
2020 docs: {
2121 description: "require symbol descriptions",
2222 category: "ECMAScript 6",
23 recommended: false
23 recommended: false,
24 url: "https://eslint.org/docs/rules/symbol-description"
2425 },
2526
2627 schema: []
2626 docs: {
2727 description: "require or disallow spacing around embedded expressions of template strings",
2828 category: "ECMAScript 6",
29 recommended: false
29 recommended: false,
30 url: "https://eslint.org/docs/rules/template-curly-spacing"
3031 },
3132
3233 fixable: "whitespace",
1313 docs: {
1414 description: "require or disallow spacing between template tags and their literals",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/template-tag-spacing"
1718 },
1819
1920 fixable: "whitespace",
1212 docs: {
1313 description: "require or disallow Unicode byte order mark (BOM)",
1414 category: "Stylistic Issues",
15 recommended: false
15 recommended: false,
16 url: "https://eslint.org/docs/rules/unicode-bom"
1617 },
1718
1819 fixable: "whitespace",
1313 docs: {
1414 description: "require calls to `isNaN()` when checking for `NaN`",
1515 category: "Possible Errors",
16 recommended: true
16 recommended: true,
17 url: "https://eslint.org/docs/rules/use-isnan"
1718 },
1819
1920 schema: []
1818 docs: {
1919 description: "enforce valid JSDoc comments",
2020 category: "Possible Errors",
21 recommended: false
21 recommended: false,
22 url: "https://eslint.org/docs/rules/valid-jsdoc"
2223 },
2324
2425 schema: [
1212 docs: {
1313 description: "enforce comparing `typeof` expressions against valid strings",
1414 category: "Possible Errors",
15 recommended: true
15 recommended: true,
16 url: "https://eslint.org/docs/rules/valid-typeof"
1617 },
1718
1819 schema: [
1313 docs: {
1414 description: "require `var` declarations be placed at the top of their containing scope",
1515 category: "Best Practices",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/vars-on-top"
1718 },
1819
1920 schema: []
1919 docs: {
2020 description: "require parentheses around immediate `function` invocations",
2121 category: "Best Practices",
22 recommended: false
22 recommended: false,
23 url: "https://eslint.org/docs/rules/wrap-iife"
2324 },
2425
2526 schema: [
1313 docs: {
1414 description: "require parenthesis around regex literals",
1515 category: "Stylistic Issues",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/wrap-regex"
1718 },
1819
1920 schema: [],
1313 docs: {
1414 description: "require or disallow spacing around the `*` in `yield*` expressions",
1515 category: "ECMAScript 6",
16 recommended: false
16 recommended: false,
17 url: "https://eslint.org/docs/rules/yield-star-spacing"
1718 },
1819
1920 fixable: "whitespace",
154154 docs: {
155155 description: "require or disallow \"Yoda\" conditions",
156156 category: "Best Practices",
157 recommended: false
157 recommended: false,
158 url: "https://eslint.org/docs/rules/yoda"
158159 },
159160
160161 schema: [
0 /**
1 * @fileoverview Tests for internal-consistent-docs-url rule.
2 * @author Patrick McElhaney
3 */
4
5 "use strict";
6
7 //------------------------------------------------------------------------------
8 // Requirements
9 //------------------------------------------------------------------------------
10
11 const rule = require("../../../tools/internal-rules/consistent-docs-url"),
12 RuleTester = require("../../../lib/testers/rule-tester");
13
14 //------------------------------------------------------------------------------
15 // Tests
16 //------------------------------------------------------------------------------
17
18 const ruleTester = new RuleTester();
19
20 ruleTester.run("consistent-docs-url", rule, {
21 valid: [
22
23 // wrong exports format: "internal-no-invalid-meta" reports this already
24 [
25 "module.exports = function(context) {",
26 " return {",
27 " Program: function(node) {}",
28 " };",
29 "};"
30 ].join("\n"),
31 [
32 "module.exports = {",
33 " meta: {",
34 " docs: {",
35 " url: 'https://eslint.org/docs/rules/<input>'",
36 " }",
37 " },",
38 " create: function(context) {",
39 " return {};",
40 " }",
41 "};"
42 ].join("\n")
43 ],
44 invalid: [
45 {
46 code: [
47 "module.exports = {",
48 " meta: {",
49 " docs: {}",
50 " },",
51
52 " create: function(context) {",
53 " return {};",
54 " }",
55 "};"
56 ].join("\n"),
57 errors: [{
58 message: "Rule is missing a meta.docs.url property",
59 line: 3,
60 column: 9
61 }]
62 },
63 {
64 code: [
65 "module.exports = {",
66 " meta: {",
67 " docs: {",
68 " url: 'http://example.com/wrong-url'",
69 " }",
70 " },",
71 " create: function(context) {",
72 " return {};",
73 " }",
74 "};"
75 ].join("\n"),
76 errors: [{
77 message: "Incorrect url. Expected \"https://eslint.org/docs/rules/<input>\" but got \"http://example.com/wrong-url\"",
78 line: 4,
79 column: 18
80 }]
81 }
82 ]
83 });
00 rules:
11 rulesdir/no-invalid-meta: "error"
22 rulesdir/consistent-docs-description: "error"
3 rulesdir/consistent-docs-url: "error"
103103
104104 module.exports = {
105105 meta: {
106 docs: {
106 docs: {// eslint-disable-line rulesdir/consistent-docs-url
107107 description: "enforce correct conventions of `meta.docs.description` property in core rules",
108108 category: "Internal",
109109 recommended: false
0 /**
1 * @fileoverview Internal rule to enforce meta.docs.url conventions.
2 * @author Patrick McElhaney
3 */
4
5 "use strict";
6
7 const path = require("path");
8
9 //------------------------------------------------------------------------------
10 // Helpers
11 //------------------------------------------------------------------------------
12
13 /**
14 * Gets the property of the Object node passed in that has the name specified.
15 *
16 * @param {string} property Name of the property to return.
17 * @param {ASTNode} node The ObjectExpression node.
18 * @returns {ASTNode} The Property node or null if not found.
19 */
20 function getPropertyFromObject(property, node) {
21 const properties = node.properties;
22
23 for (let i = 0; i < properties.length; i++) {
24 if (properties[i].key.name === property) {
25 return properties[i];
26 }
27 }
28
29 return null;
30 }
31
32 /**
33 * Verifies that the meta.docs.url property is present and has the correct value.
34 *
35 * @param {RuleContext} context The ESLint rule context.
36 * @param {ASTNode} exportsNode ObjectExpression node that the rule exports.
37 * @returns {void}
38 */
39 function checkMetaDocsUrl(context, exportsNode) {
40 if (exportsNode.type !== "ObjectExpression") {
41
42 // if the exported node is not the correct format, "internal-no-invalid-meta" will already report this.
43 return;
44 }
45
46 const metaProperty = getPropertyFromObject("meta", exportsNode);
47 const metaDocs = metaProperty && getPropertyFromObject("docs", metaProperty.value);
48 const metaDocsUrl = metaDocs && getPropertyFromObject("url", metaDocs.value);
49
50 if (!metaDocsUrl) {
51 context.report({
52 node: metaDocs,
53 message: "Rule is missing a meta.docs.url property"
54 });
55 return;
56 }
57
58 const ruleId = path.basename(context.getFilename().replace(/.js$/, ""));
59 const expected = `https://eslint.org/docs/rules/${ruleId}`;
60 const url = metaDocsUrl.value.value;
61
62 if (url !== expected) {
63 context.report({
64 node: metaDocsUrl.value,
65 message: `Incorrect url. Expected "${expected}" but got "${url}"`
66 });
67 }
68
69 }
70
71 //------------------------------------------------------------------------------
72 // Rule Definition
73 //------------------------------------------------------------------------------
74
75 module.exports = {
76 meta: {
77 docs: {// eslint-disable-line rulesdir/consistent-docs-url
78 description: "enforce correct conventions of `meta.docs.url` property in core rules",
79 category: "Internal",
80 recommended: false
81 },
82
83 schema: []
84 },
85
86 create(context) {
87 return {
88 AssignmentExpression(node) {
89 if (node.left &&
90 node.right &&
91 node.left.type === "MemberExpression" &&
92 node.left.object.name === "module" &&
93 node.left.property.name === "exports") {
94
95 checkMetaDocsUrl(context, node.right);
96 }
97 }
98 };
99 }
100 };
150150
151151 module.exports = {
152152 meta: {
153 docs: {
153 docs: {// eslint-disable-line rulesdir/consistent-docs-url
154154 description: "enforce correct use of `meta` property in core rules",
155155 category: "Internal",
156156 recommended: false