@zendeskgarden/eslint-config 43.0.0 → 44.0.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/package.json +16 -18
- package/plugins/react.js +3 -3
- package/plugins/typescript-type-checked.js +6 -7
- package/plugins/typescript.js +11 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "44.0.0",
|
|
4
4
|
"description": "Garden ESLint config",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -20,37 +20,35 @@
|
|
|
20
20
|
"lint": "eslint eslint.config.js index.js plugins/*.js rules/*.js --max-warnings 0",
|
|
21
21
|
"prepare": "husky",
|
|
22
22
|
"start": "npm exec @eslint/config-inspector",
|
|
23
|
-
"tag": "[ `git rev-parse --abbrev-ref HEAD` = 'main' ] &&
|
|
23
|
+
"tag": "[ `git rev-parse --abbrev-ref HEAD` = 'main' ] && commit-and-tag-version --no-verify --npmPublishHint 'true'",
|
|
24
24
|
"test": "npm run format && npm run lint && git diff --quiet"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@babel/eslint-parser": "7.
|
|
28
|
-
"
|
|
29
|
-
"eslint-plugin-
|
|
30
|
-
"eslint-plugin-
|
|
31
|
-
"eslint-plugin-jsx-a11y": "6.9.0",
|
|
32
|
-
"eslint-plugin-n": "17.9.0",
|
|
27
|
+
"@babel/eslint-parser": "7.25.1",
|
|
28
|
+
"eslint-plugin-jest": "28.8.3",
|
|
29
|
+
"eslint-plugin-jsx-a11y": "6.10.0",
|
|
30
|
+
"eslint-plugin-n": "17.10.2",
|
|
33
31
|
"eslint-plugin-notice": "1.0.0",
|
|
34
|
-
"eslint-plugin-react": "7.
|
|
32
|
+
"eslint-plugin-react": "7.36.0",
|
|
35
33
|
"eslint-plugin-react-hooks": "4.6.2",
|
|
36
|
-
"globals": "15.
|
|
37
|
-
"typescript-eslint": "
|
|
34
|
+
"globals": "15.9.0",
|
|
35
|
+
"typescript-eslint": "8.5.0"
|
|
38
36
|
},
|
|
39
37
|
"peerDependencies": {
|
|
40
38
|
"eslint": "^9.0.0"
|
|
41
39
|
},
|
|
42
40
|
"devDependencies": {
|
|
43
|
-
"@babel/core": "7.
|
|
44
|
-
"@eslint/config-inspector": "0.5.
|
|
45
|
-
"@zendeskgarden/scripts": "2.
|
|
41
|
+
"@babel/core": "7.25.2",
|
|
42
|
+
"@eslint/config-inspector": "0.5.4",
|
|
43
|
+
"@zendeskgarden/scripts": "2.4.2",
|
|
44
|
+
"commit-and-tag-version": "12.4.3",
|
|
46
45
|
"envalid": "8.0.0",
|
|
47
|
-
"eslint": "9.
|
|
48
|
-
"husky": "9.
|
|
46
|
+
"eslint": "9.10.0",
|
|
47
|
+
"husky": "9.1.6",
|
|
49
48
|
"jest": "29.7.0",
|
|
50
49
|
"prettier-package-json": "2.8.0",
|
|
51
50
|
"react": "18.3.1",
|
|
52
|
-
"
|
|
53
|
-
"typescript": "5.4.5"
|
|
51
|
+
"typescript": "5.6.2"
|
|
54
52
|
},
|
|
55
53
|
"keywords": [
|
|
56
54
|
"eslint",
|
package/plugins/react.js
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { fixupPluginRules } from '@eslint/compat';
|
|
9
8
|
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
|
|
10
9
|
import reactHooksPlugin from 'eslint-plugin-react-hooks';
|
|
11
10
|
import reactPlugin from 'eslint-plugin-react';
|
|
@@ -13,8 +12,7 @@ import reactPlugin from 'eslint-plugin-react';
|
|
|
13
12
|
export default {
|
|
14
13
|
plugins: {
|
|
15
14
|
react: reactPlugin,
|
|
16
|
-
|
|
17
|
-
'react-hooks': fixupPluginRules(reactHooksPlugin),
|
|
15
|
+
'react-hooks': reactHooksPlugin,
|
|
18
16
|
'jsx-a11y': jsxA11yPlugin
|
|
19
17
|
},
|
|
20
18
|
languageOptions: {
|
|
@@ -58,6 +56,8 @@ export default {
|
|
|
58
56
|
'react/forbid-foreign-prop-types': 0,
|
|
59
57
|
// forbid certain propTypes
|
|
60
58
|
'react/forbid-prop-types': 0,
|
|
59
|
+
// require all forwardRef components include a ref parameter
|
|
60
|
+
'react/forward-ref-uses-ref': 2,
|
|
61
61
|
// standardize the way function components get defined
|
|
62
62
|
'react/function-component-definition': [
|
|
63
63
|
1,
|
|
@@ -5,11 +5,9 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import deprecationPlugin from 'eslint-plugin-deprecation';
|
|
9
8
|
import eslintLayoutFormatting from '../rules/layout-formatting.js';
|
|
10
9
|
import eslintPossibleProblems from '../rules/possible-problems.js';
|
|
11
10
|
import eslintSuggestions from '../rules/suggestions.js';
|
|
12
|
-
import { fixupPluginRules } from '@eslint/compat';
|
|
13
11
|
import tseslint from 'typescript-eslint';
|
|
14
12
|
|
|
15
13
|
const eslintRules = {
|
|
@@ -20,8 +18,7 @@ const eslintRules = {
|
|
|
20
18
|
|
|
21
19
|
export default {
|
|
22
20
|
plugins: {
|
|
23
|
-
'@typescript-eslint': tseslint.plugin
|
|
24
|
-
deprecation: fixupPluginRules(deprecationPlugin)
|
|
21
|
+
'@typescript-eslint': tseslint.plugin
|
|
25
22
|
},
|
|
26
23
|
languageOptions: {
|
|
27
24
|
parser: tseslint.parser,
|
|
@@ -71,6 +68,8 @@ export default {
|
|
|
71
68
|
'@typescript-eslint/no-base-to-string': 2,
|
|
72
69
|
// requires expressions of type void to appear in statement position
|
|
73
70
|
'@typescript-eslint/no-confusing-void-expression': 2,
|
|
71
|
+
// disallow using code marked as `@deprecated`
|
|
72
|
+
'@typescript-eslint/no-deprecated': 1,
|
|
74
73
|
// disallows duplicate union or intersection type members
|
|
75
74
|
'@typescript-eslint/no-duplicate-type-constituents': 2,
|
|
76
75
|
// requires Promise-like values to be handled appropriately
|
|
@@ -100,6 +99,8 @@ export default {
|
|
|
100
99
|
'@typescript-eslint/no-unnecessary-type-arguments': 2,
|
|
101
100
|
// warns if a type assertion does not change the type of an expression
|
|
102
101
|
'@typescript-eslint/no-unnecessary-type-assertion': 2,
|
|
102
|
+
// disallow type parameters that aren't used multiple times
|
|
103
|
+
'@typescript-eslint/no-unnecessary-type-parameters': 1,
|
|
103
104
|
// disallows calling an function with an any type value
|
|
104
105
|
'@typescript-eslint/no-unsafe-argument': 2,
|
|
105
106
|
// disallows assigning any to variables and properties
|
|
@@ -163,8 +164,6 @@ export default {
|
|
|
163
164
|
// enforces unbound methods are called with their expected scope
|
|
164
165
|
'@typescript-eslint/unbound-method': 2,
|
|
165
166
|
// requires type annotation of catch() parameter remain unknown
|
|
166
|
-
'@typescript-eslint/use-unknown-in-catch-callback-variable': 2
|
|
167
|
-
// disallow usage of deprecated APIs
|
|
168
|
-
'deprecation/deprecation': 'warn'
|
|
167
|
+
'@typescript-eslint/use-unknown-in-catch-callback-variable': 2
|
|
169
168
|
}
|
|
170
169
|
};
|
package/plugins/typescript.js
CHANGED
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
languageOptions: {
|
|
24
24
|
parser: tseslint.parser,
|
|
25
25
|
parserOptions: {
|
|
26
|
-
|
|
26
|
+
projectService: true
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
rules: {
|
|
@@ -44,7 +44,6 @@ export default {
|
|
|
44
44
|
'no-import-assign': 0,
|
|
45
45
|
'no-invalid-this': 0,
|
|
46
46
|
'no-loop-func': 0,
|
|
47
|
-
'no-loss-of-precision': 0,
|
|
48
47
|
'no-magic-numbers': 0,
|
|
49
48
|
'no-obj-calls': 0,
|
|
50
49
|
'no-redeclare': 0,
|
|
@@ -69,8 +68,6 @@ export default {
|
|
|
69
68
|
'@typescript-eslint/ban-ts-comment': 2,
|
|
70
69
|
// bans `// tslint:<rule-flag>` comments from being used
|
|
71
70
|
'@typescript-eslint/ban-tslint-comment': 1,
|
|
72
|
-
// bans specific types from being used
|
|
73
|
-
'@typescript-eslint/ban-types': 2,
|
|
74
71
|
// ensures that literals on classes are exposed in a consistent style
|
|
75
72
|
'@typescript-eslint/class-literal-property-style': 2,
|
|
76
73
|
// enforce that class methods utilize `this`
|
|
@@ -119,8 +116,8 @@ export default {
|
|
|
119
116
|
'@typescript-eslint/no-dynamic-delete': 2,
|
|
120
117
|
// disallow empty functions
|
|
121
118
|
'@typescript-eslint/no-empty-function': eslintRules['no-empty-function'],
|
|
122
|
-
// disallow
|
|
123
|
-
'@typescript-eslint/no-empty-
|
|
119
|
+
// disallow accidentally using the "empty object" type
|
|
120
|
+
'@typescript-eslint/no-empty-object-type': 2,
|
|
124
121
|
// disallow usage of the `any` type
|
|
125
122
|
'@typescript-eslint/no-explicit-any': 2,
|
|
126
123
|
// disallow extra non-null assertion
|
|
@@ -137,9 +134,6 @@ export default {
|
|
|
137
134
|
'@typescript-eslint/no-invalid-void-type': 2,
|
|
138
135
|
// disallow function declarations that contain unsafe references inside loop statements
|
|
139
136
|
'@typescript-eslint/no-loop-func': eslintRules['no-loop-func'],
|
|
140
|
-
// disallow literal numbers that lose precision
|
|
141
|
-
'@typescript-eslint/no-loss-of-precision':
|
|
142
|
-
eslintRules['no-loss-of-precision'],
|
|
143
137
|
// disallow magic numbers
|
|
144
138
|
'@typescript-eslint/no-magic-numbers': eslintRules['no-magic-numbers'],
|
|
145
139
|
// enforce valid definition of `new` and `constructor`
|
|
@@ -159,14 +153,20 @@ export default {
|
|
|
159
153
|
// restrict usage of specified node imports
|
|
160
154
|
'@typescript-eslint/no-restricted-imports':
|
|
161
155
|
eslintRules['no-restricted-imports'],
|
|
156
|
+
// disallow certain types
|
|
157
|
+
'@typescript-eslint/no-restricted-types': 2,
|
|
162
158
|
// disallow variable declarations from shadowing variables declared in the outer scope
|
|
163
159
|
'@typescript-eslint/no-shadow': eslintRules['no-shadow'],
|
|
164
160
|
// disallow aliasing `this`
|
|
165
161
|
'@typescript-eslint/no-this-alias': 2,
|
|
162
|
+
// disallow unnecessary assignment of constructor property parameter
|
|
163
|
+
'@typescript-eslint/no-unnecessary-parameter-property-assignment': 2,
|
|
166
164
|
// disallows unnecessary constraints on generic type
|
|
167
165
|
'@typescript-eslint/no-unnecessary-type-constraint': 2,
|
|
168
166
|
// disallows erging between classes and interfaces
|
|
169
167
|
'@typescript-eslint/no-unsafe-declaration-merging': 2,
|
|
168
|
+
// disallow using the unsafe built-in Function type
|
|
169
|
+
'@typescript-eslint/no-unsafe-function-type': 2,
|
|
170
170
|
// disallow unused expressions
|
|
171
171
|
'@typescript-eslint/no-unused-expressions':
|
|
172
172
|
eslintRules['no-unused-expressions'],
|
|
@@ -180,8 +180,8 @@ export default {
|
|
|
180
180
|
eslintRules['no-useless-constructor'],
|
|
181
181
|
// disallow unnecessary empty export
|
|
182
182
|
'@typescript-eslint/no-useless-empty-export': 2,
|
|
183
|
-
//
|
|
184
|
-
'@typescript-eslint/no-
|
|
183
|
+
// disallow using confusing built-in primitive class wrappers
|
|
184
|
+
'@typescript-eslint/no-wrapper-object-types': 2,
|
|
185
185
|
// require or disallow parameter properties in class constructors
|
|
186
186
|
'@typescript-eslint/parameter-properties': 0,
|
|
187
187
|
// prefer usage of `as const` over literal type
|