@w0s/eslint-config 9.0.1 → 9.2.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/README.md +49 -49
- package/eslint.config.js +97 -98
- package/package.json +7 -7
- package/rules/eslint/possible-problems.js +3 -0
- package/rules/eslint/suggestions.js +148 -147
package/README.md
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
# eslint-config
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@w0s/eslint-config)
|
|
4
|
-
[](https://github.com/SaekiTominaga/w0s/actions/workflows/eslint.yml)
|
|
5
|
-
|
|
6
|
-
ESLint configuration file used on my personal website ([`w0s.jp`](https://github.com/SaekiTominaga/w0s.jp)).
|
|
7
|
-
|
|
8
|
-
## Base rules & plugins
|
|
9
|
-
|
|
10
|
-
### All files (Vanilla JavaScript, etc.)
|
|
11
|
-
|
|
12
|
-
- [eslint:recommended](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#using-eslintrecommended)
|
|
13
|
-
- [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import):recommended
|
|
14
|
-
- [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc):recommended
|
|
15
|
-
- [eslint-plugin-safely-storage](https://github.com/SaekiTominaga/eslint-plugin/tree/main/packages/safely-storage)
|
|
16
|
-
- and, some customizations
|
|
17
|
-
|
|
18
|
-
### TypeScript
|
|
19
|
-
|
|
20
|
-
- [@typescript-eslint/eslint-plugin:strict-type-checked](https://typescript-eslint.io/users/configs/#strict-type-checked)
|
|
21
|
-
- [@typescript-eslint/eslint-plugin:stylistic-type-checked](https://typescript-eslint.io/users/configs/#stylistic-type-checked)
|
|
22
|
-
- [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc/):recommended-typescript
|
|
23
|
-
- and, some customizations
|
|
24
|
-
|
|
25
|
-
## Usage
|
|
26
|
-
|
|
27
|
-
```javascript
|
|
28
|
-
import w0sConfig from '@w0s/eslint-config';
|
|
29
|
-
|
|
30
|
-
/** @type {import("eslint").Linter.Config[]} */
|
|
31
|
-
export default [
|
|
32
|
-
...w0sConfig,
|
|
33
|
-
{
|
|
34
|
-
// other options
|
|
35
|
-
},
|
|
36
|
-
];
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
or
|
|
40
|
-
|
|
41
|
-
```javascript
|
|
42
|
-
import { defineConfig } from 'eslint/config';
|
|
43
|
-
import w0sConfig from '@w0s/eslint-config';
|
|
44
|
-
|
|
45
|
-
/** @type {import("eslint").Linter.Config[]} */
|
|
46
|
-
export default defineConfig(w0sConfig, {
|
|
47
|
-
// other options
|
|
48
|
-
});
|
|
49
|
-
```
|
|
1
|
+
# eslint-config
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@w0s/eslint-config)
|
|
4
|
+
[](https://github.com/SaekiTominaga/w0s/actions/workflows/eslint.yml)
|
|
5
|
+
|
|
6
|
+
ESLint configuration file used on my personal website ([`w0s.jp`](https://github.com/SaekiTominaga/w0s.jp)).
|
|
7
|
+
|
|
8
|
+
## Base rules & plugins
|
|
9
|
+
|
|
10
|
+
### All files (Vanilla JavaScript, etc.)
|
|
11
|
+
|
|
12
|
+
- [eslint:recommended](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#using-eslintrecommended)
|
|
13
|
+
- [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import):recommended
|
|
14
|
+
- [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc):recommended
|
|
15
|
+
- [eslint-plugin-safely-storage](https://github.com/SaekiTominaga/eslint-plugin/tree/main/packages/safely-storage)
|
|
16
|
+
- and, some customizations
|
|
17
|
+
|
|
18
|
+
### TypeScript
|
|
19
|
+
|
|
20
|
+
- [@typescript-eslint/eslint-plugin:strict-type-checked](https://typescript-eslint.io/users/configs/#strict-type-checked)
|
|
21
|
+
- [@typescript-eslint/eslint-plugin:stylistic-type-checked](https://typescript-eslint.io/users/configs/#stylistic-type-checked)
|
|
22
|
+
- [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc/):recommended-typescript
|
|
23
|
+
- and, some customizations
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
import w0sConfig from '@w0s/eslint-config';
|
|
29
|
+
|
|
30
|
+
/** @type {import("eslint").Linter.Config[]} */
|
|
31
|
+
export default [
|
|
32
|
+
...w0sConfig,
|
|
33
|
+
{
|
|
34
|
+
// other options
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
or
|
|
40
|
+
|
|
41
|
+
```javascript
|
|
42
|
+
import { defineConfig } from 'eslint/config';
|
|
43
|
+
import w0sConfig from '@w0s/eslint-config';
|
|
44
|
+
|
|
45
|
+
/** @type {import("eslint").Linter.Config[]} */
|
|
46
|
+
export default defineConfig(w0sConfig, {
|
|
47
|
+
// other options
|
|
48
|
+
});
|
|
49
|
+
```
|
package/eslint.config.js
CHANGED
|
@@ -1,98 +1,97 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line import/no-unresolved
|
|
4
|
-
import { defineConfig } from 'eslint/config';
|
|
5
|
-
import pluginImport from 'eslint-plugin-import';
|
|
6
|
-
import { jsdoc as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
7
|
-
import pluginSafelyStorage from 'eslint-plugin-safely-storage';
|
|
8
|
-
import globals from 'globals';
|
|
9
|
-
// eslint-disable-next-line import/no-unresolved
|
|
10
|
-
import tseslint from 'typescript-eslint';
|
|
11
|
-
import eslint from '@eslint/js';
|
|
12
|
-
import configEslintLayoutFormatting from './rules/eslint/layout&formatting.js';
|
|
13
|
-
import configEslintPossibleProblems from './rules/eslint/possible-problems.js';
|
|
14
|
-
import configEslintSuggestions from './rules/eslint/suggestions.js';
|
|
15
|
-
import configImport from './rules/import.js';
|
|
16
|
-
import configJsdoc from './rules/jsdoc.js';
|
|
17
|
-
|
|
18
|
-
export default defineConfig(
|
|
19
|
-
eslint.configs.recommended,
|
|
20
|
-
configEslintPossibleProblems,
|
|
21
|
-
configEslintSuggestions,
|
|
22
|
-
configEslintLayoutFormatting,
|
|
23
|
-
|
|
24
|
-
/* Plugins */
|
|
25
|
-
pluginImport.flatConfigs.recommended,
|
|
26
|
-
configImport,
|
|
27
|
-
|
|
28
|
-
pluginJsdoc({ config: 'flat/recommended' }),
|
|
29
|
-
configJsdoc,
|
|
30
|
-
|
|
31
|
-
pluginSafelyStorage.configs.default,
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
files: ['**/*.js'],
|
|
35
|
-
languageOptions: {
|
|
36
|
-
ecmaVersion: 'latest', // デフォルト値は 'latest' だが明示的な指定が必要
|
|
37
|
-
globals: globals.nodeBuiltin,
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
files: ['**/*.ts'],
|
|
42
|
-
languageOptions: {
|
|
43
|
-
parserOptions: {
|
|
44
|
-
project: true,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
extends: [tseslint.configs.strictTypeChecked, tseslint.configs.stylisticTypeChecked, pluginJsdoc({ config: 'flat/recommended-typescript' })],
|
|
48
|
-
rules: {
|
|
49
|
-
'dot-notation': 'off',
|
|
50
|
-
'no-unused-vars': 'off',
|
|
51
|
-
'import/extensions': [
|
|
52
|
-
'error',
|
|
53
|
-
'ignorePackages',
|
|
54
|
-
{
|
|
55
|
-
js: 'never',
|
|
56
|
-
},
|
|
57
|
-
],
|
|
58
|
-
'import/no-unresolved': 'off',
|
|
59
|
-
'@typescript-eslint/no-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
'no-
|
|
87
|
-
'no-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
'@typescript-eslint/no-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
);
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line import/no-unresolved
|
|
4
|
+
import { defineConfig } from 'eslint/config';
|
|
5
|
+
import pluginImport from 'eslint-plugin-import';
|
|
6
|
+
import { jsdoc as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
7
|
+
import pluginSafelyStorage from 'eslint-plugin-safely-storage';
|
|
8
|
+
import globals from 'globals';
|
|
9
|
+
// eslint-disable-next-line import/no-unresolved
|
|
10
|
+
import tseslint from 'typescript-eslint';
|
|
11
|
+
import eslint from '@eslint/js';
|
|
12
|
+
import configEslintLayoutFormatting from './rules/eslint/layout&formatting.js';
|
|
13
|
+
import configEslintPossibleProblems from './rules/eslint/possible-problems.js';
|
|
14
|
+
import configEslintSuggestions from './rules/eslint/suggestions.js';
|
|
15
|
+
import configImport from './rules/import.js';
|
|
16
|
+
import configJsdoc from './rules/jsdoc.js';
|
|
17
|
+
|
|
18
|
+
export default defineConfig(
|
|
19
|
+
eslint.configs.recommended,
|
|
20
|
+
configEslintPossibleProblems,
|
|
21
|
+
configEslintSuggestions,
|
|
22
|
+
configEslintLayoutFormatting,
|
|
23
|
+
|
|
24
|
+
/* Plugins */
|
|
25
|
+
pluginImport.flatConfigs.recommended,
|
|
26
|
+
configImport,
|
|
27
|
+
|
|
28
|
+
pluginJsdoc({ config: 'flat/recommended' }),
|
|
29
|
+
configJsdoc,
|
|
30
|
+
|
|
31
|
+
pluginSafelyStorage.configs.default,
|
|
32
|
+
|
|
33
|
+
{
|
|
34
|
+
files: ['**/*.js'],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
ecmaVersion: 'latest', // デフォルト値は 'latest' だが明示的な指定が必要
|
|
37
|
+
globals: globals.nodeBuiltin,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
files: ['**/*.ts'],
|
|
42
|
+
languageOptions: {
|
|
43
|
+
parserOptions: {
|
|
44
|
+
project: true,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
extends: [tseslint.configs.strictTypeChecked, tseslint.configs.stylisticTypeChecked, pluginJsdoc({ config: 'flat/recommended-typescript' })],
|
|
48
|
+
rules: {
|
|
49
|
+
'dot-notation': 'off',
|
|
50
|
+
'no-unused-vars': 'off',
|
|
51
|
+
'import/extensions': [
|
|
52
|
+
'error',
|
|
53
|
+
'ignorePackages',
|
|
54
|
+
{
|
|
55
|
+
js: 'never',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
'import/no-unresolved': 'off',
|
|
59
|
+
'@typescript-eslint/no-unused-vars': [
|
|
60
|
+
'error',
|
|
61
|
+
{
|
|
62
|
+
caughtErrors: 'none',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
'@typescript-eslint/strict-boolean-expressions': [
|
|
66
|
+
'error',
|
|
67
|
+
{
|
|
68
|
+
allowNullableBoolean: true,
|
|
69
|
+
allowNullableObject: false,
|
|
70
|
+
allowNumber: false,
|
|
71
|
+
allowString: false,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
files: ['**/*.config.js'],
|
|
78
|
+
rules: {
|
|
79
|
+
'import/no-extraneous-dependencies': 'off',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
files: ['**/*.test.js', '**/*.test.ts'],
|
|
84
|
+
rules: {
|
|
85
|
+
'no-new': 'off',
|
|
86
|
+
'no-unused-expressions': 'off',
|
|
87
|
+
'import/no-extraneous-dependencies': 'off',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
files: ['**/*.test.ts'],
|
|
92
|
+
rules: {
|
|
93
|
+
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
94
|
+
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w0s/eslint-config",
|
|
3
|
-
"version": "9.0
|
|
3
|
+
"version": "9.2.0",
|
|
4
4
|
"description": "ESLint configuration file used on `w0s.jp`",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"lint": "eslint __tests__/valid/**/*.{js,ts} __tests__/*.test.js rules/**/*.js eslint.config.js"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@eslint/js": "^9.
|
|
28
|
+
"@eslint/js": "^9.37.0",
|
|
29
29
|
"eslint-plugin-import": "^2.32.0",
|
|
30
|
-
"eslint-plugin-jsdoc": "^
|
|
30
|
+
"eslint-plugin-jsdoc": "^60.8.3",
|
|
31
31
|
"eslint-plugin-safely-storage": "^1.0.2",
|
|
32
32
|
"globals": "^16.4.0",
|
|
33
|
-
"typescript-eslint": "^8.
|
|
33
|
+
"typescript-eslint": "^8.46.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@types/node": "^24.
|
|
37
|
-
"eslint": "^9.
|
|
36
|
+
"@types/node": "^24.7.0",
|
|
37
|
+
"eslint": "^9.37.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"eslint": "^9.
|
|
40
|
+
"eslint": "^9.35.0"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
@@ -10,6 +10,7 @@ export default {
|
|
|
10
10
|
'no-await-in-loop': 'error', // eslint-config-airbnb-base@15.0.0; errors
|
|
11
11
|
'no-cond-assign': ['error', 'always'], // eslint-config-airbnb-base@15.0.0; errors
|
|
12
12
|
'no-console': 'warn', // eslint-config-airbnb-base@15.0.0; errors
|
|
13
|
+
'no-continue': 'error', // eslint-config-airbnb-base@15.0.0; style
|
|
13
14
|
'no-constructor-return': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
14
15
|
'no-irregular-whitespace': [
|
|
15
16
|
'error',
|
|
@@ -22,6 +23,7 @@ export default {
|
|
|
22
23
|
'no-promise-executor-return': 'error', // eslint-config-airbnb-base@15.0.0; errors
|
|
23
24
|
'no-self-compare': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
24
25
|
'no-template-curly-in-string': 'error', // eslint-config-airbnb-base@15.0.0; errors
|
|
26
|
+
'no-unassigned-vars': 'error', // ESLint 10 recommended candidate https://github.com/eslint/eslint/issues/19966
|
|
25
27
|
'no-unmodified-loop-condition': 'error',
|
|
26
28
|
'no-unsafe-optional-chaining': [
|
|
27
29
|
'error',
|
|
@@ -35,6 +37,7 @@ export default {
|
|
|
35
37
|
caughtErrors: 'none',
|
|
36
38
|
},
|
|
37
39
|
],
|
|
40
|
+
'no-useless-assignment': 'error', // ESLint 10 recommended candidate https://github.com/eslint/eslint/issues/19966
|
|
38
41
|
'valid-typeof': [
|
|
39
42
|
'error',
|
|
40
43
|
{
|
|
@@ -1,147 +1,148 @@
|
|
|
1
|
-
/** @type {import("eslint").Linter.Config} */
|
|
2
|
-
export default {
|
|
3
|
-
rules: {
|
|
4
|
-
'arrow-body-style': 'error', // eslint-config-airbnb-base@15.0.0; es6
|
|
5
|
-
'block-scoped-var': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
6
|
-
camelcase: [
|
|
7
|
-
'error',
|
|
8
|
-
{
|
|
9
|
-
properties: 'never',
|
|
10
|
-
},
|
|
11
|
-
], // eslint-config-airbnb-base@15.0.0; style
|
|
12
|
-
'class-methods-use-this': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
13
|
-
'consistent-return': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
14
|
-
curly: 'error',
|
|
15
|
-
'default-case': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
16
|
-
'default-case-last': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
17
|
-
'default-param-last': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
18
|
-
'dot-notation': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
19
|
-
eqeqeq: 'error',
|
|
20
|
-
'func-names': 'warn', // eslint-config-airbnb-base@15.0.0; style
|
|
21
|
-
'func-style': 'error',
|
|
22
|
-
'grouped-accessor-pairs': ['error', 'getBeforeSet'],
|
|
23
|
-
'guard-for-in': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
24
|
-
'logical-assignment-operators': 'error',
|
|
25
|
-
'max-classes-per-file': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
26
|
-
'new-cap': 'error',
|
|
27
|
-
'no-alert': 'warn', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
28
|
-
'no-array-constructor': 'error', // eslint-config-airbnb-base@15.0.0; style
|
|
29
|
-
'no-bitwise': 'error', // eslint-config-airbnb-base@15.0.0; style
|
|
30
|
-
'no-caller': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
31
|
-
'no-
|
|
32
|
-
'no-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
'no-empty-
|
|
40
|
-
'no-
|
|
41
|
-
'no-
|
|
42
|
-
'no-
|
|
43
|
-
'no-extra-
|
|
44
|
-
'no-
|
|
45
|
-
'no-implicit-
|
|
46
|
-
'no-
|
|
47
|
-
'no-
|
|
48
|
-
'no-
|
|
49
|
-
'no-
|
|
50
|
-
'no-
|
|
51
|
-
'no-
|
|
52
|
-
'no-
|
|
53
|
-
'no-
|
|
54
|
-
'no-
|
|
55
|
-
'no-multi-
|
|
56
|
-
'no-
|
|
57
|
-
'no-
|
|
58
|
-
'no-new': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
59
|
-
'no-new-
|
|
60
|
-
'no-
|
|
61
|
-
'no-
|
|
62
|
-
'no-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
'no-
|
|
70
|
-
'no-
|
|
71
|
-
'no-restricted-
|
|
72
|
-
'no-
|
|
73
|
-
'no-
|
|
74
|
-
'no-
|
|
75
|
-
'no-
|
|
76
|
-
'no-
|
|
77
|
-
'no-
|
|
78
|
-
'no-
|
|
79
|
-
'no-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
'no-
|
|
95
|
-
'no-useless-
|
|
96
|
-
'no-useless-
|
|
97
|
-
'no-useless-
|
|
98
|
-
'no-useless-
|
|
99
|
-
'no-useless-
|
|
100
|
-
'no-
|
|
101
|
-
'no-
|
|
102
|
-
'
|
|
103
|
-
'
|
|
104
|
-
'
|
|
105
|
-
'
|
|
106
|
-
'prefer-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
'prefer-
|
|
128
|
-
'prefer-
|
|
129
|
-
'prefer-object-
|
|
130
|
-
'prefer-
|
|
131
|
-
'prefer-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
'prefer-
|
|
139
|
-
'prefer-
|
|
140
|
-
'
|
|
141
|
-
radix: 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
142
|
-
'require-await': 'error',
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
1
|
+
/** @type {import("eslint").Linter.Config} */
|
|
2
|
+
export default {
|
|
3
|
+
rules: {
|
|
4
|
+
'arrow-body-style': 'error', // eslint-config-airbnb-base@15.0.0; es6
|
|
5
|
+
'block-scoped-var': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
6
|
+
camelcase: [
|
|
7
|
+
'error',
|
|
8
|
+
{
|
|
9
|
+
properties: 'never',
|
|
10
|
+
},
|
|
11
|
+
], // eslint-config-airbnb-base@15.0.0; style
|
|
12
|
+
'class-methods-use-this': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
13
|
+
'consistent-return': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
14
|
+
curly: 'error',
|
|
15
|
+
'default-case': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
16
|
+
'default-case-last': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
17
|
+
'default-param-last': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
18
|
+
'dot-notation': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
19
|
+
eqeqeq: 'error',
|
|
20
|
+
'func-names': 'warn', // eslint-config-airbnb-base@15.0.0; style
|
|
21
|
+
'func-style': 'error',
|
|
22
|
+
'grouped-accessor-pairs': ['error', 'getBeforeSet'],
|
|
23
|
+
'guard-for-in': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
24
|
+
'logical-assignment-operators': 'error',
|
|
25
|
+
'max-classes-per-file': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
26
|
+
'new-cap': 'error',
|
|
27
|
+
'no-alert': 'warn', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
28
|
+
'no-array-constructor': 'error', // eslint-config-airbnb-base@15.0.0; style
|
|
29
|
+
'no-bitwise': 'error', // eslint-config-airbnb-base@15.0.0; style
|
|
30
|
+
'no-caller': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
31
|
+
'no-else-return': 'error',
|
|
32
|
+
'no-empty': [
|
|
33
|
+
'error',
|
|
34
|
+
{
|
|
35
|
+
allowEmptyCatch: true,
|
|
36
|
+
},
|
|
37
|
+
], // ✅
|
|
38
|
+
'no-empty-function': 'error',
|
|
39
|
+
'no-empty-static-block': 'error',
|
|
40
|
+
'no-eval': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
41
|
+
'no-extend-native': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
42
|
+
'no-extra-bind': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
43
|
+
'no-extra-label': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
44
|
+
'no-implicit-coercion': 'error',
|
|
45
|
+
'no-implicit-globals': 'error',
|
|
46
|
+
'no-implied-eval': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
47
|
+
'no-invalid-this': 'error',
|
|
48
|
+
'no-iterator': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
49
|
+
'no-label-var': 'error', // eslint-config-airbnb-base@15.0.0; variables
|
|
50
|
+
'no-labels': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
51
|
+
'no-lone-blocks': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
52
|
+
'no-lonely-if': 'error', // eslint-config-airbnb-base@15.0.0; style
|
|
53
|
+
'no-loop-func': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
54
|
+
'no-multi-assign': 'error', // eslint-config-airbnb-base@15.0.0; style
|
|
55
|
+
'no-multi-str': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
56
|
+
'no-nested-ternary': 'error', // eslint-config-airbnb-base@15.0.0; style
|
|
57
|
+
'no-new': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
58
|
+
'no-new-func': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
59
|
+
'no-new-wrappers': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
60
|
+
'no-object-constructor': 'error',
|
|
61
|
+
'no-octal-escape': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
62
|
+
'no-param-reassign': [
|
|
63
|
+
'error',
|
|
64
|
+
{
|
|
65
|
+
props: false,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
'no-plusplus': 'error', // eslint-config-airbnb-base@15.0.0; style
|
|
69
|
+
'no-proto': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
70
|
+
'no-restricted-globals': ['error', 'isFinite', 'isNaN'], // eslint-config-airbnb-base@15.0.0; variables
|
|
71
|
+
'no-restricted-syntax': ['error', 'ForInStatement', 'LabeledStatement', 'WithStatement'], // eslint-config-airbnb-base@15.0.0; style
|
|
72
|
+
'no-return-assign': ['error', 'always'], // eslint-config-airbnb-base@15.0.0; best-practices
|
|
73
|
+
'no-script-url': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
74
|
+
'no-sequences': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
75
|
+
'no-shadow': 'error', // eslint-config-airbnb-base@15.0.0; variables
|
|
76
|
+
'no-throw-literal': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
77
|
+
'no-undef-init': 'error', // eslint-config-airbnb-base@15.0.0; variables
|
|
78
|
+
'no-underscore-dangle': 'error', // eslint-config-airbnb-base@15.0.0; style
|
|
79
|
+
'no-unneeded-ternary': [
|
|
80
|
+
'error',
|
|
81
|
+
{
|
|
82
|
+
defaultAssignment: false,
|
|
83
|
+
},
|
|
84
|
+
], // eslint-config-airbnb-base@15.0.0; style
|
|
85
|
+
'no-unused-expressions': [
|
|
86
|
+
'error',
|
|
87
|
+
{
|
|
88
|
+
allowShortCircuit: false,
|
|
89
|
+
allowTernary: false,
|
|
90
|
+
allowTaggedTemplates: false,
|
|
91
|
+
},
|
|
92
|
+
], // eslint-config-airbnb-base@15.0.0; best-practices
|
|
93
|
+
'no-use-before-define': 'error', // eslint-config-airbnb-base@15.0.0; variables
|
|
94
|
+
'no-useless-computed-key': 'error', // eslint-config-airbnb-base@15.0.0; es6
|
|
95
|
+
'no-useless-constructor': 'error', // eslint-config-airbnb-base@15.0.0; es6
|
|
96
|
+
'no-useless-rename': 'error', // eslint-config-airbnb-base@15.0.0; es6
|
|
97
|
+
'no-useless-call': 'error',
|
|
98
|
+
'no-useless-concat': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
99
|
+
'no-useless-return': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
100
|
+
'no-var': 'error', // eslint-config-airbnb-base@15.0.0; es6
|
|
101
|
+
'no-void': 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
102
|
+
'object-shorthand': ['error', 'methods'],
|
|
103
|
+
'one-var': ['error', 'never'], // eslint-config-airbnb-base@15.0.0; style
|
|
104
|
+
'operator-assignment': ['error', 'always'], // eslint-config-airbnb-base@15.0.0; style
|
|
105
|
+
'prefer-arrow-callback': 'error', // eslint-config-airbnb-base@15.0.0; es6
|
|
106
|
+
'prefer-const': [
|
|
107
|
+
'error',
|
|
108
|
+
{
|
|
109
|
+
destructuring: 'any',
|
|
110
|
+
ignoreReadBeforeAssign: true,
|
|
111
|
+
},
|
|
112
|
+
], // eslint-config-airbnb-base@15.0.0; es6
|
|
113
|
+
'prefer-destructuring': [
|
|
114
|
+
'error',
|
|
115
|
+
{
|
|
116
|
+
VariableDeclarator: {
|
|
117
|
+
array: false,
|
|
118
|
+
object: true,
|
|
119
|
+
},
|
|
120
|
+
AssignmentExpression: {
|
|
121
|
+
array: true,
|
|
122
|
+
object: false,
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
], // eslint-config-airbnb-base@15.0.0; es6
|
|
126
|
+
'prefer-exponentiation-operator': 'error', // eslint-config-airbnb-base@15.0.0; style
|
|
127
|
+
'prefer-numeric-literals': 'error', // eslint-config-airbnb-base@15.0.0; es6
|
|
128
|
+
'prefer-object-has-own': 'error',
|
|
129
|
+
'prefer-object-spread': 'error', // eslint-config-airbnb-base@15.0.0; style
|
|
130
|
+
'prefer-promise-reject-errors': 'error',
|
|
131
|
+
'prefer-regex-literals': [
|
|
132
|
+
'error',
|
|
133
|
+
{
|
|
134
|
+
disallowRedundantWrapping: true,
|
|
135
|
+
},
|
|
136
|
+
], // eslint-config-airbnb-base@15.0.0; best-practices
|
|
137
|
+
'prefer-rest-params': 'error', // eslint-config-airbnb-base@15.0.0; es6
|
|
138
|
+
'prefer-spread': 'error', // eslint-config-airbnb-base@15.0.0; es6
|
|
139
|
+
'prefer-template': 'error', // eslint-config-airbnb-base@15.0.0; es6
|
|
140
|
+
'preserve-caught-error': 'error', // ESLint 10 recommended candidate https://github.com/eslint/eslint/issues/19966
|
|
141
|
+
radix: 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
142
|
+
'require-await': 'error',
|
|
143
|
+
'require-unicode-regexp': 'error',
|
|
144
|
+
strict: 'error',
|
|
145
|
+
'symbol-description': 'error', // eslint-config-airbnb-base@15.0.0; es6
|
|
146
|
+
yoda: 'error', // eslint-config-airbnb-base@15.0.0; best-practices
|
|
147
|
+
},
|
|
148
|
+
};
|