@metamask/eslint-config-typescript 14.1.0 → 15.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/CHANGELOG.md CHANGED
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [15.0.0]
11
+
12
+ ### Changed
13
+
14
+ - **BREAKING:** Bump peer dependency on `@metamask/eslint-config` from `^14.0.0` to `^15.0.0` ([#431](https://github.com/MetaMask/eslint-config/pull/431))
15
+ - **BREAKING:** Update `typescript-eslint` peer dependency to have a minimum version of v8.39.0 ([#423](https://github.com/MetaMask/eslint-config/pull/423))
16
+ - This version has a matching supported `typescript` range, and includes some bug fixes for problems we ran into.
17
+ - **BREAKING:** Update type import specifier rules ([#381](https://github.com/MetaMask/eslint-config/pull/381))
18
+ - `@typescript-eslint/consistent-type-imports` has been replaced with `import-x/consistent-type-specifier-style`
19
+ - The rule now prefers "top-level" type imports over inline. e.g. `import type { a } from 'x'` over `import { type a } from 'x'`
20
+ - Disable `@typescript-eslint/no-unnecessary-type-arguments` ([#426](https://github.com/MetaMask/eslint-config/pull/426))
21
+ - We decided that "unnecessary" type arguments make types easier to read sometimes, so we should allow them.
22
+ - Disable `promise/valid-params` because it's redundant in type-checked projects ([#425](https://github.com/MetaMask/eslint-config/pull/425))
23
+ - Disable `import-x/no-duplicates` ([#427](https://github.com/MetaMask/eslint-config/pull/427))
24
+ - It was a style preference that we may not want, and the auto-fix was broken.
25
+ - Loosen `@typescript-eslint/naming-convention` by not enforcing naming conventions for object literal properties ([#428](https://github.com/MetaMask/eslint-config/pull/428))
26
+ - Object literals are too often used as parameters for 3rd party libraries/services.
27
+ - Disable `jsdoc/check-indentation` ([#430](https://github.com/MetaMask/eslint-config/pull/430))
28
+ - Disabled due to a problem with indended sections in TSDoc blocks.
29
+ - Widen `typescript` peer dependency to allow all 5.x versions ([#422](https://github.com/MetaMask/eslint-config/pull/422))
30
+
31
+ ### Fixed
32
+
33
+ - Prevent non-type imports from being grouped under a type import upon auto-fix ([#427](https://github.com/MetaMask/eslint-config/pull/427))
34
+ - This was caused by `import-x/no-duplicates`, which is now disabled.
35
+ - Fix false positive lint error on TSDoc blocks with indended sections (e.g. bullet lists) ([#430](https://github.com/MetaMask/eslint-config/pull/430))
36
+
10
37
  ## [14.1.0]
11
38
 
12
39
  ### Added
@@ -184,7 +211,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
184
211
  - To continue extending this config, install this package and update your `.eslintrc.js` `extends` array to include `@metamask/eslint-config-typescript` instead of `@metamask/eslint-config/typescript`.
185
212
  - Update `eslint` and other ESLint peer dependencies ([#151](https://github.com/MetaMask/eslint-config/pull/151))
186
213
 
187
- [Unreleased]: https://github.com/MetaMask/eslint-config/compare/@metamask/eslint-config-typescript@14.1.0...HEAD
214
+ [Unreleased]: https://github.com/MetaMask/eslint-config/compare/@metamask/eslint-config-typescript@15.0.0...HEAD
215
+ [15.0.0]: https://github.com/MetaMask/eslint-config/compare/@metamask/eslint-config-typescript@14.1.0...@metamask/eslint-config-typescript@15.0.0
188
216
  [14.1.0]: https://github.com/MetaMask/eslint-config/compare/@metamask/eslint-config-typescript@14.0.0...@metamask/eslint-config-typescript@14.1.0
189
217
  [14.0.0]: https://github.com/MetaMask/eslint-config/compare/@metamask/eslint-config-typescript@13.0.0...@metamask/eslint-config-typescript@14.0.0
190
218
  [13.0.0]: https://github.com/MetaMask/eslint-config/compare/@metamask/eslint-config-typescript@12.1.0...@metamask/eslint-config-typescript@13.0.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/eslint-config-typescript",
3
- "version": "14.1.0",
3
+ "version": "15.0.0",
4
4
  "description": "Shareable MetaMask ESLint config for TypeScript.",
5
5
  "homepage": "https://github.com/MetaMask/eslint-config#readme",
6
6
  "bugs": {
@@ -39,7 +39,7 @@
39
39
  "devDependencies": {
40
40
  "@jest/globals": "^29.7.0",
41
41
  "@metamask/auto-changelog": "^3.4.4",
42
- "@metamask/eslint-config": "^14.1.0",
42
+ "@metamask/eslint-config": "^15.0.0",
43
43
  "eslint": "^9.11.0",
44
44
  "eslint-config-prettier": "^9.1.0",
45
45
  "eslint-import-resolver-typescript": "^3.6.3",
@@ -48,18 +48,18 @@
48
48
  "eslint-plugin-prettier": "^5.2.1",
49
49
  "globals": "^15.9.0",
50
50
  "prettier": "^3.3.3",
51
- "typescript": "~5.8.0",
52
- "typescript-eslint": "^8.28.0",
51
+ "typescript": "^5.9.3",
52
+ "typescript-eslint": "^8.47.0",
53
53
  "vitest": "^2.1.9"
54
54
  },
55
55
  "peerDependencies": {
56
- "@metamask/eslint-config": "^14.1.0",
56
+ "@metamask/eslint-config": "^15.0.0",
57
57
  "eslint": "^9.11.0",
58
58
  "eslint-import-resolver-typescript": "^3.6.3",
59
59
  "eslint-plugin-import-x": "^4.3.0",
60
60
  "eslint-plugin-jsdoc": "^50.2.4",
61
- "typescript": ">=4.8.4 <5.9.0",
62
- "typescript-eslint": "^8.24"
61
+ "typescript": ">=4.8.4 <6",
62
+ "typescript-eslint": "^8.39.0"
63
63
  },
64
64
  "engines": {
65
65
  "node": "^18.18 || >=20"
package/src/index.mjs CHANGED
@@ -38,14 +38,10 @@ const config = createConfig({
38
38
  },
39
39
 
40
40
  rules: {
41
- // Handled by TypeScript
42
- 'import-x/no-unresolved': 'off',
43
-
44
41
  // Our rules
45
42
  '@typescript-eslint/array-type': 'error',
46
43
  '@typescript-eslint/consistent-type-assertions': 'error',
47
44
  '@typescript-eslint/consistent-type-definitions': ['error', 'type'],
48
- '@typescript-eslint/consistent-type-imports': 'error',
49
45
  '@typescript-eslint/explicit-function-return-type': 'error',
50
46
  '@typescript-eslint/no-explicit-any': 'off',
51
47
  '@typescript-eslint/no-namespace': [
@@ -82,6 +78,9 @@ const config = createConfig({
82
78
  '@typescript-eslint/no-unsafe-enum-comparison': 'off',
83
79
  '@typescript-eslint/require-await': 'off',
84
80
 
81
+ // Disabled because unnecessary type arguments are sometimes helpful for readability
82
+ '@typescript-eslint/no-unnecessary-type-arguments': 'off',
83
+
85
84
  // Our rules that require type information
86
85
  '@typescript-eslint/consistent-type-exports': 'error',
87
86
  '@typescript-eslint/naming-convention': [
@@ -114,7 +113,9 @@ const config = createConfig({
114
113
  },
115
114
  {
116
115
  selector: 'objectLiteralProperty',
117
- format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
116
+ // Disabled because object literals are often parameters to 3rd party libraries/services,
117
+ // which we don't set the naming conventions for
118
+ format: null,
118
119
  },
119
120
  {
120
121
  selector: 'typeLike',
@@ -156,7 +157,6 @@ const config = createConfig({
156
157
  '@typescript-eslint/no-meaningless-void-operator': 'error',
157
158
  '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
158
159
  '@typescript-eslint/no-unnecessary-qualifier': 'error',
159
- '@typescript-eslint/no-unnecessary-type-arguments': 'error',
160
160
  '@typescript-eslint/prefer-enum-initializers': 'error',
161
161
  '@typescript-eslint/prefer-includes': 'error',
162
162
  '@typescript-eslint/prefer-nullish-coalescing': 'error',
@@ -199,13 +199,28 @@ const config = createConfig({
199
199
  'no-useless-constructor': 'off',
200
200
  '@typescript-eslint/no-useless-constructor': 'error',
201
201
 
202
+ /* import-x plugin rules */
203
+
204
+ // This rule is to aggresive about combining type and non-type imports, which I'm not sure that we want.
205
+ // But more importantly, the auto-fixer is broken.
206
+ // See here for details on that bug: https://github.com/un-ts/eslint-plugin-import-x/issues/231
207
+ 'import-x/no-duplicates': 'off',
208
+
209
+ // Handled by TypeScript
210
+ 'import-x/no-unresolved': 'off',
211
+
212
+ // Combined with the "verbatimModuleSyntax" tsconfig option, a better option than
213
+ // @typescript-eslint/consistent-type-imports
214
+ 'import-x/consistent-type-specifier-style': ['error', 'prefer-top-level'],
215
+
202
216
  /* jsdoc plugin rules */
203
217
 
204
218
  'jsdoc/check-syntax': 'error',
205
219
 
206
- // This is enabled here rather than in the base config because it doesn't play nicely with
207
- // multi-line JSDoc types.
208
- 'jsdoc/check-indentation': 'error',
220
+ // This is disabled because it doesn't work with bullet lists, and other types of indented
221
+ // sections. This issue is fixed in later versions, we can re-enable it after updating.
222
+ // See https://github.com/gajus/eslint-plugin-jsdoc/issues/541 for details
223
+ 'jsdoc/check-indentation': 'off',
209
224
 
210
225
  // Use TypeScript types rather than JSDoc types.
211
226
  'jsdoc/no-types': 'error',
@@ -225,6 +240,11 @@ const config = createConfig({
225
240
  message: 'Use a hash name instead.',
226
241
  },
227
242
  ],
243
+
244
+ /* promise plugin rules */
245
+
246
+ // TypeScript already validates Promise params, no need to validate them twice
247
+ 'promise/valid-params': 'off',
228
248
  },
229
249
  });
230
250