@willbooster/eslint-config-next 2.5.6 → 2.5.8

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/eslint.config.js +16 -23
  3. package/package.json +14 -14
package/README.md CHANGED
@@ -8,7 +8,7 @@ yarn add -D @willbooster/eslint-config-next \
8
8
  eslint \
9
9
  eslint-config-flat-gitignore \
10
10
  eslint-config-prettier \
11
- eslint-plugin-import \
11
+ eslint-plugin-import-x \
12
12
  eslint-plugin-prettier \
13
13
  eslint-plugin-react \
14
14
  eslint-plugin-react-hooks \
package/eslint.config.js CHANGED
@@ -1,14 +1,13 @@
1
1
  /* eslint-disable unicorn/no-null */
2
2
 
3
- import path from 'node:path';
4
- import { fileURLToPath } from 'node:url';
5
-
6
- import { FlatCompat } from '@eslint/eslintrc';
7
3
  import js from '@eslint/js';
4
+ import eslintPluginNext from '@next/eslint-plugin-next';
8
5
  import eslintConfigFlatGitignore from 'eslint-config-flat-gitignore';
9
6
  import eslintConfigPrettier from 'eslint-config-prettier';
7
+ import eslintPluginImportX from 'eslint-plugin-import-x';
10
8
  import eslintPluginReact from 'eslint-plugin-react';
11
9
  import eslintPluginReactCompiler from 'eslint-plugin-react-compiler';
10
+ import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
12
11
  import eslintPluginSortClassMembers from 'eslint-plugin-sort-class-members';
13
12
  import eslintPluginSortDestructureKeys from 'eslint-plugin-sort-destructure-keys';
14
13
  import eslintPluginUnicorn from 'eslint-plugin-unicorn';
@@ -16,20 +15,15 @@ import eslintPluginUnusedImports from 'eslint-plugin-unused-imports';
16
15
  import globals from 'globals';
17
16
  import tseslint from 'typescript-eslint';
18
17
 
19
- // mimic CommonJS variables -- not needed if using CommonJS
20
- const __filename = fileURLToPath(import.meta.url);
21
- const __dirname = path.dirname(__filename);
22
-
23
- const compat = new FlatCompat({
24
- baseDirectory: __dirname,
25
- });
18
+ const { flatConfig: eslintPluginNextFlatConfig } = eslintPluginNext;
19
+ const [reactHooksFlatRecommended] = eslintPluginReactHooks.configs['flat/recommended'];
26
20
 
