@foray1010/eslint-config 16.1.0 → 17.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/CHANGELOG.md CHANGED
@@ -3,6 +3,38 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [17.0.1](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@17.0.0...@foray1010/eslint-config@17.0.1) (2026-05-25)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **eslint-config:** allow import ts extensions
11
+
12
+ ## [17.0.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@16.1.0...@foray1010/eslint-config@17.0.0) (2026-05-17)
13
+
14
+ ### ⚠ BREAKING CHANGES
15
+
16
+ - drop node v20 and v25
17
+ - **deps:** require typescript `^6.0.3`
18
+ - **eslint-config:** require eslint `^10.3.0`
19
+
20
+ ### Features
21
+
22
+ - **eslint-config:** encourage to use named parameters
23
+ - **eslint-config:** require eslint `^10.3.0`
24
+ - **eslint-config:** update eslint-plugin-unicorn to v64 (major)
25
+ - support es2024
26
+
27
+ ### Bug Fixes
28
+
29
+ - **eslint-config:** update eslint-plugin-compat to v7 (major)
30
+ - **eslint-config:** update eslint-plugin-n to v18 (major)
31
+ - **eslint-config:** update eslint-plugin-simple-import-sort to v13 (major)
32
+
33
+ ### Miscellaneous Chores
34
+
35
+ - **deps:** require typescript `^6.0.3`
36
+ - drop node v20 and v25
37
+
6
38
  ## [16.1.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@16.0.1...@foray1010/eslint-config@16.1.0) (2026-01-24)
7
39
 
8
40
  ### Features
package/README.md CHANGED
@@ -21,86 +21,85 @@ Z for looser rules
21
21
  1. `yarn add -DE @foray1010/eslint-config eslint prettier`
22
22
 
23
23
  2. Create an `eslint.config.js` in the project root
24
-
25
- - For general purpose or Node.js project (support TypeScript)
26
-
27
- ```js
28
- import {
29
- eslintIgnoresConfig,
30
- eslintNodeConfig,
31
- } from '@foray1010/eslint-config'
32
- import { defineConfig } from 'eslint/config'
33
-
34
- const config = defineConfig(eslintIgnoresConfig, eslintNodeConfig)
35
- export default config
36
- ```
37
-
38
- - For general frontend projects (support TypeScript)
39
-
40
- ```js
41
- import {
42
- eslintIgnoresConfig,
43
- eslintBrowserConfig,
44
- } from '@foray1010/eslint-config'
45
- import { defineConfig } from 'eslint/config'
46
-
47
- const config = defineConfig(eslintIgnoresConfig, eslintBrowserConfig)
48
- export default config
49
- ```
50
-
51
- - For frontend React projects (support TypeScript)
52
-
53
- ```js
54
- import {
55
- eslintIgnoresConfig,
56
- eslintReactConfig,
57
- } from '@foray1010/eslint-config'
58
- import { defineConfig } from 'eslint/config'
59
-
60
- const config = defineConfig(eslintIgnoresConfig, eslintReactConfig)
61
- export default config
62
- ```
63
-
64
- - You can apply config per different directories
65
-
66
- ```js
67
- import {
68
- eslintIgnoresConfig,
69
- eslintNodeConfig,
70
- eslintReactConfig,
71
- } from '@foray1010/eslint-config'
72
- import { defineConfig } from 'eslint/config'
73
-
74
- const config = defineConfig(
75
- eslintIgnoresConfig,
76
- {
77
- ignores: ['src/**'],
78
- extends: [eslintNodeConfig],
79
- },
80
- {
81
- files: ['src/**'],
82
- extends: [eslintReactConfig],
83
- },
84
- )
85
- export default config
86
- ```
24
+ - For general purpose or Node.js project (support TypeScript)
25
+
26
+ ```js
27
+ import {
28
+ eslintIgnoresConfig,
29
+ eslintNodeConfig,
30
+ } from '@foray1010/eslint-config'
31
+ import { defineConfig } from 'eslint/config'
32
+
33
+ const config = defineConfig(eslintIgnoresConfig, eslintNodeConfig)
34
+ export default config
35
+ ```
36
+
37
+ - For general frontend projects (support TypeScript)
38
+
39
+ ```js
40
+ import {
41
+ eslintIgnoresConfig,
42
+ eslintBrowserConfig,
43
+ } from '@foray1010/eslint-config'
44
+ import { defineConfig } from 'eslint/config'
45
+
46
+ const config = defineConfig(eslintIgnoresConfig, eslintBrowserConfig)
47
+ export default config
48
+ ```
49
+
50
+ - For frontend React projects (support TypeScript)
51
+
52
+ ```js
53
+ import {
54
+ eslintIgnoresConfig,
55
+ eslintReactConfig,
56
+ } from '@foray1010/eslint-config'
57
+ import { defineConfig } from 'eslint/config'
58
+
59
+ const config = defineConfig(eslintIgnoresConfig, eslintReactConfig)
60
+ export default config
61
+ ```
62
+
63
+ - You can apply config per different directories
64
+
65
+ ```js
66
+ import {
67
+ eslintIgnoresConfig,
68
+ eslintNodeConfig,
69
+ eslintReactConfig,
70
+ } from '@foray1010/eslint-config'
71
+ import { defineConfig } from 'eslint/config'
72
+
73
+ const config = defineConfig(
74
+ eslintIgnoresConfig,
75
+ {
76
+ ignores: ['src/**'],
77
+ extends: [eslintNodeConfig],
78
+ },
79
+ {
80
+ files: ['src/**'],
81
+ extends: [eslintReactConfig],
82
+ },
83
+ )
84
+ export default config
85
+ ```
87
86
 
