@w5s/eslint-config 1.0.0-alpha.48 → 1.0.0-alpha.49
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/index.js +5 -5
- package/lib/es/base.js +2 -0
- package/lib/es/import.js +11 -0
- package/package.json +5 -5
- package/src/es/base.ts +2 -0
- package/src/es/import.ts +11 -0
package/index.js
CHANGED
|
@@ -14,21 +14,21 @@ function tryResolve(name) {
|
|
|
14
14
|
/**
|
|
15
15
|
* @template T
|
|
16
16
|
* @param {boolean} condition
|
|
17
|
-
* @param {T}
|
|
17
|
+
* @param {() => T} getValue
|
|
18
18
|
*/
|
|
19
|
-
function includeIf(condition,
|
|
20
|
-
return condition ? [
|
|
19
|
+
function includeIf(condition, getValue) {
|
|
20
|
+
return condition ? [getValue()] : [];
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
module.exports = {
|
|
24
24
|
extends: [
|
|
25
25
|
require.resolve('./ignore.js'),
|
|
26
26
|
require.resolve('./es.js'),
|
|
27
|
-
...includeIf(tryResolve('typescript'), require.resolve('./ts.js')),
|
|
27
|
+
...includeIf(tryResolve('typescript'), () => require.resolve('./ts.js')),
|
|
28
28
|
require.resolve('./json.js'),
|
|
29
29
|
require.resolve('./yml.js'),
|
|
30
30
|
require.resolve('./jest.js'),
|
|
31
|
-
...includeIf(tryResolve('react'), require.resolve('./react.js')),
|
|
31
|
+
...includeIf(tryResolve('react'), () => require.resolve('./react.js')),
|
|
32
32
|
],
|
|
33
33
|
root: true,
|
|
34
34
|
};
|
package/lib/es/base.js
CHANGED
|
@@ -61,6 +61,8 @@ const config = dev_1.ESLintConfig.concat(baseConfig,
|
|
|
61
61
|
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
62
62
|
// Allow in some cases https://github.com/airbnb/javascript/issues/1089#issuecomment-1024351821
|
|
63
63
|
'no-use-before-define': ['error', 'nofunc'],
|
|
64
|
+
// Allow statements, to be compatible with '@typescript-eslint/no-floating-promises' fix
|
|
65
|
+
'no-void': ['error', { allowAsStatement: true }],
|
|
64
66
|
},
|
|
65
67
|
});
|
|
66
68
|
module.exports = config;
|
package/lib/es/import.js
CHANGED
|
@@ -23,6 +23,17 @@ imports_1.default,
|
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
'import/no-deprecated': 'off',
|
|
26
|
+
'import/no-extraneous-dependencies': [
|
|
27
|
+
'error',
|
|
28
|
+
{
|
|
29
|
+
...imports_1.default.rules['import/no-extraneous-dependencies'][1],
|
|
30
|
+
devDependencies: [
|
|
31
|
+
...imports_1.default.rules['import/no-extraneous-dependencies'][1].devDependencies,
|
|
32
|
+
'**/*.config.[jt]s?(x)',
|
|
33
|
+
'**/*.config.cjs',
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
],
|
|
26
37
|
'import/no-named-as-default': 'off',
|
|
27
38
|
'import/no-unused-modules': 'off',
|
|
28
39
|
'import/prefer-default-export': 'off',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/eslint-config",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.49",
|
|
4
4
|
"description": "ESLint configuration presets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@rushstack/eslint-patch": "^1.1.0",
|
|
60
60
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
61
61
|
"@typescript-eslint/parser": "^5.0.0",
|
|
62
|
-
"@w5s/dev": "^1.0.0-alpha.
|
|
62
|
+
"@w5s/dev": "^1.0.0-alpha.4",
|
|
63
63
|
"@w5s/prettier-config": "^1.0.8",
|
|
64
64
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
65
65
|
"eslint-config-prettier": "^8.0.0",
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@types/eslint": "8.4.10",
|
|
82
82
|
"@types/eslint-plugin-prettier": "3.1.0",
|
|
83
|
-
"@types/jest": "29.
|
|
83
|
+
"@types/jest": "29.4.0",
|
|
84
84
|
"@types/parse-gitignore": "1.0.0",
|
|
85
85
|
"@types/prettier": "2.7.2",
|
|
86
86
|
"@types/react": "18.0.27",
|
|
87
|
-
"@typescript-eslint/parser": "5.
|
|
87
|
+
"@typescript-eslint/parser": "5.49.0",
|
|
88
88
|
"eslint": "8.32.0",
|
|
89
89
|
"eslint-config-prettier": "8.6.0",
|
|
90
90
|
"eslint-find-rules": "4.1.0",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"publishConfig": {
|
|
110
110
|
"access": "public"
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "dd093c2907cf8e136f4adec9a14b176e0851de17"
|
|
113
113
|
}
|
package/src/es/base.ts
CHANGED
|
@@ -71,6 +71,8 @@ const config: eslint.Linter.Config = ESLintConfig.concat(
|
|
|
71
71
|
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
72
72
|
// Allow in some cases https://github.com/airbnb/javascript/issues/1089#issuecomment-1024351821
|
|
73
73
|
'no-use-before-define': ['error', 'nofunc'],
|
|
74
|
+
// Allow statements, to be compatible with '@typescript-eslint/no-floating-promises' fix
|
|
75
|
+
'no-void': ['error', { allowAsStatement: true }],
|
|
74
76
|
},
|
|
75
77
|
}
|
|
76
78
|
);
|
package/src/es/import.ts
CHANGED
|
@@ -22,6 +22,17 @@ const config: eslint.Linter.Config = ESLintConfig.concat(
|
|
|
22
22
|
},
|
|
23
23
|
],
|
|
24
24
|
'import/no-deprecated': 'off', // Performance issues
|
|
25
|
+
'import/no-extraneous-dependencies': [
|
|
26
|
+
'error',
|
|
27
|
+
{
|
|
28
|
+
...importConfig.rules['import/no-extraneous-dependencies'][1],
|
|
29
|
+
devDependencies: [
|
|
30
|
+
...importConfig.rules['import/no-extraneous-dependencies'][1].devDependencies,
|
|
31
|
+
'**/*.config.[jt]s?(x)',
|
|
32
|
+
'**/*.config.cjs',
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
],
|
|
25
36
|
'import/no-named-as-default': 'off', // Performance issues
|
|
26
37
|
'import/no-unused-modules': 'off', // Performance issues
|
|
27
38
|
'import/prefer-default-export': 'off', // Not aligned, default export does not bring sufficient semantic
|