27
21
  const config = [
28
- ...compat.extends('next/core-web-vitals'),
22
+ eslintPluginNextFlatConfig.coreWebVitals,
29
23
 
30
- // We import configs of eslint-config-js/js-react/ts/ts-react manually
31
- // because next/core-web-vitals depends on eslint-plugin-import,
32
- // but we want to keep using eslint-plugin-import-x in the above configs.
24
+ // We import configs of eslint-config-js/js-react/ts/ts-react manually so
25
+ // the Next.js rules layer on top of our standard setups powered by
26
+ // eslint-plugin-import-x.
33
27
 
34
28
  // --------------- from eslint-config-js ---------------
35
29
  // Note: don't merge the below two objects!
@@ -66,6 +60,7 @@ const config = [
66
60
  eslintPluginUnicorn.configs.recommended,
67
61
  {
68
62
  plugins: {
63
+ 'import-x': eslintPluginImportX,
69
64
  'sort-class-members': eslintPluginSortClassMembers,
70
65
  'sort-destructure-keys': eslintPluginSortDestructureKeys,
71
66
  },
@@ -86,9 +81,9 @@ const config = [
86
81
  'object-shorthand': 'error',
87
82
  'one-var': ['error', 'never'], // We prefer one variable declaration per line.
88
83
  'spaced-comment': 'error', // Enforce consistency of spacing after the start of a comment // or /*.
89
- 'import/newline-after-import': 'error',
90
- 'import/no-duplicates': 'error',
91
- 'import/order': [
84
+ 'import-x/newline-after-import': 'error',
85
+ 'import-x/no-duplicates': 'error',
86
+ 'import-x/order': [
92
87
  'error',
93
88
  {
94
89
  'newlines-between': 'always',
@@ -128,10 +123,8 @@ const config = [
128
123
  // cf. https://github.com/jsx-eslint/eslint-plugin-react#flat-configs
129
124
  eslintPluginReact.configs.flat.recommended,
130
125
  eslintPluginReact.configs.flat['jsx-runtime'],
131
- // cf. https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks#flat-config-eslintconfigjsts
132
- // To fix the error: ConfigError: Config "react-hooks/recommended": Key "plugins": Cannot redefine plugin "react-hooks".
133
- // TODO: re-enable the below configs after the error is fixed.
134
- // eslintPluginReactHooks.configs['recommended-latest'],
126
+ // cf. https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks#readme
127
+ reactHooksFlatRecommended,
135
128
  // cf. https://www.npmjs.com/package/eslint-plugin-react-compiler
136
129
  eslintPluginReactCompiler.configs.recommended,
137
130
  {
@@ -302,7 +295,7 @@ const config = [
302
295
  'src/pages/api/**/*.ts',
303
296
  ],
304
297
  rules: {
305
- 'import/no-default-export': 'off',
298
+ 'import-x/no-default-export': 'off',
306
299
  },
307
300
  },
308
301
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/eslint-config-next",
3
- "version": "2.5.6",
3
+ "version": "2.5.8",
4
4
  "description": "A ESLint flat config for Next.js",
5
5
  "license": "Apache-2.0",
6
6
  "author": "WillBooster Inc.",
@@ -23,35 +23,35 @@
23
23
  "prettier": "@willbooster/prettier-config",
24
24
  "devDependencies": {
25
25
  "@eslint/eslintrc": "3.3.1",
26
- "@eslint/js": "9.35.0",
26
+ "@eslint/js": "9.37.0",
27
27
  "@types/eslint": "9.6.1",
28
28
  "@types/micromatch": "4.0.9",
29
- "@types/node": "24.3.1",
30
- "@types/react": "19.1.12",
29
+ "@types/node": "24.6.2",
30
+ "@types/react": "19.2.0",
31
31
  "@willbooster/prettier-config": "10.2.0",
32
- "eslint": "9.35.0",
32
+ "eslint": "9.37.0",
33
33
  "eslint-config-flat-gitignore": "2.1.0",
34
- "eslint-config-next": "15.5.2",
34
+ "eslint-config-next": "15.5.4",
35
35
  "eslint-config-prettier": "10.1.8",
36
36
  "eslint-import-resolver-typescript": "4.4.4",
37
37
  "eslint-plugin-import-x": "4.16.1",
38
38
  "eslint-plugin-react": "7.37.5",
39
39
  "eslint-plugin-react-compiler": "19.1.0-rc.2",
40
- "eslint-plugin-react-hooks": "5.2.0",
40
+ "eslint-plugin-react-hooks": "6.1.1",
41
41
  "eslint-plugin-sort-class-members": "1.21.0",
42
42
  "eslint-plugin-sort-destructure-keys": "2.0.0",
43
43
  "eslint-plugin-unicorn": "61.0.2",
44
44
  "eslint-plugin-unused-imports": "4.2.0",
45
- "globals": "16.3.0",
46
- "lint-staged": "16.1.6",
45
+ "globals": "16.4.0",
46
+ "lint-staged": "16.2.3",
47
47
  "micromatch": "4.0.8",
48
- "next": "15.5.2",
48
+ "next": "15.5.4",
49
49
  "prettier": "3.6.2",
50
- "prettier-plugin-java": "2.7.4",
51
- "react": "19.1.1",
50
+ "prettier-plugin-java": "2.7.5",
51
+ "react": "19.2.0",
52
52
  "sort-package-json": "3.4.0",
53
- "typescript": "5.9.2",
54
- "typescript-eslint": "8.42.0",
53
+ "typescript": "5.9.3",
54
+ "typescript-eslint": "8.45.0",
55
55
  "use-immer": "0.11.0"
56
56
  },
57
57
  "peerDependencies": {