@allthings/eslint-config 3.8.0 → 4.0.0-beta.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/README.md CHANGED
@@ -68,6 +68,33 @@ export default [
68
68
  ]
69
69
  ```
70
70
 
71
+ ## Using with ESLint 10
72
+
73
+ The config supports both ESLint 9 and ESLint 10 (`peerDependencies.eslint: ">=9.33.0 <11"`). Two things to know:
74
+
75
+ **Yarn install will print peer-dep warnings** for `eslint-plugin-react` and `eslint-plugin-jsx-a11y` on ESLint 10 — both plugins still cap their declared peer at `^9` but work correctly at runtime. The warnings are cosmetic; you can ignore them or silence via `YN0086` log filter in `.yarnrc.yml`. They go away when upstream releases land (tracked in [jsx-eslint/eslint-plugin-react#3977](https://github.com/jsx-eslint/eslint-plugin-react/issues/3977)).
76
+
77
+ **React version is hardcoded to `'18.3'`** in `index.js`. If your project is on React 19, override it in your own config so version-specific rules behave correctly:
78
+
79
+ ```js
80
+ import allthingsConfig from '@allthings/eslint-config'
81
+
82
+ export default [
83
+ ...allthingsConfig,
84
+ {
85
+ languageOptions: {
86
+ parserOptions: {
87
+ project: './tsconfig.json',
88
+ tsconfigRootDir: import.meta.dirname,
89
+ },
90
+ },
91
+ settings: { react: { version: '19.1' } },
92
+ },
93
+ ]
94
+ ```
95
+
96
+ Do **not** set `settings.react.version: 'detect'` on ESLint 10 — it triggers a `context.getFilename is not a function` runtime crash in `eslint-plugin-react@7.37.5` (the very reason we hardcode a string default). The crash is fixed in [PR #3972](https://github.com/jsx-eslint/eslint-plugin-react/pull/3972) but not yet released.
97
+
71
98
  ## Development
72
99
 
73
100
  Run `yarn link` in the project folder
package/base.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import stylisticPlugin from '@stylistic/eslint-plugin'
2
2
  import jestPlugin from 'eslint-plugin-jest'
3
3
  import perfectionistPlugin from 'eslint-plugin-perfectionist'
4
- import preferArrowPlugin from 'eslint-plugin-prefer-arrow'
5
4
  import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort'
6
5
  import globals from 'globals'
7
6
 
@@ -18,10 +17,10 @@ export const baseParserOptions = {
18
17
  }
19
18
 
20
19
  export const baseSettings = {
21
- 'import/parsers': {
20
+ 'import-x/parsers': {
22
21
  '@typescript-eslint/parser': ['.ts', '.mts', '.cts', '.tsx', '.d.ts'],
23
22
  },
24
- 'import/resolver': {
23
+ 'import-x/resolver': {
25
24
  node: { extensions: ['.js', '.jsx', '.ts', '.tsx'] },
26
25
  typescript: { alwaysTryTypes: true },
27
26
  },
@@ -31,7 +30,6 @@ export const basePlugins = {
31
30
  '@stylistic': stylisticPlugin,
32
31
  jest: jestPlugin,
33
32
  perfectionist: perfectionistPlugin,
34
- 'prefer-arrow': preferArrowPlugin,
35
33
  'simple-import-sort': simpleImportSortPlugin,
36
34
  }
37
35
 
@@ -134,6 +132,7 @@ export const baseRules = {
134
132
  ],
135
133
  'constructor-super': 'error',
136
134
  eqeqeq: ['error', 'smart'],
135
+ 'func-style': ['warn', 'expression'],
137
136
  'guard-for-in': 'error',
138
137
  'id-denylist': [
139
138
  'error',
@@ -148,7 +147,7 @@ export const baseRules = {
148
147
  'undefined',
149
148
  ],
150
149
  'id-match': 'error',
151
- 'import/no-anonymous-default-export': [
150
+ 'import-x/no-anonymous-default-export': [
152
151
  'error',
153
152
  {
154
153
  allowAnonymousClass: false,
@@ -161,7 +160,7 @@ export const baseRules = {
161
160
  allowObject: true,
162
161
  },
163
162
  ],
164
- 'import/no-extraneous-dependencies': [
163
+ 'import-x/no-extraneous-dependencies': [
165
164
  'error',
166
165
  {
167
166
  devDependencies: true,
@@ -204,7 +203,7 @@ export const baseRules = {
204
203
  'perfectionist/sort-heritage-clauses': 'error',
205
204
  'perfectionist/sort-interfaces': 'error',
206
205
  'perfectionist/sort-object-types': 'error',
207
- 'prefer-arrow/prefer-arrow-functions': 'warn',
206
+ 'prefer-arrow-callback': 'warn',
208
207
  'prefer-const': 'error',
209
208
  'prefer-object-spread': 'error',
210
209
  'prefer-template': 'error',
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import tsPlugin from '@typescript-eslint/eslint-plugin'
2
2
  import vitestPlugin from '@vitest/eslint-plugin'
3
- import importPlugin from 'eslint-plugin-import'
3
+ import { flatConfigs as importFlatConfigs } from 'eslint-plugin-import-x'
4
4
  import jsxA11yPlugin from 'eslint-plugin-jsx-a11y'
5
5
  import prettierConfig from 'eslint-plugin-prettier/recommended'
6
6
  import reactPlugin from 'eslint-plugin-react'
@@ -21,12 +21,12 @@ const config = [
21
21
  ...tsPlugin.configs['flat/recommended-type-checked'],
22
22
  ...tsPlugin.configs['flat/stylistic-type-checked'],
23
23
  unicornPlugin.configs['flat/recommended'],
24
- importPlugin.flatConfigs.recommended,
25
- importPlugin.flatConfigs.typescript,
24
+ importFlatConfigs.recommended,
25
+ importFlatConfigs.typescript,
26
26
  reactPlugin.configs.flat.recommended,
27
27
  reactPlugin.configs.flat['jsx-runtime'],
28
28
  jsxA11yPlugin.flatConfigs.recommended,
29
- reactHooksPlugin.configs['recommended-latest'],
29
+ reactHooksPlugin.configs.flat['recommended-latest'],
30
30
  vitestPlugin.configs.recommended,
31
31
  {
32
32
  languageOptions: {
@@ -72,7 +72,7 @@ const config = [
72
72
  },
73
73
  settings: {
74
74
  ...baseSettings,
75
- react: { version: 'detect' },
75
+ react: { version: '18.3' },
76
76
  },
77
77
  },
78
78
  baseTestOverrides,
package/node.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import tsPlugin from '@typescript-eslint/eslint-plugin'
2
2
  import vitestPlugin from '@vitest/eslint-plugin'
3
- import importPlugin from 'eslint-plugin-import'
3
+ import { flatConfigs as importFlatConfigs } from 'eslint-plugin-import-x'
4
4
  import prettierConfig from 'eslint-plugin-prettier/recommended'
5
5
  import unicornPlugin from 'eslint-plugin-unicorn'
6
6
 
@@ -17,8 +17,8 @@ const config = [
17
17
  ...tsPlugin.configs['flat/recommended-type-checked'],
18
18
  ...tsPlugin.configs['flat/stylistic-type-checked'],
19
19
  unicornPlugin.configs['flat/recommended'],
20
- importPlugin.flatConfigs.recommended,
21
- importPlugin.flatConfigs.typescript,
20
+ importFlatConfigs.recommended,
21
+ importFlatConfigs.typescript,
22
22
  vitestPlugin.configs.recommended,
23
23
  {
24
24
  languageOptions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allthings/eslint-config",
3
- "version": "3.8.0",
3
+ "version": "4.0.0-beta.1",
4
4
  "type": "module",
5
5
  "description": "ESlint shareable config for Allthings style",
6
6
  "main": "index.js",
@@ -38,20 +38,19 @@
38
38
  "eslint-import-resolver-node": "^0.4.0",
39
39
  "eslint-import-resolver-typescript": "^4.4.4",
40
40
  "eslint-plugin-functional": "^9.0.5",
41
- "eslint-plugin-import": "^2.32.0",
41
+ "eslint-plugin-import-x": "^4.16.2",
42
42
  "eslint-plugin-jest": "^29.0.0",
43
43
  "eslint-plugin-jsx-a11y": "^6.10.2",
44
44
  "eslint-plugin-perfectionist": "^5.9.0",
45
- "eslint-plugin-prefer-arrow": "^1.2.3",
46
45
  "eslint-plugin-prettier": "^5.5.4",
47
46
  "eslint-plugin-react": "^7.37.5",
48
- "eslint-plugin-react-hooks": "^5.2.0",
47
+ "eslint-plugin-react-hooks": "^7.1.1",
49
48
  "eslint-plugin-simple-import-sort": "^13.0.0",
50
49
  "eslint-plugin-unicorn": "^64.0.0",
51
50
  "globals": "^17.0.0"
52
51
  },
53
52
  "peerDependencies": {
54
- "eslint": ">=9.33.0",
53
+ "eslint": ">=9.33.0 <11",
55
54
  "prettier": ">=3.8.0",
56
55
  "typescript": ">=5.9.0"
57
56
  },
@@ -59,7 +58,7 @@
59
58
  "@types/jest": "30.0.0",
60
59
  "@types/react": "18.3.28",
61
60
  "conventional-changelog-conventionalcommits": "9.3.1",
62
- "eslint": "9.39.4",
61
+ "eslint": "10.4.0",
63
62
  "husky": "9.1.7",
64
63
  "prettier": "3.8.3",
65
64
  "react": "18.3.1",