@foray1010/eslint-config 11.0.3 → 12.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 +20 -0
- package/bases/base.mjs +14 -9
- package/package.json +26 -24
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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
|
+
## [12.0.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@11.0.3...@foray1010/eslint-config@12.0.0) (2023-11-17)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
- **deps:** require eslint `^8.52.0`
|
|
11
|
+
- require node `^18.12.0 || >=20.9.0`
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- **eslint-config:** lint regexp ([65fa4ec](https://github.com/foray1010/common-presets/commit/65fa4ec480d1e4569ce2ace9a9a35fcd752f9234))
|
|
16
|
+
- support es2023 ([0993c39](https://github.com/foray1010/common-presets/commit/0993c39c8a2f011b3f18e7796d69c54fc51b8eda))
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
- **deps:** update dependency eslint-plugin-unicorn to v49 ([9501170](https://github.com/foray1010/common-presets/commit/9501170f2099029b64c1d9092b7342a0981d2d32))
|
|
21
|
+
|
|
22
|
+
### Miscellaneous Chores
|
|
23
|
+
|
|
24
|
+
- require node `^18.12.0 || >=20.9.0` ([e231508](https://github.com/foray1010/common-presets/commit/e231508673cefd6e4792083e4f15fd152446e32d))
|
|
25
|
+
|
|
6
26
|
## [11.0.3](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@11.0.2...@foray1010/eslint-config@11.0.3) (2023-10-01)
|
|
7
27
|
|
|
8
28
|
### Bug Fixes
|
package/bases/base.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import eslintPluginEslintComments from '@eslint-community/eslint-plugin-eslint-c
|
|
|
4
4
|
import { hasDep, isESM } from '@foray1010/common-presets-utils'
|
|
5
5
|
import eslintPluginImport from 'eslint-plugin-import'
|
|
6
6
|
import eslintPluginJest from 'eslint-plugin-jest'
|
|
7
|
+
import eslintPluginRegexp from 'eslint-plugin-regexp'
|
|
7
8
|
import eslintPluginSimpleImportSort from 'eslint-plugin-simple-import-sort'
|
|
8
9
|
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
|
|
9
10
|
import globals from 'globals'
|
|
@@ -37,7 +38,7 @@ async function generateTypeScriptConfig() {
|
|
|
37
38
|
{
|
|
38
39
|
files: typeScriptFileGlobs,
|
|
39
40
|
languageOptions: {
|
|
40
|
-
|
|
41
|
+
// @ts-expect-error
|
|
41
42
|
parser: typescriptEslintParser,
|
|
42
43
|
parserOptions: {
|
|
43
44
|
// faster linting on cli
|
|
@@ -53,6 +54,7 @@ async function generateTypeScriptConfig() {
|
|
|
53
54
|
},
|
|
54
55
|
},
|
|
55
56
|
plugins: {
|
|
57
|
+
// @ts-expect-error
|
|
56
58
|
'@typescript-eslint': eslintPluginTypescriptEslint,
|
|
57
59
|
// @ts-expect-error
|
|
58
60
|
deprecation: eslintPluginDeprecation,
|
|
@@ -183,9 +185,9 @@ async function generateTypeScriptConfig() {
|
|
|
183
185
|
// reduce the difficult to use this rule
|
|
184
186
|
ignoreInferredTypes: true,
|
|
185
187
|
// escape hatch without using eslint-disable
|
|
186
|
-
ignoreNamePattern:
|
|
188
|
+
ignoreNamePattern: /Mutable$/.source,
|
|
187
189
|
ignoreTypePattern: [
|
|
188
|
-
|
|
190
|
+
/^React\./.source, // Some React types does not work with `Readonly`
|
|
189
191
|
],
|
|
190
192
|
},
|
|
191
193
|
],
|
|
@@ -203,12 +205,12 @@ async function generateTypeScriptConfig() {
|
|
|
203
205
|
// modified from https://github.com/eslint-functional/eslint-plugin-functional/blob/main/docs/rules/type-declaration-immutability.md#preset-overrides
|
|
204
206
|
fixer: [
|
|
205
207
|
{
|
|
206
|
-
pattern:
|
|
207
|
-
replace:
|
|
208
|
+
pattern: /^(Array|Map|Set)<(.+)>$/.source,
|
|
209
|
+
replace: /Readonly\$1<\$2>/.source,
|
|
208
210
|
},
|
|
209
211
|
{
|
|
210
|
-
pattern:
|
|
211
|
-
replace:
|
|
212
|
+
pattern: /^(.+)$/.source,
|
|
213
|
+
replace: /Readonly<\$1>/.source,
|
|
212
214
|
},
|
|
213
215
|
],
|
|
214
216
|
},
|
|
@@ -233,6 +235,7 @@ async function generateTypeScriptConfig() {
|
|
|
233
235
|
{
|
|
234
236
|
files: typeScriptTestFileGlobs,
|
|
235
237
|
plugins: {
|
|
238
|
+
// @ts-expect-error
|
|
236
239
|
'@typescript-eslint': eslintPluginTypescriptEslint,
|
|
237
240
|
jest: eslintPluginJest,
|
|
238
241
|
},
|
|
@@ -285,9 +288,9 @@ const baseConfig = [
|
|
|
285
288
|
js.configs.recommended,
|
|
286
289
|
{
|
|
287
290
|
languageOptions: {
|
|
288
|
-
ecmaVersion:
|
|
291
|
+
ecmaVersion: 2023,
|
|
289
292
|
globals: {
|
|
290
|
-
//
|
|
293
|
+
// No es2022/es2023 preset yet
|
|
291
294
|
...globals.es2021,
|
|
292
295
|
/* Not using `node` to explicitly import node.js only built-in modules, e.g.
|
|
293
296
|
* import { Buffer } from 'node:buffer'
|
|
@@ -299,11 +302,13 @@ const baseConfig = [
|
|
|
299
302
|
plugins: {
|
|
300
303
|
'@eslint-community/eslint-comments': eslintPluginEslintComments,
|
|
301
304
|
import: eslintPluginImport,
|
|
305
|
+
regexp: eslintPluginRegexp,
|
|
302
306
|
unicorn: eslintPluginUnicorn,
|
|
303
307
|
},
|
|
304
308
|
rules: {
|
|
305
309
|
...eslintPluginEslintComments.configs['recommended']?.rules,
|
|
306
310
|
...eslintPluginImport.configs['recommended']?.rules,
|
|
311
|
+
...eslintPluginRegexp.configs['recommended']?.rules,
|
|
307
312
|
...Object.fromEntries(
|
|
308
313
|
Object.entries(
|
|
309
314
|
eslintPluginUnicorn.configs['recommended']?.rules ?? {},
|
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": "
|
|
4
|
+
"version": "12.0.0",
|
|
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,38 @@
|
|
|
20
20
|
"type:check": "tsc"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
24
|
-
"@eslint/js": "^8.
|
|
25
|
-
"@foray1010/common-presets-utils": "^
|
|
26
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
27
|
-
"@typescript-eslint/parser": "^6.
|
|
28
|
-
"confusing-browser-globals": "^1.0.
|
|
23
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.1.0",
|
|
24
|
+
"@eslint/js": "^8.53.0",
|
|
25
|
+
"@foray1010/common-presets-utils": "^8.0.0",
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^6.11.0",
|
|
27
|
+
"@typescript-eslint/parser": "^6.11.0",
|
|
28
|
+
"confusing-browser-globals": "^1.0.11",
|
|
29
29
|
"eslint-config-prettier": "^9.0.0",
|
|
30
|
-
"eslint-import-resolver-typescript": "^3.
|
|
31
|
-
"eslint-plugin-compat": "^4.
|
|
30
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
31
|
+
"eslint-plugin-compat": "^4.2.0",
|
|
32
32
|
"eslint-plugin-deprecation": "^2.0.0",
|
|
33
33
|
"eslint-plugin-functional": "^6.0.0",
|
|
34
|
-
"eslint-plugin-import": "^2.
|
|
35
|
-
"eslint-plugin-jest": "^27.
|
|
36
|
-
"eslint-plugin-jest-dom": "^5.
|
|
37
|
-
"eslint-plugin-n": "^16.
|
|
38
|
-
"eslint-plugin-prettier": "^5.0.
|
|
39
|
-
"eslint-plugin-react": "^7.
|
|
40
|
-
"eslint-plugin-react-hooks": "^4.
|
|
34
|
+
"eslint-plugin-import": "^2.29.0",
|
|
35
|
+
"eslint-plugin-jest": "^27.6.0",
|
|
36
|
+
"eslint-plugin-jest-dom": "^5.1.0",
|
|
37
|
+
"eslint-plugin-n": "^16.3.1",
|
|
38
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
39
|
+
"eslint-plugin-react": "^7.33.2",
|
|
40
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
41
|
+
"eslint-plugin-regexp": "^2.1.1",
|
|
41
42
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
42
|
-
"eslint-plugin-testing-library": "^6.
|
|
43
|
-
"eslint-plugin-unicorn": "^
|
|
44
|
-
"globals": "^13.
|
|
43
|
+
"eslint-plugin-testing-library": "^6.1.2",
|
|
44
|
+
"eslint-plugin-unicorn": "^49.0.0",
|
|
45
|
+
"globals": "^13.23.0"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
|
-
"@types/confusing-browser-globals": "1.0.
|
|
48
|
-
"@types/eslint": "8.44.
|
|
48
|
+
"@types/confusing-browser-globals": "1.0.3",
|
|
49
|
+
"@types/eslint": "8.44.7",
|
|
50
|
+
"@types/eslint__js": "8.42.3"
|
|
49
51
|
},
|
|
50
52
|
"peerDependencies": {
|
|
51
53
|
"@testing-library/dom": "^9.0.0",
|
|
52
|
-
"eslint": "^8.
|
|
54
|
+
"eslint": "^8.52.0",
|
|
53
55
|
"prettier": "^3.0.0",
|
|
54
56
|
"typescript": "^5.0.2"
|
|
55
57
|
},
|
|
@@ -62,10 +64,10 @@
|
|
|
62
64
|
}
|
|
63
65
|
},
|
|
64
66
|
"engines": {
|
|
65
|
-
"node": "^
|
|
67
|
+
"node": "^18.12.0 || >=20.9.0"
|
|
66
68
|
},
|
|
67
69
|
"publishConfig": {
|
|
68
70
|
"access": "public"
|
|
69
71
|
},
|
|
70
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "45c8e63f5eebfb9caec22faaf5b961154b924f50"
|
|
71
73
|
}
|