@zendeskgarden/eslint-config 42.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zendeskgarden/eslint-config",
3
- "version": "42.0.0",
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>",
@@ -19,33 +19,36 @@
19
19
  "format": "prettier-package-json --write",
20
20
  "lint": "eslint eslint.config.js index.js plugins/*.js rules/*.js --max-warnings 0",
21
21
  "prepare": "husky",
22
- "tag": "[ `git rev-parse --abbrev-ref HEAD` = 'main' ] && standard-version --no-verify",
22
+ "start": "npm exec @eslint/config-inspector",
23
+ "tag": "[ `git rev-parse --abbrev-ref HEAD` = 'main' ] && commit-and-tag-version --no-verify --npmPublishHint 'true'",
23
24
  "test": "npm run format && npm run lint && git diff --quiet"
24
25
  },
25
26
  "dependencies": {
26
- "@babel/eslint-parser": "7.24.7",
27
- "@eslint/compat": "1.1.0",
28
- "eslint-plugin-jest": "28.6.0",
29
- "eslint-plugin-jsx-a11y": "6.9.0",
30
- "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",
31
31
  "eslint-plugin-notice": "1.0.0",
32
- "eslint-plugin-react": "7.34.3",
32
+ "eslint-plugin-react": "7.36.0",
33
33
  "eslint-plugin-react-hooks": "4.6.2",
34
- "globals": "15.6.0",
35
- "typescript-eslint": "7.13.1"
34
+ "globals": "15.9.0",
35
+ "typescript-eslint": "8.5.0"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "eslint": "^9.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@babel/core": "7.24.7",
42
- "eslint": "9.5.0",
43
- "husky": "9.0.11",
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",
45
+ "envalid": "8.0.0",
46
+ "eslint": "9.10.0",
47
+ "husky": "9.1.6",
44
48
  "jest": "29.7.0",
45
49
  "prettier-package-json": "2.8.0",
46
50
  "react": "18.3.1",
47
- "standard-version": "9.5.0",
48
- "typescript": "5.4.5"
51
+ "typescript": "5.6.2"
49
52
  },
50
53
  "keywords": [
51
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
- // TODO remove fixup when eslint-plugin-react-hooks 5.x is released
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,
@@ -68,6 +68,8 @@ export default {
68
68
  '@typescript-eslint/no-base-to-string': 2,
69
69
  // requires expressions of type void to appear in statement position
70
70
  '@typescript-eslint/no-confusing-void-expression': 2,
71
+ // disallow using code marked as `@deprecated`
72
+ '@typescript-eslint/no-deprecated': 1,
71
73
  // disallows duplicate union or intersection type members
72
74
  '@typescript-eslint/no-duplicate-type-constituents': 2,
73
75
  // requires Promise-like values to be handled appropriately
@@ -97,6 +99,8 @@ export default {
97
99
  '@typescript-eslint/no-unnecessary-type-arguments': 2,
98
100
  // warns if a type assertion does not change the type of an expression
99
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,
100
104
  // disallows calling an function with an any type value
101
105
  '@typescript-eslint/no-unsafe-argument': 2,
102
106
  // disallows assigning any to variables and properties
@@ -23,7 +23,7 @@ export default {
23
23
  languageOptions: {
24
24
  parser: tseslint.parser,
25
25
  parserOptions: {
26
- project: true
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 the declaration of empty interfaces
123
- '@typescript-eslint/no-empty-interface': 2,
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
- // disallows the use of require statements except in import statements
184
- '@typescript-eslint/no-var-requires': 2,
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