@egs33/eslint-config 4.1.3 → 4.2.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/airbnb/best-practices.js +0 -2
- package/airbnb/errors.js +2 -2
- package/airbnb/es6.js +6 -7
- package/airbnb/style.js +2 -8
- package/base.js +4 -0
- package/package.json +10 -9
- package/plugin-rules/imports.js +0 -5
- package/plugin-rules/unicorn.js +16 -0
- package/typescript-base.js +0 -1
package/airbnb/best-practices.js
CHANGED
|
@@ -37,7 +37,6 @@ export const bestPractices = {
|
|
|
37
37
|
'no-extra-bind': 'error',
|
|
38
38
|
'no-extra-label': 'error',
|
|
39
39
|
'no-global-assign': ['error', { exceptions: [] }],
|
|
40
|
-
'no-native-reassign': 'off',
|
|
41
40
|
'no-implicit-coercion': [
|
|
42
41
|
'off', {
|
|
43
42
|
boolean: false,
|
|
@@ -128,7 +127,6 @@ export const bestPractices = {
|
|
|
128
127
|
},
|
|
129
128
|
],
|
|
130
129
|
'no-return-assign': ['error', 'always'],
|
|
131
|
-
'no-return-await': 'error',
|
|
132
130
|
'no-script-url': 'error',
|
|
133
131
|
'no-self-assign': [
|
|
134
132
|
'error', {
|
package/airbnb/errors.js
CHANGED
|
@@ -6,8 +6,8 @@ export const errors = {
|
|
|
6
6
|
'no-constant-binary-expression': 'error',
|
|
7
7
|
'no-constant-condition': 'warn',
|
|
8
8
|
'no-empty-character-class': 'error',
|
|
9
|
-
'no-extra-parens': ['error', 'all', { nestedBinaryExpressions: false }],
|
|
10
|
-
'no-extra-semi': 'error',
|
|
9
|
+
'@stylistic/no-extra-parens': ['error', 'all', { nestedBinaryExpressions: false }],
|
|
10
|
+
'@stylistic/no-extra-semi': 'error',
|
|
11
11
|
'no-inner-declarations': 'error',
|
|
12
12
|
'no-invalid-regexp': 'error',
|
|
13
13
|
'no-new-native-nonconstructor': 'error',
|
package/airbnb/es6.js
CHANGED
|
@@ -4,15 +4,14 @@ export const es6 = {
|
|
|
4
4
|
requireReturnForObjectLiteral: false,
|
|
5
5
|
},
|
|
6
6
|
],
|
|
7
|
-
'arrow-spacing': ['error', { before: true, after: true }],
|
|
8
|
-
'generator-star-spacing': ['error', { before: false, after: true }],
|
|
9
|
-
'no-confusing-arrow': [
|
|
7
|
+
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
|
|
8
|
+
'@stylistic/generator-star-spacing': ['error', { before: false, after: true }],
|
|
9
|
+
'@stylistic/no-confusing-arrow': [
|
|
10
10
|
'error', {
|
|
11
11
|
allowParens: true,
|
|
12
12
|
},
|
|
13
13
|
],
|
|
14
14
|
'no-duplicate-imports': 'off',
|
|
15
|
-
'no-new-symbol': 'error',
|
|
16
15
|
'no-restricted-exports': [
|
|
17
16
|
'error', {
|
|
18
17
|
restrictedNamedExports: [
|
|
@@ -73,8 +72,8 @@ export const es6 = {
|
|
|
73
72
|
'prefer-rest-params': 'error',
|
|
74
73
|
'prefer-spread': 'error',
|
|
75
74
|
'prefer-template': 'error',
|
|
76
|
-
'rest-spread-spacing': ['error', 'never'],
|
|
75
|
+
'@stylistic/rest-spread-spacing': ['error', 'never'],
|
|
77
76
|
'symbol-description': 'error',
|
|
78
|
-
'template-curly-spacing': 'error',
|
|
79
|
-
'yield-star-spacing': ['error', 'after'],
|
|
77
|
+
'@stylistic/template-curly-spacing': 'error',
|
|
78
|
+
'@stylistic/yield-star-spacing': ['error', 'after'],
|
|
80
79
|
};
|
package/airbnb/style.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
export const style = {
|
|
2
2
|
camelcase: ['error', { properties: 'never', ignoreDestructuring: false }],
|
|
3
3
|
'func-names': 'warn',
|
|
4
|
-
'
|
|
5
|
-
'error', {
|
|
6
|
-
before: 'always',
|
|
7
|
-
after: 'always',
|
|
8
|
-
},
|
|
9
|
-
],
|
|
4
|
+
'@stylistic/padding-line-between-statements': ['error', { blankLine: 'always', prev: 'directive', next: '*' }],
|
|
10
5
|
'max-lines-per-function': [
|
|
11
6
|
'off', {
|
|
12
7
|
max: 50,
|
|
@@ -28,8 +23,7 @@ export const style = {
|
|
|
28
23
|
'no-lonely-if': 'error',
|
|
29
24
|
'no-multi-assign': ['error'],
|
|
30
25
|
'no-nested-ternary': 'error',
|
|
31
|
-
'no-
|
|
32
|
-
'no-spaced-func': 'off',
|
|
26
|
+
'@stylistic/no-spaced-func': 'off',
|
|
33
27
|
'no-underscore-dangle': [
|
|
34
28
|
'error', {
|
|
35
29
|
allow: [],
|
package/base.js
CHANGED
|
@@ -4,6 +4,7 @@ import array from 'eslint-plugin-array-func';
|
|
|
4
4
|
import stylistic from '@stylistic/eslint-plugin';
|
|
5
5
|
import eslintJs from '@eslint/js';
|
|
6
6
|
import { configs as regexpConfig } from 'eslint-plugin-regexp';
|
|
7
|
+
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
|
|
7
8
|
import { defineConfig } from 'eslint/config';
|
|
8
9
|
import { rules as PromiseRules } from './plugin-rules/promise.js';
|
|
9
10
|
import { rules as StyleRules } from './plugin-rules/stylistic.js';
|
|
@@ -13,6 +14,7 @@ import { style } from './airbnb/style.js';
|
|
|
13
14
|
import { variables } from './airbnb/variables.js';
|
|
14
15
|
import { es6 } from './airbnb/es6.js';
|
|
15
16
|
import { imports } from './plugin-rules/imports.js';
|
|
17
|
+
import { rules as UnicornRules } from './plugin-rules/unicorn.js';
|
|
16
18
|
|
|
17
19
|
export default defineConfig([
|
|
18
20
|
{
|
|
@@ -51,6 +53,7 @@ export default defineConfig([
|
|
|
51
53
|
importPlugin.flatConfigs.recommended,
|
|
52
54
|
array.configs.all,
|
|
53
55
|
regexpConfig['flat/recommended'],
|
|
56
|
+
eslintPluginUnicorn.configs.recommended,
|
|
54
57
|
{
|
|
55
58
|
rules: {
|
|
56
59
|
...bestPractices,
|
|
@@ -69,6 +72,7 @@ export default defineConfig([
|
|
|
69
72
|
'array-func/prefer-array-from': 'off',
|
|
70
73
|
...PromiseRules,
|
|
71
74
|
...StyleRules,
|
|
75
|
+
...UnicornRules,
|
|
72
76
|
},
|
|
73
77
|
},
|
|
74
78
|
]);
|
package/package.json
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@egs33/eslint-config",
|
|
3
3
|
"description": "eslint config for me",
|
|
4
|
-
"version": "4.1
|
|
4
|
+
"version": "4.2.1",
|
|
5
5
|
"author": "egs33",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@eslint/js": "^
|
|
8
|
+
"@eslint/js": "^10.0.1",
|
|
9
9
|
"@stylistic/eslint-plugin": "^5.6.1",
|
|
10
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
11
|
-
"@typescript-eslint/parser": "^8.
|
|
10
|
+
"@typescript-eslint/eslint-plugin": "^8.57.1",
|
|
11
|
+
"@typescript-eslint/parser": "^8.57.1",
|
|
12
12
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
13
13
|
"eslint-plugin-array-func": "^5.1.0",
|
|
14
14
|
"eslint-plugin-import": "^2.31.0",
|
|
15
15
|
"eslint-plugin-n": "^17.23.1",
|
|
16
16
|
"eslint-plugin-promise": "^7.1.0",
|
|
17
|
-
"eslint-plugin-regexp": "^
|
|
18
|
-
"
|
|
17
|
+
"eslint-plugin-regexp": "^3.1.0",
|
|
18
|
+
"eslint-plugin-unicorn": "^63.0.0",
|
|
19
|
+
"globals": "^17.4.0"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
|
-
"eslint": "^
|
|
22
|
+
"eslint": "^10.1.0",
|
|
22
23
|
"svelte-eslint-parser": "^1.4.1",
|
|
23
24
|
"typescript": "^5.9.3",
|
|
24
|
-
"typescript-eslint": "^8.
|
|
25
|
+
"typescript-eslint": "^8.57.1"
|
|
25
26
|
},
|
|
26
27
|
"engines": {
|
|
27
28
|
"node": ">=20"
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"license": "MIT",
|
|
47
48
|
"main": "nodejs.js",
|
|
48
49
|
"peerDependencies": {
|
|
49
|
-
"eslint": "^9.39.2",
|
|
50
|
+
"eslint": "^9.39.2 || ^10.0.0",
|
|
50
51
|
"eslint-plugin-svelte": "^3.13.1",
|
|
51
52
|
"svelte-eslint-parser": "^1.4.1",
|
|
52
53
|
"typescript": "^5.6.3",
|
package/plugin-rules/imports.js
CHANGED
|
@@ -91,11 +91,6 @@ export const imports = {
|
|
|
91
91
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/first.md
|
|
92
92
|
'import/first': 'error',
|
|
93
93
|
|
|
94
|
-
// disallow non-import statements appearing before import statements
|
|
95
|
-
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/imports-first.md
|
|
96
|
-
// deprecated: use `import/first`
|
|
97
|
-
'import/imports-first': 'off',
|
|
98
|
-
|
|
99
94
|
// disallow duplicate imports
|
|
100
95
|
// https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-duplicates.md
|
|
101
96
|
'import/no-duplicates': 'error',
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const rules = {
|
|
2
|
+
'unicorn/better-regex': 'error',
|
|
3
|
+
'unicorn/custom-error-definition': 'error',
|
|
4
|
+
'unicorn/expiring-todo-comments': 'off',
|
|
5
|
+
'unicorn/import-style': 'off',
|
|
6
|
+
'unicorn/no-array-callback-reference': 'off',
|
|
7
|
+
'unicorn/no-array-reduce': 'off',
|
|
8
|
+
'unicorn/no-await-expression-member': 'off',
|
|
9
|
+
'no-nested-ternary': 'off',
|
|
10
|
+
'unicorn/no-nested-ternary': 'error',
|
|
11
|
+
'unicorn/no-null': 'off',
|
|
12
|
+
'unicorn/no-typeof-undefined': 'off',
|
|
13
|
+
'unicorn/prefer-import-meta-properties': 'error',
|
|
14
|
+
'unicorn/prefer-ternary': 'off',
|
|
15
|
+
'unicorn/prevent-abbreviations': 'off',
|
|
16
|
+
};
|
package/typescript-base.js
CHANGED
|
@@ -63,7 +63,6 @@ const config = defineConfig([
|
|
|
63
63
|
'@typescript-eslint/no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }],
|
|
64
64
|
'require-await': 'off',
|
|
65
65
|
'@typescript-eslint/require-await': 'off',
|
|
66
|
-
'no-return-await': 'off',
|
|
67
66
|
'@typescript-eslint/return-await': ['error', 'in-try-catch'],
|
|
68
67
|
|
|
69
68
|
'@typescript-eslint/method-signature-style': ['error', 'property'],
|