eslint 9.20.1 → 9.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/conf/rule-type-list.json +82 -18
- package/lib/cli.js +23 -0
- package/lib/config/rule-validator.js +12 -2
- package/lib/config-api.js +12 -0
- package/lib/eslint/eslint.js +7 -1
- package/lib/languages/js/source-code/source-code.js +18 -14
- package/lib/options.js +6 -0
- package/lib/rules/array-bracket-newline.js +20 -2
- package/lib/rules/array-bracket-spacing.js +20 -2
- package/lib/rules/array-element-newline.js +20 -2
- package/lib/rules/arrow-parens.js +20 -2
- package/lib/rules/arrow-spacing.js +20 -2
- package/lib/rules/block-spacing.js +20 -2
- package/lib/rules/brace-style.js +20 -2
- package/lib/rules/callback-return.js +19 -3
- package/lib/rules/comma-dangle.js +20 -2
- package/lib/rules/comma-spacing.js +20 -2
- package/lib/rules/comma-style.js +20 -2
- package/lib/rules/computed-property-spacing.js +20 -2
- package/lib/rules/dot-location.js +20 -2
- package/lib/rules/eol-last.js +20 -2
- package/lib/rules/func-call-spacing.js +20 -2
- package/lib/rules/function-call-argument-newline.js +20 -2
- package/lib/rules/function-paren-newline.js +20 -2
- package/lib/rules/generator-star-spacing.js +20 -2
- package/lib/rules/global-require.js +19 -3
- package/lib/rules/handle-callback-err.js +19 -3
- package/lib/rules/id-blacklist.js +14 -2
- package/lib/rules/implicit-arrow-linebreak.js +20 -2
- package/lib/rules/indent-legacy.js +19 -3
- package/lib/rules/indent.js +20 -2
- package/lib/rules/jsx-quotes.js +20 -2
- package/lib/rules/key-spacing.js +20 -2
- package/lib/rules/keyword-spacing.js +20 -2
- package/lib/rules/line-comment-position.js +20 -2
- package/lib/rules/linebreak-style.js +20 -2
- package/lib/rules/lines-around-comment.js +20 -2
- package/lib/rules/lines-around-directive.js +20 -2
- package/lib/rules/lines-between-class-members.js +20 -2
- package/lib/rules/max-len.js +20 -2
- package/lib/rules/max-statements-per-line.js +20 -2
- package/lib/rules/multiline-comment-style.js +20 -2
- package/lib/rules/multiline-ternary.js +20 -2
- package/lib/rules/new-parens.js +20 -2
- package/lib/rules/newline-after-var.js +20 -3
- package/lib/rules/newline-before-return.js +20 -2
- package/lib/rules/newline-per-chained-call.js +20 -2
- package/lib/rules/no-buffer-constructor.js +19 -3
- package/lib/rules/no-catch-shadow.js +14 -3
- package/lib/rules/no-confusing-arrow.js +20 -2
- package/lib/rules/no-console.js +19 -11
- package/lib/rules/no-extra-parens.js +20 -2
- package/lib/rules/no-extra-semi.js +20 -2
- package/lib/rules/no-floating-decimal.js +20 -2
- package/lib/rules/no-mixed-operators.js +20 -2
- package/lib/rules/no-mixed-requires.js +19 -3
- package/lib/rules/no-mixed-spaces-and-tabs.js +20 -2
- package/lib/rules/no-multi-spaces.js +20 -2
- package/lib/rules/no-multiple-empty-lines.js +20 -2
- package/lib/rules/no-native-reassign.js +14 -3
- package/lib/rules/no-negated-in-lhs.js +14 -3
- package/lib/rules/no-new-object.js +14 -5
- package/lib/rules/no-new-require.js +19 -3
- package/lib/rules/no-new-symbol.js +14 -5
- package/lib/rules/no-path-concat.js +19 -3
- package/lib/rules/no-process-env.js +19 -3
- package/lib/rules/no-process-exit.js +19 -3
- package/lib/rules/no-restricted-modules.js +19 -3
- package/lib/rules/no-return-await.js +7 -3
- package/lib/rules/no-spaced-func.js +20 -3
- package/lib/rules/no-sync.js +19 -3
- package/lib/rules/no-tabs.js +20 -2
- package/lib/rules/no-trailing-spaces.js +20 -2
- package/lib/rules/no-whitespace-before-property.js +20 -2
- package/lib/rules/nonblock-statement-body-position.js +20 -2
- package/lib/rules/object-curly-newline.js +20 -2
- package/lib/rules/object-curly-spacing.js +20 -2
- package/lib/rules/object-property-newline.js +20 -2
- package/lib/rules/one-var-declaration-per-line.js +20 -2
- package/lib/rules/operator-linebreak.js +20 -2
- package/lib/rules/padded-blocks.js +20 -2
- package/lib/rules/padding-line-between-statements.js +20 -2
- package/lib/rules/prefer-reflect.js +7 -3
- package/lib/rules/quote-props.js +20 -2
- package/lib/rules/quotes.js +20 -2
- package/lib/rules/rest-spread-spacing.js +20 -2
- package/lib/rules/semi-spacing.js +20 -2
- package/lib/rules/semi-style.js +20 -2
- package/lib/rules/semi.js +20 -2
- package/lib/rules/space-before-blocks.js +20 -2
- package/lib/rules/space-before-function-paren.js +20 -2
- package/lib/rules/space-in-parens.js +20 -2
- package/lib/rules/space-infix-ops.js +20 -2
- package/lib/rules/space-unary-ops.js +20 -2
- package/lib/rules/spaced-comment.js +20 -2
- package/lib/rules/switch-colon-spacing.js +20 -2
- package/lib/rules/template-curly-spacing.js +20 -2
- package/lib/rules/template-tag-spacing.js +20 -2
- package/lib/rules/wrap-iife.js +20 -2
- package/lib/rules/wrap-regex.js +20 -2
- package/lib/rules/yield-star-spacing.js +20 -2
- package/lib/shared/types.js +19 -1
- package/lib/types/config-api.d.ts +8 -0
- package/lib/types/index.d.ts +8 -4
- package/lib/types/rules.d.ts +5199 -0
- package/messages/config-plugin-missing.js +14 -0
- package/package.json +19 -11
- package/lib/types/rules/best-practices.d.ts +0 -1143
- package/lib/types/rules/deprecated.d.ts +0 -252
- package/lib/types/rules/ecmascript-6.d.ts +0 -647
- package/lib/types/rules/index.d.ts +0 -50
- package/lib/types/rules/node-commonjs.d.ts +0 -171
- package/lib/types/rules/possible-errors.d.ts +0 -685
- package/lib/types/rules/strict-mode.d.ts +0 -38
- package/lib/types/rules/stylistic-issues.d.ts +0 -2043
- package/lib/types/rules/variables.d.ts +0 -234
package/lib/rules/quotes.js
CHANGED
@@ -78,8 +78,26 @@ const AVOID_ESCAPE = "avoid-escape";
|
|
78
78
|
/** @type {import('../shared/types').Rule} */
|
79
79
|
module.exports = {
|
80
80
|
meta: {
|
81
|
-
deprecated:
|
82
|
-
|
81
|
+
deprecated: {
|
82
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
83
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
84
|
+
deprecatedSince: "8.53.0",
|
85
|
+
availableUntil: "10.0.0",
|
86
|
+
replacedBy: [
|
87
|
+
{
|
88
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
89
|
+
url: "https://eslint.style/guide/migration",
|
90
|
+
plugin: {
|
91
|
+
name: "@stylistic/eslint-plugin-js",
|
92
|
+
url: "https://eslint.style/packages/js"
|
93
|
+
},
|
94
|
+
rule: {
|
95
|
+
name: "quotes",
|
96
|
+
url: "https://eslint.style/rules/js/quotes"
|
97
|
+
}
|
98
|
+
}
|
99
|
+
]
|
100
|
+
},
|
83
101
|
type: "layout",
|
84
102
|
|
85
103
|
docs: {
|
@@ -13,8 +13,26 @@
|
|
13
13
|
/** @type {import('../shared/types').Rule} */
|
14
14
|
module.exports = {
|
15
15
|
meta: {
|
16
|
-
deprecated:
|
17
|
-
|
16
|
+
deprecated: {
|
17
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
18
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
19
|
+
deprecatedSince: "8.53.0",
|
20
|
+
availableUntil: "10.0.0",
|
21
|
+
replacedBy: [
|
22
|
+
{
|
23
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
24
|
+
url: "https://eslint.style/guide/migration",
|
25
|
+
plugin: {
|
26
|
+
name: "@stylistic/eslint-plugin-js",
|
27
|
+
url: "https://eslint.style/packages/js"
|
28
|
+
},
|
29
|
+
rule: {
|
30
|
+
name: "rest-spread-spacing",
|
31
|
+
url: "https://eslint.style/rules/js/rest-spread-spacing"
|
32
|
+
}
|
33
|
+
}
|
34
|
+
]
|
35
|
+
},
|
18
36
|
type: "layout",
|
19
37
|
|
20
38
|
docs: {
|
@@ -15,8 +15,26 @@ const astUtils = require("./utils/ast-utils");
|
|
15
15
|
/** @type {import('../shared/types').Rule} */
|
16
16
|
module.exports = {
|
17
17
|
meta: {
|
18
|
-
deprecated:
|
19
|
-
|
18
|
+
deprecated: {
|
19
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
20
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
21
|
+
deprecatedSince: "8.53.0",
|
22
|
+
availableUntil: "10.0.0",
|
23
|
+
replacedBy: [
|
24
|
+
{
|
25
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
26
|
+
url: "https://eslint.style/guide/migration",
|
27
|
+
plugin: {
|
28
|
+
name: "@stylistic/eslint-plugin-js",
|
29
|
+
url: "https://eslint.style/packages/js"
|
30
|
+
},
|
31
|
+
rule: {
|
32
|
+
name: "semi-spacing",
|
33
|
+
url: "https://eslint.style/rules/js/semi-spacing"
|
34
|
+
}
|
35
|
+
}
|
36
|
+
]
|
37
|
+
},
|
20
38
|
type: "layout",
|
21
39
|
|
22
40
|
docs: {
|
package/lib/rules/semi-style.js
CHANGED
@@ -71,8 +71,26 @@ function isLastChild(node) {
|
|
71
71
|
/** @type {import('../shared/types').Rule} */
|
72
72
|
module.exports = {
|
73
73
|
meta: {
|
74
|
-
deprecated:
|
75
|
-
|
74
|
+
deprecated: {
|
75
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
76
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
77
|
+
deprecatedSince: "8.53.0",
|
78
|
+
availableUntil: "10.0.0",
|
79
|
+
replacedBy: [
|
80
|
+
{
|
81
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
82
|
+
url: "https://eslint.style/guide/migration",
|
83
|
+
plugin: {
|
84
|
+
name: "@stylistic/eslint-plugin-js",
|
85
|
+
url: "https://eslint.style/packages/js"
|
86
|
+
},
|
87
|
+
rule: {
|
88
|
+
name: "semi-style",
|
89
|
+
url: "https://eslint.style/rules/js/semi-style"
|
90
|
+
}
|
91
|
+
}
|
92
|
+
]
|
93
|
+
},
|
76
94
|
type: "layout",
|
77
95
|
|
78
96
|
docs: {
|
package/lib/rules/semi.js
CHANGED
@@ -19,8 +19,26 @@ const astUtils = require("./utils/ast-utils");
|
|
19
19
|
/** @type {import('../shared/types').Rule} */
|
20
20
|
module.exports = {
|
21
21
|
meta: {
|
22
|
-
deprecated:
|
23
|
-
|
22
|
+
deprecated: {
|
23
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
24
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
25
|
+
deprecatedSince: "8.53.0",
|
26
|
+
availableUntil: "10.0.0",
|
27
|
+
replacedBy: [
|
28
|
+
{
|
29
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
30
|
+
url: "https://eslint.style/guide/migration",
|
31
|
+
plugin: {
|
32
|
+
name: "@stylistic/eslint-plugin-js",
|
33
|
+
url: "https://eslint.style/packages/js"
|
34
|
+
},
|
35
|
+
rule: {
|
36
|
+
name: "semi",
|
37
|
+
url: "https://eslint.style/rules/js/semi"
|
38
|
+
}
|
39
|
+
}
|
40
|
+
]
|
41
|
+
},
|
24
42
|
type: "layout",
|
25
43
|
|
26
44
|
docs: {
|
@@ -38,8 +38,26 @@ function isFunctionBody(node) {
|
|
38
38
|
/** @type {import('../shared/types').Rule} */
|
39
39
|
module.exports = {
|
40
40
|
meta: {
|
41
|
-
deprecated:
|
42
|
-
|
41
|
+
deprecated: {
|
42
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
43
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
44
|
+
deprecatedSince: "8.53.0",
|
45
|
+
availableUntil: "10.0.0",
|
46
|
+
replacedBy: [
|
47
|
+
{
|
48
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
49
|
+
url: "https://eslint.style/guide/migration",
|
50
|
+
plugin: {
|
51
|
+
name: "@stylistic/eslint-plugin-js",
|
52
|
+
url: "https://eslint.style/packages/js"
|
53
|
+
},
|
54
|
+
rule: {
|
55
|
+
name: "space-before-blocks",
|
56
|
+
url: "https://eslint.style/rules/js/space-before-blocks"
|
57
|
+
}
|
58
|
+
}
|
59
|
+
]
|
60
|
+
},
|
43
61
|
type: "layout",
|
44
62
|
|
45
63
|
docs: {
|
@@ -18,8 +18,26 @@ const astUtils = require("./utils/ast-utils");
|
|
18
18
|
/** @type {import('../shared/types').Rule} */
|
19
19
|
module.exports = {
|
20
20
|
meta: {
|
21
|
-
deprecated:
|
22
|
-
|
21
|
+
deprecated: {
|
22
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
23
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
24
|
+
deprecatedSince: "8.53.0",
|
25
|
+
availableUntil: "10.0.0",
|
26
|
+
replacedBy: [
|
27
|
+
{
|
28
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
29
|
+
url: "https://eslint.style/guide/migration",
|
30
|
+
plugin: {
|
31
|
+
name: "@stylistic/eslint-plugin-js",
|
32
|
+
url: "https://eslint.style/packages/js"
|
33
|
+
},
|
34
|
+
rule: {
|
35
|
+
name: "space-before-function-paren",
|
36
|
+
url: "https://eslint.style/rules/js/space-before-function-paren"
|
37
|
+
}
|
38
|
+
}
|
39
|
+
]
|
40
|
+
},
|
23
41
|
type: "layout",
|
24
42
|
|
25
43
|
docs: {
|
@@ -14,8 +14,26 @@ const astUtils = require("./utils/ast-utils");
|
|
14
14
|
/** @type {import('../shared/types').Rule} */
|
15
15
|
module.exports = {
|
16
16
|
meta: {
|
17
|
-
deprecated:
|
18
|
-
|
17
|
+
deprecated: {
|
18
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
19
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
20
|
+
deprecatedSince: "8.53.0",
|
21
|
+
availableUntil: "10.0.0",
|
22
|
+
replacedBy: [
|
23
|
+
{
|
24
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
25
|
+
url: "https://eslint.style/guide/migration",
|
26
|
+
plugin: {
|
27
|
+
name: "@stylistic/eslint-plugin-js",
|
28
|
+
url: "https://eslint.style/packages/js"
|
29
|
+
},
|
30
|
+
rule: {
|
31
|
+
name: "space-in-parens",
|
32
|
+
url: "https://eslint.style/rules/js/space-in-parens"
|
33
|
+
}
|
34
|
+
}
|
35
|
+
]
|
36
|
+
},
|
19
37
|
type: "layout",
|
20
38
|
|
21
39
|
docs: {
|
@@ -14,8 +14,26 @@ const { isEqToken } = require("./utils/ast-utils");
|
|
14
14
|
/** @type {import('../shared/types').Rule} */
|
15
15
|
module.exports = {
|
16
16
|
meta: {
|
17
|
-
deprecated:
|
18
|
-
|
17
|
+
deprecated: {
|
18
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
19
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
20
|
+
deprecatedSince: "8.53.0",
|
21
|
+
availableUntil: "10.0.0",
|
22
|
+
replacedBy: [
|
23
|
+
{
|
24
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
25
|
+
url: "https://eslint.style/guide/migration",
|
26
|
+
plugin: {
|
27
|
+
name: "@stylistic/eslint-plugin-js",
|
28
|
+
url: "https://eslint.style/packages/js"
|
29
|
+
},
|
30
|
+
rule: {
|
31
|
+
name: "space-infix-ops",
|
32
|
+
url: "https://eslint.style/rules/js/space-infix-ops"
|
33
|
+
}
|
34
|
+
}
|
35
|
+
]
|
36
|
+
},
|
19
37
|
type: "layout",
|
20
38
|
|
21
39
|
docs: {
|
@@ -18,8 +18,26 @@ const astUtils = require("./utils/ast-utils");
|
|
18
18
|
/** @type {import('../shared/types').Rule} */
|
19
19
|
module.exports = {
|
20
20
|
meta: {
|
21
|
-
deprecated:
|
22
|
-
|
21
|
+
deprecated: {
|
22
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
23
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
24
|
+
deprecatedSince: "8.53.0",
|
25
|
+
availableUntil: "10.0.0",
|
26
|
+
replacedBy: [
|
27
|
+
{
|
28
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
29
|
+
url: "https://eslint.style/guide/migration",
|
30
|
+
plugin: {
|
31
|
+
name: "@stylistic/eslint-plugin-js",
|
32
|
+
url: "https://eslint.style/packages/js"
|
33
|
+
},
|
34
|
+
rule: {
|
35
|
+
name: "space-unary-ops",
|
36
|
+
url: "https://eslint.style/rules/js/space-unary-ops"
|
37
|
+
}
|
38
|
+
}
|
39
|
+
]
|
40
|
+
},
|
23
41
|
type: "layout",
|
24
42
|
|
25
43
|
docs: {
|
@@ -150,8 +150,26 @@ function createNeverStylePattern(markers) {
|
|
150
150
|
/** @type {import('../shared/types').Rule} */
|
151
151
|
module.exports = {
|
152
152
|
meta: {
|
153
|
-
deprecated:
|
154
|
-
|
153
|
+
deprecated: {
|
154
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
155
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
156
|
+
deprecatedSince: "8.53.0",
|
157
|
+
availableUntil: "10.0.0",
|
158
|
+
replacedBy: [
|
159
|
+
{
|
160
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
161
|
+
url: "https://eslint.style/guide/migration",
|
162
|
+
plugin: {
|
163
|
+
name: "@stylistic/eslint-plugin-js",
|
164
|
+
url: "https://eslint.style/packages/js"
|
165
|
+
},
|
166
|
+
rule: {
|
167
|
+
name: "spaced-comment",
|
168
|
+
url: "https://eslint.style/rules/js/spaced-comment"
|
169
|
+
}
|
170
|
+
}
|
171
|
+
]
|
172
|
+
},
|
155
173
|
type: "suggestion",
|
156
174
|
|
157
175
|
docs: {
|
@@ -19,8 +19,26 @@ const astUtils = require("./utils/ast-utils");
|
|
19
19
|
/** @type {import('../shared/types').Rule} */
|
20
20
|
module.exports = {
|
21
21
|
meta: {
|
22
|
-
deprecated:
|
23
|
-
|
22
|
+
deprecated: {
|
23
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
24
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
25
|
+
deprecatedSince: "8.53.0",
|
26
|
+
availableUntil: "10.0.0",
|
27
|
+
replacedBy: [
|
28
|
+
{
|
29
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
30
|
+
url: "https://eslint.style/guide/migration",
|
31
|
+
plugin: {
|
32
|
+
name: "@stylistic/eslint-plugin-js",
|
33
|
+
url: "https://eslint.style/packages/js"
|
34
|
+
},
|
35
|
+
rule: {
|
36
|
+
name: "switch-colon-spacing",
|
37
|
+
url: "https://eslint.style/rules/js/switch-colon-spacing"
|
38
|
+
}
|
39
|
+
}
|
40
|
+
]
|
41
|
+
},
|
24
42
|
type: "layout",
|
25
43
|
|
26
44
|
docs: {
|
@@ -19,8 +19,26 @@ const astUtils = require("./utils/ast-utils");
|
|
19
19
|
/** @type {import('../shared/types').Rule} */
|
20
20
|
module.exports = {
|
21
21
|
meta: {
|
22
|
-
deprecated:
|
23
|
-
|
22
|
+
deprecated: {
|
23
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
24
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
25
|
+
deprecatedSince: "8.53.0",
|
26
|
+
availableUntil: "10.0.0",
|
27
|
+
replacedBy: [
|
28
|
+
{
|
29
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
30
|
+
url: "https://eslint.style/guide/migration",
|
31
|
+
plugin: {
|
32
|
+
name: "@stylistic/eslint-plugin-js",
|
33
|
+
url: "https://eslint.style/packages/js"
|
34
|
+
},
|
35
|
+
rule: {
|
36
|
+
name: "template-curly-spacing",
|
37
|
+
url: "https://eslint.style/rules/js/template-curly-spacing"
|
38
|
+
}
|
39
|
+
}
|
40
|
+
]
|
41
|
+
},
|
24
42
|
type: "layout",
|
25
43
|
|
26
44
|
docs: {
|
@@ -13,8 +13,26 @@
|
|
13
13
|
/** @type {import('../shared/types').Rule} */
|
14
14
|
module.exports = {
|
15
15
|
meta: {
|
16
|
-
deprecated:
|
17
|
-
|
16
|
+
deprecated: {
|
17
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
18
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
19
|
+
deprecatedSince: "8.53.0",
|
20
|
+
availableUntil: "10.0.0",
|
21
|
+
replacedBy: [
|
22
|
+
{
|
23
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
24
|
+
url: "https://eslint.style/guide/migration",
|
25
|
+
plugin: {
|
26
|
+
name: "@stylistic/eslint-plugin-js",
|
27
|
+
url: "https://eslint.style/packages/js"
|
28
|
+
},
|
29
|
+
rule: {
|
30
|
+
name: "template-tag-spacing",
|
31
|
+
url: "https://eslint.style/rules/js/template-tag-spacing"
|
32
|
+
}
|
33
|
+
}
|
34
|
+
]
|
35
|
+
},
|
18
36
|
type: "layout",
|
19
37
|
|
20
38
|
docs: {
|
package/lib/rules/wrap-iife.js
CHANGED
@@ -41,8 +41,26 @@ function isCalleeOfNewExpression(node) {
|
|
41
41
|
/** @type {import('../shared/types').Rule} */
|
42
42
|
module.exports = {
|
43
43
|
meta: {
|
44
|
-
deprecated:
|
45
|
-
|
44
|
+
deprecated: {
|
45
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
46
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
47
|
+
deprecatedSince: "8.53.0",
|
48
|
+
availableUntil: "10.0.0",
|
49
|
+
replacedBy: [
|
50
|
+
{
|
51
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
52
|
+
url: "https://eslint.style/guide/migration",
|
53
|
+
plugin: {
|
54
|
+
name: "@stylistic/eslint-plugin-js",
|
55
|
+
url: "https://eslint.style/packages/js"
|
56
|
+
},
|
57
|
+
rule: {
|
58
|
+
name: "wrap-iife",
|
59
|
+
url: "https://eslint.style/rules/js/wrap-iife"
|
60
|
+
}
|
61
|
+
}
|
62
|
+
]
|
63
|
+
},
|
46
64
|
type: "layout",
|
47
65
|
|
48
66
|
docs: {
|
package/lib/rules/wrap-regex.js
CHANGED
@@ -13,8 +13,26 @@
|
|
13
13
|
/** @type {import('../shared/types').Rule} */
|
14
14
|
module.exports = {
|
15
15
|
meta: {
|
16
|
-
deprecated:
|
17
|
-
|
16
|
+
deprecated: {
|
17
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
18
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
19
|
+
deprecatedSince: "8.53.0",
|
20
|
+
availableUntil: "10.0.0",
|
21
|
+
replacedBy: [
|
22
|
+
{
|
23
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
24
|
+
url: "https://eslint.style/guide/migration",
|
25
|
+
plugin: {
|
26
|
+
name: "@stylistic/eslint-plugin-js",
|
27
|
+
url: "https://eslint.style/packages/js"
|
28
|
+
},
|
29
|
+
rule: {
|
30
|
+
name: "wrap-regex",
|
31
|
+
url: "https://eslint.style/rules/js/wrap-regex"
|
32
|
+
}
|
33
|
+
}
|
34
|
+
]
|
35
|
+
},
|
18
36
|
type: "layout",
|
19
37
|
|
20
38
|
docs: {
|
@@ -13,8 +13,26 @@
|
|
13
13
|
/** @type {import('../shared/types').Rule} */
|
14
14
|
module.exports = {
|
15
15
|
meta: {
|
16
|
-
deprecated:
|
17
|
-
|
16
|
+
deprecated: {
|
17
|
+
message: "Formatting rules are being moved out of ESLint core.",
|
18
|
+
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
|
19
|
+
deprecatedSince: "8.53.0",
|
20
|
+
availableUntil: "10.0.0",
|
21
|
+
replacedBy: [
|
22
|
+
{
|
23
|
+
message: "ESLint Stylistic now maintains deprecated stylistic core rules.",
|
24
|
+
url: "https://eslint.style/guide/migration",
|
25
|
+
plugin: {
|
26
|
+
name: "@stylistic/eslint-plugin-js",
|
27
|
+
url: "https://eslint.style/packages/js"
|
28
|
+
},
|
29
|
+
rule: {
|
30
|
+
name: "yield-star-spacing",
|
31
|
+
url: "https://eslint.style/rules/js/yield-star-spacing"
|
32
|
+
}
|
33
|
+
}
|
34
|
+
]
|
35
|
+
},
|
18
36
|
type: "layout",
|
19
37
|
|
20
38
|
docs: {
|
package/lib/shared/types.js
CHANGED
@@ -145,9 +145,26 @@ module.exports = {};
|
|
145
145
|
* @property {string} url The URL of the rule documentation.
|
146
146
|
*/
|
147
147
|
|
148
|
+
/**
|
149
|
+
* @typedef {Object} DeprecatedInfo
|
150
|
+
* @property {string} [message] General message presented to the user
|
151
|
+
* @property {string} [url] URL to more information about this deprecation in general
|
152
|
+
* @property {ReplacedByInfo[]} [replacedBy] Potential replacements for the rule
|
153
|
+
* @property {string} [deprecatedSince] Version since the rule is deprecated
|
154
|
+
* @property {?string} [availableUntil] Version until it is available or null if indefinite
|
155
|
+
*/
|
156
|
+
|
157
|
+
/**
|
158
|
+
* @typedef {Object} ReplacedByInfo
|
159
|
+
* @property {string} [message] General message presented to the user
|
160
|
+
* @property {string} [url] URL to more information about this replacement in general
|
161
|
+
* @property {{ name?: string, url?: string }} [plugin] Use "eslint" for a core rule. Omit if the rule is in the same plugin.
|
162
|
+
* @property {{ name?: string, url?: string }} [rule] Name and information of the replacement rule
|
163
|
+
*/
|
164
|
+
|
148
165
|
/**
|
149
166
|
* @typedef {Object} RuleMeta
|
150
|
-
* @property {boolean} [deprecated] If `true` then the rule has been deprecated.
|
167
|
+
* @property {boolean|DeprecatedInfo} [deprecated] If `true` then the rule has been deprecated.
|
151
168
|
* @property {Array} [defaultOptions] Default options for the rule.
|
152
169
|
* @property {RuleMetaDocs} docs The document information of the rule.
|
153
170
|
* @property {"code"|"whitespace"} [fixable] The autofix type.
|
@@ -177,6 +194,7 @@ module.exports = {};
|
|
177
194
|
* @typedef {Object} DeprecatedRuleInfo
|
178
195
|
* @property {string} ruleId The rule ID.
|
179
196
|
* @property {string[]} replacedBy The rule IDs that replace this deprecated rule.
|
197
|
+
* @property {DeprecatedInfo} [info] The raw deprecated info provided by rule. Unset if `deprecated` is a boolean.
|
180
198
|
*/
|
181
199
|
|
182
200
|
/**
|
package/lib/types/index.d.ts
CHANGED
@@ -35,7 +35,8 @@ import type {
|
|
35
35
|
LanguageOptions as GenericLanguageOptions,
|
36
36
|
RuleDefinition,
|
37
37
|
RuleContext as CoreRuleContext,
|
38
|
-
RuleContextTypeOptions
|
38
|
+
RuleContextTypeOptions,
|
39
|
+
DeprecatedInfo
|
39
40
|
} from "@eslint/core";
|
40
41
|
import { JSONSchema4 } from "json-schema";
|
41
42
|
import { LegacyESLint } from "./use-at-your-own-risk.js";
|
@@ -780,9 +781,12 @@ export namespace Rule {
|
|
780
781
|
/** Any default options to be recursively merged on top of any user-provided options. */
|
781
782
|
defaultOptions?: unknown[];
|
782
783
|
|
783
|
-
/** Indicates whether the rule has been deprecated. Omit if not deprecated. */
|
784
|
-
deprecated?: boolean | undefined;
|
785
|
-
/**
|
784
|
+
/** Indicates whether the rule has been deprecated or provides additional metadata about the deprecation. Omit if not deprecated. */
|
785
|
+
deprecated?: boolean | DeprecatedInfo | undefined;
|
786
|
+
/**
|
787
|
+
* @deprecated Use deprecated.replacedBy instead.
|
788
|
+
* The name of the rule(s) this rule was replaced by, if it was deprecated.
|
789
|
+
*/
|
786
790
|
replacedBy?: readonly string[];
|
787
791
|
|
788
792
|
/**
|