@willbooster/eslint-config-next 3.0.1 → 3.0.2

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 (2) hide show
  1. package/package.json +21 -58
  2. package/eslint.config.js +0 -389
package/package.json CHANGED
@@ -1,90 +1,53 @@
1
1
  {
2
2
  "name": "@willbooster/eslint-config-next",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "ESLint flat config for Next.js projects",
5
- "license": "Apache-2.0",
6
- "author": "WillBooster Inc.",
7
5
  "repository": {
8
6
  "type": "git",
9
7
  "url": "git+https://github.com/WillBooster/willbooster-configs.git",
10
8
  "directory": "packages/eslint-config-next"
11
9
  },
10
+ "license": "Apache-2.0",
11
+ "author": "WillBooster Inc.",
12
+ "type": "module",
13
+ "main": "eslint.config.js",
14
+ "types": "eslint.config.d.ts",
12
15
  "files": [
13
16
  "eslint.config.d.ts",
14
17
  "eslint.config.js"
15
18
  ],
16
- "type": "module",
17
- "main": "eslint.config.js",
18
- "types": "eslint.config.d.ts",
19
- "publishConfig": {
20
- "access": "public"
21
- },
22
19
  "scripts": {
23
20
  "check-all-for-ai": "yarn check-for-ai && yarn test",
24
21
  "check-for-ai": "yarn install > /dev/null && yarn format > /dev/null 2> /dev/null || true && yarn lint-fix --quiet",
25
22
  "cleanup": "yarn format && yarn lint-fix",
26
- "format": "sort-package-json && yarn format-code && yarn prettify",
27
- "format-code": "oxfmt --write --no-error-on-unmatched-pattern .",
23
+ "format": "sort-package-json && yarn format-code",
24
+ "format-code": "oxfmt --write --no-error-on-unmatched-pattern . '!**/package.json'",
28
25
  "lint": "oxlint --no-error-on-unmatched-pattern .",
29
26
  "lint-fix": "yarn lint --fix",
30
- "prettify": "prettier --cache --color --no-error-on-unmatched-pattern --write \"**/{.*/,}*.{java}\" \"!**/test{-,/}fixtures/**\" || true",
31
27
  "test": "yarn lint",
32
28
  "typecheck": "tsgo --noEmit"
33
29
  },
34
30
  "devDependencies": {
35
- "@eslint-react/eslint-plugin": "4.2.3",
36
31
  "@eslint/eslintrc": "3.3.5",
37
- "@eslint/js": "10.0.1",
38
32
  "@tsconfig/node-lts": "24.0.0",
39
33
  "@tsconfig/node-ts": "23.6.4",
40
- "@types/eslint": "9.6.1",
41
- "@types/micromatch": "4.0.10",
42
- "@types/node": "25.5.0",
34
+ "@types/node": "25.6.0",
43
35
  "@types/react": "19.2.14",
44
- "@typescript/native-preview": "7.0.0-dev.20260415.1",
45
- "@willbooster/prettier-config": "10.4.0",
46
- "eslint": "10.2.0",
47
- "eslint-config-flat-gitignore": "2.3.0",
48
- "eslint-config-next": "16.2.1",
49
- "eslint-config-prettier": "10.1.8",
50
- "eslint-import-resolver-typescript": "4.4.4",
51
- "eslint-plugin-import-x": "4.16.2",
52
- "eslint-plugin-perfectionist": "5.8.0",
53
- "eslint-plugin-react-compiler": "19.1.0-rc.2",
54
- "eslint-plugin-sort-class-members": "1.21.0",
55
- "eslint-plugin-sort-destructure-keys": "3.0.0",
56
- "eslint-plugin-unicorn": "64.0.0",
57
- "eslint-plugin-unused-imports": "4.4.1",
58
- "globals": "17.4.0",
59
- "micromatch": "4.0.8",
60
- "oxfmt": "0.45.0",
61
- "oxlint": "1.60.0",
62
- "oxlint-tsgolint": "0.21.0",
63
- "prettier": "3.8.1",
64
- "prettier-plugin-java": "2.8.1",
65
- "react": "19.2.4",
36
+ "@typescript/native-preview": "7.0.0-dev.20260421.2",
37
+ "@willbooster/oxfmt-config": "1.2.2",
38
+ "@willbooster/oxlint-config": "1.4.5",
39
+ "eslint-config-next": "16.2.4",
40
+ "oxfmt": "0.46.0",
41
+ "oxlint": "1.61.0",
42
+ "oxlint-tsgolint": "0.22.0",
43
+ "react": "19.2.5",
66
44
  "sort-package-json": "3.6.1",
67
- "typescript-eslint": "8.58.1",
68
45
  "use-immer": "0.11.0"
69
46
  },
70
47
  "peerDependencies": {
71
- "@eslint-react/eslint-plugin": ">=4.2.3",
72
- "@eslint/js": ">=10",
73
- "@next/eslint-plugin-next": ">=16",
74
- "eslint": ">=10",
75
- "eslint-config-flat-gitignore": ">=2.1",
76
- "eslint-config-prettier": ">=10",
77
- "eslint-import-resolver-typescript": ">=4",
78
- "eslint-plugin-import-x": ">=4",
79
- "eslint-plugin-perfectionist": ">=5.8",
80
- "eslint-plugin-react-compiler": ">=19.1.0-rc.2",
81
- "eslint-plugin-sort-class-members": ">=1.21",
82
- "eslint-plugin-sort-destructure-keys": ">=2",
83
- "eslint-plugin-unicorn": ">=59",
84
- "eslint-plugin-unused-imports": ">=4",
85
- "globals": ">=16",
86
- "typescript": ">=5",
87
- "typescript-eslint": ">=8"
48
+ "typescript": ">=5"
88
49
  },
89
- "prettier": "@willbooster/prettier-config"
50
+ "publishConfig": {
51
+ "access": "public"
52
+ }
90
53
  }
