@w5s/eslint-config 3.33.0 → 3.35.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/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -18
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/config/es.ts +4 -4
- package/src/config/imports.ts +4 -4
- package/src/config/jsx.ts +1 -1
- package/src/config/react.ts +1 -1
- package/src/config/ts.ts +4 -6
- package/src/config/unicorn.ts +1 -1
- package/src/config/yml.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.35.0",
|
|
4
4
|
"description": "ESLint configuration presets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@e18e/eslint-plugin": "^0.8.0",
|
|
41
|
-
"@eslint-react/eslint-plugin": "5.18.
|
|
41
|
+
"@eslint-react/eslint-plugin": "5.18.6",
|
|
42
42
|
"@eslint/js": "^10.0.0",
|
|
43
43
|
"@eslint/markdown": "^8.0.0",
|
|
44
44
|
"@next/eslint-plugin-next": "^16.0.0",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
47
47
|
"@typescript-eslint/parser": "^8.0.0",
|
|
48
48
|
"@vitest/eslint-plugin": "~1.6.20",
|
|
49
|
-
"@w5s/dev": "^3.
|
|
50
|
-
"@w5s/eslint-config-ignore": "^1.
|
|
51
|
-
"@w5s/prettier-config": "^3.
|
|
49
|
+
"@w5s/dev": "^3.26.0",
|
|
50
|
+
"@w5s/eslint-config-ignore": "^1.25.0",
|
|
51
|
+
"@w5s/prettier-config": "^3.20.0",
|
|
52
52
|
"eslint-merge-processors": "^2.0.0",
|
|
53
53
|
"eslint-plugin-import": "~2.32.0",
|
|
54
54
|
"eslint-plugin-jsdoc": "~64.1.0",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "de5aba704f6744ba64973b010a848d2b2150341d"
|
|
89
89
|
}
|
package/src/config/es.ts
CHANGED
|
@@ -76,7 +76,7 @@ export async function es(options: es.Options) {
|
|
|
76
76
|
files: defaultFiles,
|
|
77
77
|
name: 'w5s/es/rules',
|
|
78
78
|
rules: {
|
|
79
|
-
...(recommended ? es
|
|
79
|
+
...(recommended ? es.recommended : {}),
|
|
80
80
|
...rules,
|
|
81
81
|
},
|
|
82
82
|
},
|
|
@@ -86,7 +86,7 @@ export async function es(options: es.Options) {
|
|
|
86
86
|
/**
|
|
87
87
|
* Recommended rules
|
|
88
88
|
*/
|
|
89
|
-
es
|
|
89
|
+
es.recommended = {
|
|
90
90
|
...eslintConfig.configs.recommended.rules,
|
|
91
91
|
...esRules(),
|
|
92
92
|
};
|
|
@@ -102,7 +102,7 @@ export namespace es {
|
|
|
102
102
|
*
|
|
103
103
|
* @internal
|
|
104
104
|
*/
|
|
105
|
-
defaultRestrictedGlobals?: RestrictedGlobals | undefined;
|
|
105
|
+
defaultRestrictedGlobals?: Readonly<RestrictedGlobals> | undefined;
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
108
|
* The default restricted import paths (used by restrictedImportPaths).
|
|
@@ -113,7 +113,7 @@ export namespace es {
|
|
|
113
113
|
*
|
|
114
114
|
* @internal
|
|
115
115
|
*/
|
|
116
|
-
defaultRestrictedImportPaths?: RestrictedImportPaths | undefined;
|
|
116
|
+
defaultRestrictedImportPaths?: Readonly<RestrictedImportPaths> | undefined;
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* An array of restricted globals to override the default restricted globals.
|
package/src/config/imports.ts
CHANGED
|
@@ -18,9 +18,9 @@ export async function imports(options: imports.Options = {}) {
|
|
|
18
18
|
{
|
|
19
19
|
name: 'w5s/import/rules',
|
|
20
20
|
rules: {
|
|
21
|
-
...(recommended ? imports
|
|
21
|
+
...(recommended ? imports.recommended : {}),
|
|
22
22
|
...(stylisticEnabled
|
|
23
|
-
? imports
|
|
23
|
+
? imports.stylistic
|
|
24
24
|
: {}),
|
|
25
25
|
...rules,
|
|
26
26
|
},
|
|
@@ -31,7 +31,7 @@ export async function imports(options: imports.Options = {}) {
|
|
|
31
31
|
/**
|
|
32
32
|
* Recommended rules
|
|
33
33
|
*/
|
|
34
|
-
imports
|
|
34
|
+
imports.recommended = {
|
|
35
35
|
// 'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
|
|
36
36
|
'import/first': 'error',
|
|
37
37
|
'import/no-duplicates': 'error',
|
|
@@ -42,7 +42,7 @@ imports['recommended'] = {
|
|
|
42
42
|
/**
|
|
43
43
|
* Stylistic rules
|
|
44
44
|
*/
|
|
45
|
-
imports
|
|
45
|
+
imports.stylistic = {
|
|
46
46
|
'import/newline-after-import': ['error', { count: 1 }],
|
|
47
47
|
};
|
|
48
48
|
|
package/src/config/jsx.ts
CHANGED
|
@@ -33,7 +33,7 @@ export async function jsx(options: jsx.Options = {}) {
|
|
|
33
33
|
files: withDefaultFiles(files, defaultFiles),
|
|
34
34
|
name: 'w5s/jsx/rules',
|
|
35
35
|
rules: {
|
|
36
|
-
...(recommended && jsxA11yPlugin != null ? jsxA11yPlugin.configs
|
|
36
|
+
...(recommended && jsxA11yPlugin != null ? jsxA11yPlugin.configs.recommended.rules : {}),
|
|
37
37
|
...rules,
|
|
38
38
|
},
|
|
39
39
|
},
|
package/src/config/react.ts
CHANGED
|
@@ -33,7 +33,7 @@ export async function react(options: react.Options = {}) {
|
|
|
33
33
|
name: 'w5s/react/rules',
|
|
34
34
|
rules: {
|
|
35
35
|
// eslint-disable-next-line ts/no-non-null-assertion
|
|
36
|
-
...(recommended ? ESLintConfig.renameRules(reactPlugin.configs
|
|
36
|
+
...(recommended ? ESLintConfig.renameRules(reactPlugin.configs.recommended.rules!, { '@eslint-react': 'react' }) : {}),
|
|
37
37
|
...rules,
|
|
38
38
|
},
|
|
39
39
|
},
|
package/src/config/ts.ts
CHANGED
|
@@ -18,9 +18,6 @@ export async function ts(options: ts.Options = {}) {
|
|
|
18
18
|
interopDefault(import('@typescript-eslint/eslint-plugin')),
|
|
19
19
|
interopDefault(import('@typescript-eslint/parser')),
|
|
20
20
|
] as const);
|
|
21
|
-
const tsRecommendedRules = tsPlugin.configs['eslint-recommended']!.overrides![0]!.rules!;
|
|
22
|
-
const tsStrictRules = tsPlugin.configs['strict']!.rules!;
|
|
23
|
-
const tsTypeCheckedRules = tsPlugin.configs['recommended-type-checked-only']!.rules!;
|
|
24
21
|
const {
|
|
25
22
|
files,
|
|
26
23
|
parserOptions = {},
|
|
@@ -62,14 +59,15 @@ export async function ts(options: ts.Options = {}) {
|
|
|
62
59
|
},
|
|
63
60
|
name: 'w5s/ts/rules',
|
|
64
61
|
rules: {
|
|
65
|
-
...(recommended ? ESLintConfig.renameRules(
|
|
66
|
-
...(recommended ? ESLintConfig.renameRules(
|
|
67
|
-
...(recommended && typeChecked ? ESLintConfig.renameRules(
|
|
62
|
+
...(recommended ? ESLintConfig.renameRules(tsPlugin.configs['eslint-recommended']!.overrides![0]!.rules!, tsRenameMap) : {}),
|
|
63
|
+
...(recommended ? ESLintConfig.renameRules(tsPlugin.configs['strict']!.rules!, tsRenameMap) : {}),
|
|
64
|
+
...(recommended && typeChecked ? ESLintConfig.renameRules(tsPlugin.configs['recommended-type-checked-only']!.rules!, tsRenameMap) : {}),
|
|
68
65
|
...(recommended ? tsCustomRules : {}),
|
|
69
66
|
...(stylisticEnabled
|
|
70
67
|
? {
|
|
71
68
|
// eslint-disable-next-line ts/no-non-null-asserted-optional-chain
|
|
72
69
|
...ESLintConfig.renameRules(tsPlugin.configs['stylistic']?.rules!, tsRenameMap),
|
|
70
|
+
...(typeChecked ? ESLintConfig.renameRules(tsPlugin.configs['stylistic-type-checked-only']!.rules!, tsRenameMap) : {}),
|
|
73
71
|
'ts/array-type': ['error', { default: 'generic' }],
|
|
74
72
|
'ts/consistent-type-assertions': [
|
|
75
73
|
'error',
|
package/src/config/unicorn.ts
CHANGED
|
@@ -24,7 +24,7 @@ export async function unicorn(options: unicorn.Options = {}) {
|
|
|
24
24
|
files: withDefaultFiles(files, defaultFiles),
|
|
25
25
|
name: 'w5s/unicorn/rules',
|
|
26
26
|
rules: {
|
|
27
|
-
...(recommended && unicornPlugin.configs
|
|
27
|
+
...(recommended && unicornPlugin.configs.unopinionated.rules),
|
|
28
28
|
// Disabled for safety
|
|
29
29
|
'unicorn/new-for-builtins': 'off', // error, @see https://github.com/sindresorhus/eslint-plugin-unicorn/issues/122
|
|
30
30
|
'unicorn/no-array-method-this-argument': 'off', // Many false positive reported
|
package/src/config/yml.ts
CHANGED
|
@@ -26,7 +26,7 @@ export async function yml(options: yml.Options = {}) {
|
|
|
26
26
|
name: 'w5s/yml/rules',
|
|
27
27
|
rules: {
|
|
28
28
|
...(recommended
|
|
29
|
-
? ymlPlugin.configs
|
|
29
|
+
? ymlPlugin.configs.recommended.reduce(
|
|
30
30
|
(acc, config) => ({ ...acc, ...config.rules }),
|
|
31
31
|
|
|
32
32
|
{} as RuleOptions,
|