88
87
  3. If the project support ES Modules, you can directly use `eslint` command with the following setting in `package.json`.
89
88
 
90
- ```json
91
- {
92
- "type": "module"
93
- }
94
- ```
89
+ ```json
90
+ {
91
+ "type": "module"
92
+ }
93
+ ```
95
94
 
96
95
  4. If the project does not support ES Modules, you have to put the config in `eslint.config.mjs` instead, and use the following npm script in `package.json`. Note that your editor may not support custom eslint config path and may not work properly.
97
96
 
98
- ```json
99
- {
100
- "scripts": {
101
- "eslint": "ESLINT_USE_FLAT_CONFIG=true eslint --config eslint.config.mjs"
102
- }
103
- }
104
- ```
97
+ ```json
98
+ {
99
+ "scripts": {
100
+ "eslint": "ESLINT_USE_FLAT_CONFIG=true eslint --config eslint.config.mjs"
101
+ }
102
+ }
103
+ ```
105
104
 
106
- then use `npm run eslint` or `yarn eslint` to replace `eslint`
105
+ then use `npm run eslint` or `yarn eslint` to replace `eslint`
package/bases/base.mjs CHANGED
@@ -2,6 +2,7 @@
2
2
  import js from '@eslint/js'
3
3
  import eslintPluginEslintCommentsConfigs from '@eslint-community/eslint-plugin-eslint-comments/configs'
4
4
  import { hasDep, isESM } from '@foray1010/common-presets-utils'
5
+ import eslintPluginFoxglove from '@foxglove/eslint-plugin'
5
6
  import { defineConfig } from 'eslint/config'
6
7
  import eslintPluginImportX from 'eslint-plugin-import-x'
7
8
  import eslintPluginJest from 'eslint-plugin-jest'
@@ -31,6 +32,9 @@ async function generateTypeScriptConfig() {
31
32
  eslintPluginImportX.configs['typescript'],
32
33
  esmConfig,
33
34
  ],