package/eslint.config.js DELETED
@@ -1,389 +0,0 @@
1
- /* eslint-disable unicorn/no-null */
2
-
3
- import js from '@eslint/js';
4
- import eslintPluginReact from '@eslint-react/eslint-plugin';
5
- import eslintPluginNext from '@next/eslint-plugin-next';
6
- import eslintConfigFlatGitignore from 'eslint-config-flat-gitignore';
7
- import eslintConfigPrettier from 'eslint-config-prettier';
8
- import eslintPluginImportX from 'eslint-plugin-import-x';
9
- import eslintPluginPerfectionist from 'eslint-plugin-perfectionist';
10
- import eslintPluginReactCompiler from 'eslint-plugin-react-compiler';
11
- import eslintPluginSortClassMembers from 'eslint-plugin-sort-class-members';
12
- import eslintPluginSortDestructureKeys from 'eslint-plugin-sort-destructure-keys';
13
- import eslintPluginUnicorn from 'eslint-plugin-unicorn';
14
- import eslintPluginUnusedImports from 'eslint-plugin-unused-imports';
15
- import globals from 'globals';
16
- import tseslint from 'typescript-eslint';
17
-
18
- const { flatConfig: eslintPluginNextFlatConfig } = eslintPluginNext;
19
-
20
- const config = [
21
- // Since eslintPluginNextFlatConfig.coreWebVitals does not work on Next.js 16 beta.
22
- ...[eslintPluginNextFlatConfig?.coreWebVitals].filter(Boolean),
23
-
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.
27
-
28
- // --------------- from eslint-config-js ---------------
29
- // Note: don't merge the below two objects!
30
- {
31
- files: ['{,prisma/**/,src/**/,test/**/,scripts/**/}*.{cjs,js,jsx,mjs}'],
32
- },
33
- {
34
- ignores: [
35
- // Directories
36
- '**/.venv/**',
37
- '**/.yarn/**',
38
- '**/3rd-party/**',
39
- '**/@types/**',
40
- '**/__generated__/**',
41
- '**/android/**',
42
- '**/bin/**',
43
- '**/build/**',
44
- '**/coverage/**',
45
- '**/dist/**',
46
- '**/ios/**',
47
- '**/no-format/**',
48
- '**/node_modules/**',
49
- '**/temp/**',
50
- '**/test-fixtures/**',
51
- '**/test/fixtures/**',
52
- // Files
53
- '**/*.d.ts',
54
- '**/*.min.*js',
55
- ],
56
- },
57
- // cf. https://github.com/eslint/eslint/blob/main/packages/js/src/configs/eslint-recommended.js
58
- js.configs.recommended,
59
- // cf. https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config
60
- eslintPluginUnicorn.configs.recommended,
61
- {
62
- plugins: {
63
- 'import-x': eslintPluginImportX,
64
- 'sort-class-members': eslintPluginSortClassMembers,
65
- 'sort-destructure-keys': eslintPluginSortDestructureKeys,
66
- },
67
- languageOptions: {
68
- ecmaVersion: 'latest',
69
- parserOptions: {
70
- ecmaFeatures: {
71
- jsx: true,
72
- },
73
- },
74
- globals: {
75
- // for Web
76
- ...globals.browser,
77
- ...globals.serviceworker,
78
- // for Node.js
79
- ...globals.node,
80
- },
81
- },
82
- rules: {
83
- eqeqeq: 'warn',
84
- 'no-console': 'off', // Allow `console.log()`.
85
- 'no-unused-vars': ['warn', { ignoreRestSiblings: true }], // Allow unused vars in object destructuring.
86
- 'object-shorthand': 'error',
87
- 'one-var': ['error', 'never'], // We prefer one variable declaration per line.
88
- 'spaced-comment': 'error', // Enforce consistency of spacing after the start of a comment // or /*.
89
- 'import-x/newline-after-import': 'error',
90
- 'import-x/no-duplicates': 'error',
91
- 'import-x/order': [
92
- 'error',
93
- {
94
- 'newlines-between': 'always',
95
- alphabetize: {
96
- order: 'asc',
97
- },
98
- },
99
- ],
100
- 'sort-destructure-keys/sort-destructure-keys': 'error',
101
- 'unicorn/filename-case': [
102
- 'error',
103
- {
104
- cases: {
105
- camelCase: true,
106
- pascalCase: true,
107
- },
108
- },
109
- ],
110
- 'unicorn/no-abusive-eslint-disable': 'off',
111
- 'unicorn/no-array-callback-reference': 'off',
112
- 'unicorn/no-array-reduce': 'warn',
113
- 'unicorn/no-null': 'warn',
114
- 'unicorn/no-process-exit': 'off',
115
- 'unicorn/no-useless-undefined': [
116
- 'error',
117
- {
118
- checkArguments: false,
119
- },
120
- ],
121
- 'unicorn/prefer-top-level-await': 'warn',
122
- 'unicorn/prevent-abbreviations': 'off',
123
- },
124
- },
125
- // -----------------------------------------------------------
126
-
127
- // --------------- from eslint-config-js-react ---------------
128
- // cf. https://eslint-react.xyz/docs/migrating-from-eslint-plugin-react
129
- eslintPluginReact.configs.recommended,
130
- // cf. https://www.npmjs.com/package/eslint-plugin-react-compiler
131
- eslintPluginReactCompiler.configs.recommended,
132
- {
133
- plugins: {
134
- perfectionist: eslintPluginPerfectionist,
135
- },
136
- settings: {
137
- 'react-x': {
138
- version: 'detect',
139
- },
140
- },
141
- rules: {
142
- '@eslint-react/dom-no-unknown-property': [
143
- 'error',
144
- {
145
- ignore: ['global', 'jsx'],
146
- },
147
- ],
148
- 'perfectionist/sort-jsx-props': [
149
- 'error',
150
- {
151
- customGroups: [
152
- {
153
- groupName: 'reserved',
154
- elementNamePattern: '^(children|dangerouslySetInnerHTML|key|ref)$',
155
- },
156
- {
157
- groupName: 'callback',
158
- elementNamePattern: '^on[A-Z]',
159
- },
160
- ],
161
- groups: ['reserved', 'shorthand-prop', 'unknown', 'callback'],
162
- },
163
- ],
164
- },
165
- },
166
- // -----------------------------------------------------------
167
-
168
- // --------------- from eslint-config-ts ---------------
169
- ...tseslint.configs.strictTypeChecked.map((config) => ({
170
- ...config,
171
- files: ['{,prisma/**/,src/**/,test/**/,scripts/**/}*.{cts,mts,ts,tsx}'],
172
- ignores: ['*.{cjs,js,mjs}'],
173
- })),
174
- ...tseslint.configs.stylisticTypeChecked.map((config) => ({
175
- ...config,
176
- files: ['{,prisma/**/,src/**/,test/**/,scripts/**/}*.{cts,mts,ts,tsx}'],
177
- ignores: ['*.{cjs,js,mjs}'],
178
- })),
179
- {
180
- files: ['{,prisma/**/,src/**/,test/**/,scripts/**/}*.{cts,mts,ts,tsx}'],
181
- ignores: ['*.{cjs,js,mjs}'],
182
- languageOptions: {
183
- parserOptions: {
184
- projectService: true,
185
- tsconfigRootDir: import.meta.dirname,
186
- },
187
- },
188
- rules: {
189
- '@typescript-eslint/camelcase': 'off', // c.f. https://github.com/typescript-eslint/typescript-eslint/issues/2050
190
- // cf. https://zenn.dev/bmth/articles/interface-props-extends
191
- // Note: `interface Params` causes errors on Next.js. We should extends it with Next.js `Params`.
192
- '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
193
- '@typescript-eslint/consistent-type-imports': 'error',
194
- '@typescript-eslint/explicit-function-return-type': [
195
- 'error',
196
- {
197
- allowExpressions: true,
198
- allowHigherOrderFunctions: true,
199
- },
200
- ],
201
- '@typescript-eslint/explicit-member-accessibility': [
202
- 'error',
203
- {
204
- accessibility: 'no-public',
205
- },
206
- ],
207
- '@typescript-eslint/naming-convention': [
208
- 'error',
209
- {
210
- selector: 'default',
211
- format: ['camelCase'],
212
- leadingUnderscore: 'allow',
213
- trailingUnderscore: 'allow',
214
- },
215
- {
216
- selector: 'parameter',
217
- format: ['camelCase'],
218
- leadingUnderscore: 'allow',
219
- },
220
- {
221
- selector: 'variable',
222
- format: ['camelCase', 'PascalCase', 'UPPER_CASE'], // to use 'const ReactElem = () => { ... };'
223
- leadingUnderscore: 'allow',
224
- trailingUnderscore: 'allow',
225
- },
226
- {
227
- selector: 'function',
228
- format: ['camelCase', 'PascalCase'], // Allow PascalCase for React component functions
229
- leadingUnderscore: 'allow',
230
- },
231
- {
232
- selector: 'typeLike',
233
- format: ['PascalCase'],
234
- },
235
- {
236
- selector: 'enumMember',
237
- format: ['PascalCase'],
238
- },
239
- {
240
- // allow any name when referring to import and property
241
- selector: ['import', 'property'],
242
- format: null,
243
- },
244
- {
245
- // allow any name in object destructuring of variable
246
- selector: 'variable',
247
- modifiers: ['destructured'],
248
- format: null,
249
- },
250
- {
251
- // allow any name in object destructuring of parameter
252
- selector: 'parameter',
253
- modifiers: ['destructured'],
254
- format: null,
255
- },
256
- ],
257
- // We prefer https://typescript-eslint.io/rules/no-non-null-assertion/ to this
258
- '@typescript-eslint/non-nullable-type-assertion-style': 'off',
259
- '@typescript-eslint/no-explicit-any': 'error', // let's try avoiding `any`
260
- '@typescript-eslint/no-misused-promises': [
261
- // for React components
262
- // cf. https://typescript-eslint.io/rules/no-misused-promises/#checksvoidreturn
263
- 'error',
264
- {
265
- checksVoidReturn: {
266
- arguments: false,
267
- attributes: false,
268
- },
269
- },
270
- ],
271
- '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', ignoreRestSiblings: true }], // allow unused vars in object destructuring
272
- '@typescript-eslint/no-use-before-define': 'off', // abstract code should appear first
273
- '@typescript-eslint/prefer-nullish-coalescing': ['error', { ignorePrimitives: true }], // allow || for string, number, bigint and boolean
274
- '@typescript-eslint/restrict-template-expressions': 'off', // Allow any values in template literals
275
- },
276
- },
277
- // cf. https://github.com/sweepline/eslint-plugin-unused-imports#usage
278
- {
279
- plugins: {
280
- 'unused-imports': eslintPluginUnusedImports,
281
- },
282
- rules: {
283
- '@typescript-eslint/no-unused-vars': 'off',
284
- 'unused-imports/no-unused-imports': 'error',
285
- 'unused-imports/no-unused-vars': [
286
- 'warn',
287
- {
288
- vars: 'all',
289
- varsIgnorePattern: '^_',
290
- args: 'after-used',
291
- argsIgnorePattern: '^_',
292
- },
293
- ],
294
- },
295
- },
296
- eslintConfigFlatGitignore(),
297
- // cf. https://github.com/prettier/eslint-config-prettier#installation
298
- eslintConfigPrettier,
299
- // -----------------------------------------------------------
300
-
301
- {
302
- // A default export is required in app and page files.
303
- // See also https://nextjs.org/docs/app/building-your-application/routing#file-conventions
304
- files: [
305
- 'src/app/**/{layout,page,loading,not-found,error,template,default}.tsx',
306
- 'src/app/global-error.tsx',
307
- 'src/pages/**/*.tsx',
308
- 'src/pages/api/**/*.ts',
309
- ],
310
- rules: {
311
- 'import-x/no-default-export': 'off',
312
- },
313
- },
314
- {
315
- // You can use brackets for dynamic routes.
316
- // cf. https://nextjs.org/docs/getting-started/project-structure
317
- files: ['src/pages/**/*.tsx', 'src/pages/api/**/*.ts'],
318
- rules: {
319
- 'unicorn/filename-case': [
320
- 'error',
321
- {
322
- case: 'kebabCase',
323
- ignore: [String.raw`^\[.+\]\.tsx?$`],
324
- },
325
- ],
326
- },
327
- },
328
- {
329
- // Request handlers must have the same name as the HTTP methods name (uppercase, e.g. `GET`).
330
- // https://nextjs.org/docs/app/api-reference/file-conventions/route
331
- files: ['src/app/api/**/route.ts'],
332
- rules: {
333
- '@typescript-eslint/naming-convention': [
334
- 'error',
335
- {
336
- selector: 'default',
337
- format: ['camelCase'],
338
- leadingUnderscore: 'allow',
339
- trailingUnderscore: 'allow',
340
- },
341
- {
342
- selector: 'parameter',
343
- format: ['camelCase'],
344
- leadingUnderscore: 'allow',
345
- },
346
- {
347
- selector: 'variable',
348
- format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
349
- // to use 'const ReactElem = () => { ... };'
350
- leadingUnderscore: 'allow',
351
- trailingUnderscore: 'allow',
352
- },
353
- {
354
- selector: 'typeLike',
355
- format: ['PascalCase'],
356
- },
357
- {
358
- selector: 'enumMember',
359
- format: ['PascalCase'],
360
- },
361
- {
362
- // allow any name when referring to import and property
363
- selector: ['import', 'property'],
364
- format: null,
365
- },
366
- {
367
- // allow any name in object destructuring of variable
368
- selector: 'variable',
369
- modifiers: ['destructured'],
370
- format: null,
371
- },
372
- {
373
- // allow any name in object destructuring of parameter
374
- selector: 'parameter',
375
- modifiers: ['destructured'],
376
- format: null,
377
- },
378
- {
379
- filter: '^(?:DELETE|GET|HEAD|OPTIONS|PATCH|POST|PUT)$',
380
- selector: 'function',
381
- modifiers: ['exported'],
382
- format: null,
383
- },
384
- ],
385
- },
386
- },
387
- ];
388
-
389
- export default config;