@zendeskgarden/eslint-config 43.0.0 → 44.0.1

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": "43.0.0",
3
+ "version": "44.0.1",
4
4
  "description": "Garden ESLint config",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Zendesk Garden <garden@zendesk.com>",
@@ -20,37 +20,36 @@
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' ] && standard-version --no-verify",
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.24.7",
28
- "@eslint/compat": "1.1.0",
29
- "eslint-plugin-deprecation": "3.0.0",
30
- "eslint-plugin-jest": "28.6.0",
31
- "eslint-plugin-jsx-a11y": "6.9.0",
32
- "eslint-plugin-n": "17.9.0",
27
+ "@babel/eslint-parser": "7.25.1",
28
+ "@eslint/compat": "1.1.1",
29
+ "eslint-plugin-jest": "28.8.3",
30
+ "eslint-plugin-jsx-a11y": "6.10.0",
31
+ "eslint-plugin-n": "17.10.2",
33
32
  "eslint-plugin-notice": "1.0.0",
34
- "eslint-plugin-react": "7.34.3",
33
+ "eslint-plugin-react": "7.36.0",
35
34
  "eslint-plugin-react-hooks": "4.6.2",
36
- "globals": "15.6.0",
37
- "typescript-eslint": "7.13.1"
35
+ "globals": "15.9.0",
36
+ "typescript-eslint": "8.5.0"
38
37
  },
39
38
  "peerDependencies": {
40
39
  "eslint": "^9.0.0"
41
40
  },
42
41
  "devDependencies": {
43
- "@babel/core": "7.24.7",
44
- "@eslint/config-inspector": "0.5.0",
45
- "@zendeskgarden/scripts": "2.3.0",
42
+ "@babel/core": "7.25.2",
43
+ "@eslint/config-inspector": "0.5.4",
44
+ "@zendeskgarden/scripts": "2.4.2",
45
+ "commit-and-tag-version": "12.4.3",
46
46
  "envalid": "8.0.0",
47
- "eslint": "9.5.0",
48
- "husky": "9.0.11",
47
+ "eslint": "9.10.0",
48
+ "husky": "9.1.6",
49
49
  "jest": "29.7.0",
50
50
  "prettier-package-json": "2.8.0",
51
51
  "react": "18.3.1",
52
- "standard-version": "9.5.0",
53
- "typescript": "5.4.5"
52
+ "typescript": "5.6.2"
54
53
  },
55
54
  "keywords": [
56
55
  "eslint",
package/plugins/react.js CHANGED
@@ -58,6 +58,8 @@ export default {
58
58
  'react/forbid-foreign-prop-types': 0,
59
59
  // forbid certain propTypes
60
60
  'react/forbid-prop-types': 0,
61
+ // require all forwardRef components include a ref parameter
62
+ 'react/forward-ref-uses-ref': 2,
61
63
  // standardize the way function components get defined
62
64
  'react/function-component-definition': [
63
65
  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
  };
@@ -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