35
+ plugins: {
36
+ '@foxglove': eslintPluginFoxglove,
37
+ },
34
38
  languageOptions: {
35
39
  parserOptions: {
36
40
  // faster linting on cli
@@ -41,6 +45,8 @@ async function generateTypeScriptConfig() {
41
45
  },
42
46
  },
43
47
  rules: {
48
+ // promote named parameters by disallowing boolean parameters (boolean trap)
49
+ '@foxglove/no-boolean-parameters': 'error',
44
50
  // separate type exports which allow certain optimizations within compilers
45
51
  '@typescript-eslint/consistent-type-exports': [
46
52
  'error',
@@ -195,15 +201,6 @@ const baseConfig = defineConfig(
195
201
  'error',
196
202
  // https://nodejs.org/docs/latest-v14.x/api/esm.html#esm_mandatory_file_extensions
197
203
  'always',
198
- {
199
- pattern: {
200
- // eslint-plugin-import does not support checking es modules in typescript files
201
- cts: 'never',
202
- mts: 'never',
203
- ts: 'never',
204
- tsx: 'never',
205
- },
206
- },
207
204
  ],
208
205
  // make sure import statements above the others
209
206
  'import-x/first': 'error',
@@ -305,9 +302,9 @@ const baseConfig = defineConfig(
305
302
  reportUnusedInlineConfigs: 'error',
306
303
  },
307
304
  languageOptions: {
308
- ecmaVersion: 2023,
305
+ ecmaVersion: 2024,
309
306
  globals: {
310
- ...globals.es2023,
307
+ ...globals.es2024,
311
308
  /* Not using `node` to explicitly import node.js only built-in modules, e.g.
312
309
  * import { Buffer } from 'node:buffer'
313
310
  * import process from 'node:process'
@@ -318,6 +315,8 @@ const baseConfig = defineConfig(
318
315
  rules: {
319
316
  // always use named function for easier to debug via stack trace
320
317
  'func-names': ['error', 'as-needed'],
318
+ // promote named parameters by limiting function parameters
319
+ 'max-params': ['error', { max: 3, countThis: 'never' }],
321
320
  // prefer explicitly convert type for readability
322
321
  'no-implicit-coercion': 'error',
323
322
  // make sure private class members are in-use
package/constants.mjs CHANGED
@@ -1,4 +1,3 @@
1
- export const supportedFilesGlob = '**/*.{cjs,cts,js,mjs,mts,ts,tsx}'
2
1
  export const testFileGlobs = [
3
2
  '**/__fixtures__/**/*.{cjs,cts,js,mjs,mts,ts,tsx}',
4
3
  '**/__mocks__/**/*.{cjs,cts,js,mjs,mts,ts,tsx}',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@foray1010/eslint-config",
4
- "version": "16.1.0",
4
+ "version": "17.0.1",
5
5
  "homepage": "https://github.com/foray1010/common-presets/tree/master/packages/eslint-config#readme",
6
6
  "bugs": "https://github.com/foray1010/common-presets/issues",
7
7
  "repository": {
@@ -20,36 +20,37 @@
20
20
  "type:check": "tsc"
21
21
  },
22
22
  "dependencies": {
23
- "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
24
- "@eslint/js": "^9.38.0",
25
- "@foray1010/common-presets-utils": "^9.0.0",
23
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
24
+ "@eslint/js": "^10.0.1",
25
+ "@foray1010/common-presets-utils": "^10.0.0",
26
+ "@foxglove/eslint-plugin": "^2.1.2",
26
27
  "confusing-browser-globals": "^1.0.11",
27
28
  "eslint-config-prettier": "^10.1.8",
28
29
  "eslint-import-resolver-typescript": "^4.4.4",
29
- "eslint-plugin-compat": "^6.0.2",
30
- "eslint-plugin-import-x": "^4.16.1",
31
- "eslint-plugin-jest": "^29.0.1",
30
+ "eslint-plugin-compat": "^7.0.2",
31
+ "eslint-plugin-import-x": "^4.16.2",
32
+ "eslint-plugin-jest": "^29.15.2",
32
33
  "eslint-plugin-jest-dom": "^5.5.0",
33
34
  "eslint-plugin-jsx-a11y": "^6.10.2",
34
- "eslint-plugin-n": "^17.23.1",
35
- "eslint-plugin-prettier": "^5.5.4",
35
+ "eslint-plugin-n": "^18.0.1",
36
+ "eslint-plugin-prettier": "^5.5.5",
36
37
  "eslint-plugin-react": "^7.37.5",
37
- "eslint-plugin-react-hooks": "^7.0.1",
38
- "eslint-plugin-regexp": "^3.0.0",
39
- "eslint-plugin-simple-import-sort": "^12.1.1",
40
- "eslint-plugin-testing-library": "^7.13.3",
41
- "eslint-plugin-unicorn": "^62.0.0",
42
- "globals": "^17.1.0",
43
- "typescript-eslint": "^8.46.2"
38
+ "eslint-plugin-react-hooks": "^7.1.1",
39
+ "eslint-plugin-regexp": "^3.1.0",
40
+ "eslint-plugin-simple-import-sort": "^13.0.0",
41
+ "eslint-plugin-testing-library": "^7.16.2",
42
+ "eslint-plugin-unicorn": "^64.0.0",
43
+ "globals": "^17.6.0",
44
+ "typescript-eslint": "^8.59.2"
44
45
  },
45
46
  "devDependencies": {
46
47
  "@types/confusing-browser-globals": "1.0.3"
47
48
  },
48
49
  "peerDependencies": {
49
50
  "@testing-library/dom": "^10.4.1",
50
- "eslint": "^9.38.0",
51
+ "eslint": "^10.3.0",
51
52
  "prettier": "^3.6.2",
52
- "typescript": "^5.9.3"
53
+ "typescript": "^6.0.3"
53
54
  },
54
55
  "peerDependenciesMeta": {
55
56
  "@testing-library/dom": {
@@ -60,10 +61,10 @@
60
61
  }
61
62
  },
62
63
  "engines": {
63
- "node": "^20.19.0 || ^22.12.0 || >=24.11.0"
64
+ "node": "^22.12.0 || ^24.11.0 || >=26"
64
65
  },
65
66
  "publishConfig": {
66
67
  "access": "public"
67
68
  },
68
- "gitHead": "b7ba7d52368d2b0f77712639ffd3ed2a37b31d23"
69
+ "gitHead": "1176be02469801226d77eb47558df78176583735"
69
70
  }
package/tsconfig.json CHANGED
@@ -3,6 +3,7 @@
3
3
  "extends": "@foray1010/tsconfig/tsconfig.base.json",
4
4
  "compilerOptions": {
5
5
  "allowJs": true,
6
- "checkJs": true
7
- }
6
+ "checkJs": true,
7
+ "types": ["node"],
8
+ },
8
9
  }