@xaliksss/eslint-config 4.0.0 → 4.0.2
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/LICENSE +21 -21
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/dist/rules/eslint.js +8 -8
- package/dist/rules/import-x.js +61 -0
- package/dist/rules/n.d.ts +2 -0
- package/dist/rules/n.js +46 -0
- package/dist/rules/stylistic.js +23 -4
- package/dist/rules/typescript.js +8 -10
- package/package.json +35 -34
- package/dist/rules/import.js +0 -57
- /package/dist/rules/{import.d.ts → import-x.d.ts} +0 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Xaliks
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Xaliks
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("eslint/config").
|
|
1
|
+
declare const _default: import("eslint/config").ConfigObject[];
|
|
2
2
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,11 @@ import { defineConfig } from 'eslint/config';
|
|
|
2
2
|
import globals from "globals";
|
|
3
3
|
import tseslint from "typescript-eslint";
|
|
4
4
|
import stylisticPlugin from "@stylistic/eslint-plugin";
|
|
5
|
-
import importPlugin from "eslint-plugin-import";
|
|
5
|
+
import importPlugin from "eslint-plugin-import-x";
|
|
6
|
+
import nPlugin from "eslint-plugin-n";
|
|
6
7
|
import { eslintRules } from "./rules/eslint.js";
|
|
7
8
|
import { stylisticRules } from "./rules/stylistic.js";
|
|
8
|
-
import { importRules } from "./rules/import.js";
|
|
9
|
+
import { importRules } from "./rules/import-x.js";
|
|
9
10
|
import { typescriptRules, typescriptTypeAwareRules } from "./rules/typescript.js";
|
|
10
11
|
const IGNORES = [
|
|
11
12
|
"**/dist/**",
|
|
@@ -29,7 +30,8 @@ export default defineConfig({
|
|
|
29
30
|
},
|
|
30
31
|
plugins: {
|
|
31
32
|
"@stylistic": stylisticPlugin,
|
|
32
|
-
import: importPlugin,
|
|
33
|
+
"import-x": importPlugin,
|
|
34
|
+
n: nPlugin,
|
|
33
35
|
},
|
|
34
36
|
rules: {
|
|
35
37
|
...eslintRules,
|
package/dist/rules/eslint.js
CHANGED
|
@@ -9,7 +9,7 @@ export const eslintRules = {
|
|
|
9
9
|
"no-compare-neg-zero": "error",
|
|
10
10
|
"no-cond-assign": "error",
|
|
11
11
|
"no-const-assign": "error", // [TS]
|
|
12
|
-
"no-constant-binary-expression": "error",
|
|
12
|
+
"no-constant-binary-expression": ["error", { checkRelationalComparisons: true }],
|
|
13
13
|
"no-constant-condition": "error",
|
|
14
14
|
"no-constructor-return": "error",
|
|
15
15
|
"no-control-regex": "off", // запрещает делать regex с контрол-символами,
|
|
@@ -19,7 +19,7 @@ export const eslintRules = {
|
|
|
19
19
|
"no-dupe-else-if": "error",
|
|
20
20
|
"no-dupe-keys": "error", // [TS]
|
|
21
21
|
"no-duplicate-case": "error",
|
|
22
|
-
"no-duplicate-imports": "error",
|
|
22
|
+
"no-duplicate-imports": ["error", { allowSeparateTypeImports: true }],
|
|
23
23
|
"no-empty-character-class": "error",
|
|
24
24
|
"no-empty-pattern": "error",
|
|
25
25
|
"no-ex-assign": "error",
|
|
@@ -44,7 +44,7 @@ export const eslintRules = {
|
|
|
44
44
|
"no-unassigned-vars": "error",
|
|
45
45
|
"no-undef": "error", // [TS]
|
|
46
46
|
"no-unexpected-multiline": "error",
|
|
47
|
-
"no-unmodified-loop-condition": "error",
|
|
47
|
+
"no-unmodified-loop-condition": ["error", { checkConditionalExpressions: true }],
|
|
48
48
|
"no-unreachable": "error", // [TS]
|
|
49
49
|
"no-unreachable-loop": "error",
|
|
50
50
|
"no-unsafe-finally": "error",
|
|
@@ -62,7 +62,7 @@ export const eslintRules = {
|
|
|
62
62
|
}],
|
|
63
63
|
"no-useless-assignment": "error",
|
|
64
64
|
"no-useless-backreference": "error",
|
|
65
|
-
"require-atomic-updates": "
|
|
65
|
+
"require-atomic-updates": "off",
|
|
66
66
|
"use-isnan": "error",
|
|
67
67
|
"valid-typeof": "error",
|
|
68
68
|
"no-ternary": "off", // Отключает тернарные операторы
|
|
@@ -115,10 +115,10 @@ export const eslintRules = {
|
|
|
115
115
|
"yoda": "error",
|
|
116
116
|
"unicode-bom": "error",
|
|
117
117
|
"accessor-pairs": "error", // Спорно, возможно удалится
|
|
118
|
-
"arrow-body-style":
|
|
118
|
+
"arrow-body-style": "off",
|
|
119
119
|
"block-scoped-var": "error",
|
|
120
120
|
"camelcase": "off", // есть naming-convention с более детальной настройкой
|
|
121
|
-
"capitalized-comments": "
|
|
121
|
+
"capitalized-comments": "off",
|
|
122
122
|
"class-methods-use-this": "off",
|
|
123
123
|
"complexity": "off",
|
|
124
124
|
"consistent-return": "off",
|
|
@@ -140,10 +140,10 @@ export const eslintRules = {
|
|
|
140
140
|
"init-declarations": "off",
|
|
141
141
|
"logical-assignment-operators": ["error", "always", { enforceForIfStatements: true }],
|
|
142
142
|
"max-classes-per-file": "off",
|
|
143
|
-
"max-depth":
|
|
143
|
+
"max-depth": "off",
|
|
144
144
|
"max-lines": "off",
|
|
145
145
|
"max-lines-per-function": "off",
|
|
146
|
-
"max-nested-callbacks": ["error", { max: 3 }],
|
|
146
|
+
"max-nested-callbacks": ["error", { max: 3, checkConstructorCallCallbacks: true }],
|
|
147
147
|
"max-params": ["error", { max: 6 }],
|
|
148
148
|
"max-statements": "off",
|
|
149
149
|
"new-cap": "off",
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Linter } from "eslint";
|
|
2
|
+
export const importRules = {
|
|
3
|
+
"import-x/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
4
|
+
"import-x/default": "error",
|
|
5
|
+
"import-x/dynamic-import-chunkname": "off",
|
|
6
|
+
"import-x/export": "error",
|
|
7
|
+
"import-x/exports-last": "off",
|
|
8
|
+
"import-x/extensions": "off", // Для каждого проекта должно быть свое решение
|
|
9
|
+
"import-x/first": "error",
|
|
10
|
+
"import-x/group-exports": "off",
|
|
11
|
+
"import-x/max-dependencies": "off",
|
|
12
|
+
"import-x/named": "error",
|
|
13
|
+
"import-x/namespace": "error",
|
|
14
|
+
"import-x/newline-after-import": ["error", { count: 1, considerComments: true }],
|
|
15
|
+
"import-x/no-absolute-path": "error",
|
|
16
|
+
"import-x/no-amd": "error",
|
|
17
|
+
"import-x/no-anonymous-default-export": "error",
|
|
18
|
+
"import-x/no-commonjs": "error",
|
|
19
|
+
"import-x/no-cycle": ["error", {
|
|
20
|
+
maxDepth: 4, // Возможно придется обновить на 1
|
|
21
|
+
ignoreExternal: true,
|
|
22
|
+
allowUnsafeDynamicCyclicDependency: false
|
|
23
|
+
}],
|
|
24
|
+
"import-x/no-default-export": "off",
|
|
25
|
+
"import-x/no-deprecated": "off", // С этим лучше справляется @typescript-eslint/no-deprecated
|
|
26
|
+
"import-x/no-duplicates": "off", // уже используем extensions
|
|
27
|
+
"import-x/no-dynamic-require": "error",
|
|
28
|
+
"import-x/no-empty-named-blocks": "error",
|
|
29
|
+
"import-x/no-extraneous-dependencies": "error",
|
|
30
|
+
"import-x/no-import-module-exports": "error",
|
|
31
|
+
"import-x/no-internal-modules": "off",
|
|
32
|
+
"import-x/no-mutable-exports": "error",
|
|
33
|
+
"import-x/no-named-as-default-member": "error",
|
|
34
|
+
"import-x/no-named-as-default": "error",
|
|
35
|
+
"import-x/no-named-default": "error",
|
|
36
|
+
"import-x/no-named-export": "off",
|
|
37
|
+
"import-x/no-namespace": "off",
|
|
38
|
+
"import-x/no-nodejs-modules": "off",
|
|
39
|
+
"import-x/no-relative-packages": "off",
|
|
40
|
+
"import-x/no-relative-parent-imports": "off",
|
|
41
|
+
"import-x/no-rename-default": "error",
|
|
42
|
+
"import-x/no-restricted-paths": "off", // в связке с no-restricted-imports от Eslint
|
|
43
|
+
"import-x/no-self-import": "error",
|
|
44
|
+
"import-x/no-unassigned-import": "off",
|
|
45
|
+
"import-x/no-unresolved": "off",
|
|
46
|
+
"import-x/no-unused-modules": ["error", { unusedExports: true, missingExports: false }],
|
|
47
|
+
"import-x/no-useless-path-segments": "error",
|
|
48
|
+
"import-x/no-webpack-loader-syntax": "error",
|
|
49
|
+
"import-x/order": ["error",
|
|
50
|
+
{
|
|
51
|
+
groups: ["builtin", "external", "type", "internal", "parent", "sibling", "index", "object"],
|
|
52
|
+
"newlines-between": "always",
|
|
53
|
+
alphabetize: { order: "asc" },
|
|
54
|
+
named: true,
|
|
55
|
+
"newlines-between-types": "ignore",
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
"import-x/prefer-default-export": "off",
|
|
59
|
+
"import-x/prefer-namespace-import": "off",
|
|
60
|
+
"import-x/unambiguous": "error",
|
|
61
|
+
};
|
package/dist/rules/n.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Linter } from "eslint";
|
|
2
|
+
export const nRules = {
|
|
3
|
+
"n/callback-return": "error",
|
|
4
|
+
"n/exports-style": ["error", "exports"],
|
|
5
|
+
"n/file-extension-in-import": "off", // TypeScript знает лучше
|
|
6
|
+
"n/global-require": "error",
|
|
7
|
+
"n/handle-callback-err": "error",
|
|
8
|
+
"n/hashbang": "error",
|
|
9
|
+
"n/no-callback-literal": "off",
|
|
10
|
+
"n/no-deprecated-api": "error",
|
|
11
|
+
"n/no-exports-assign": "error",
|
|
12
|
+
"n/no-extraneous-import": "off", // есть import-x/no-extraneous-dependencies
|
|
13
|
+
"n/no-extraneous-require": "off", // есть import-x/no-extraneous-dependencies
|
|
14
|
+
"n/no-missing-import": "off", // есть import-x/no-unresolved
|
|
15
|
+
"n/no-missing-require": "off", // есть import-x/no-unresolved
|
|
16
|
+
"n/no-mixed-requires": "error", // есть import-x/order
|
|
17
|
+
"n/no-new-require": "error",
|
|
18
|
+
"n/no-path-concat": "error",
|
|
19
|
+
"n/no-process-env": "off",
|
|
20
|
+
"n/no-process-exit": "off",
|
|
21
|
+
"n/no-restricted-import": "off", // есть import-x/no-restricted-paths
|
|
22
|
+
"n/no-restricted-require": "off", // есть import-x/no-restricted-paths
|
|
23
|
+
"n/no-sync": "off",
|
|
24
|
+
"n/no-top-level-await": "off",
|
|
25
|
+
"n/no-unpublished-bin": "off", // > npm v10
|
|
26
|
+
"n/no-unpublished-import": "off",
|
|
27
|
+
"n/no-unpublished-require": "off",
|
|
28
|
+
"n/no-unsupported-features/es-builtins": "error",
|
|
29
|
+
"n/no-unsupported-features/es-syntax": "error",
|
|
30
|
+
"n/no-unsupported-features/node-builtins": "error",
|
|
31
|
+
"n/prefer-global/buffer": "error",
|
|
32
|
+
"n/prefer-global/console": "error",
|
|
33
|
+
"n/prefer-global/crypto": "error", // webcrypto
|
|
34
|
+
"n/prefer-global/process": "error",
|
|
35
|
+
"n/prefer-global/text-decoder": "error",
|
|
36
|
+
"n/prefer-global/text-encoder": "error",
|
|
37
|
+
"n/prefer-global/timers": "error",
|
|
38
|
+
"n/prefer-global/url": "error",
|
|
39
|
+
"n/prefer-global/url-search-params": "error",
|
|
40
|
+
"n/prefer-import/assert-strict": "error",
|
|
41
|
+
"n/prefer-node-protocol": "error",
|
|
42
|
+
"n/prefer-process-get-builtin-module": "off", // Мир пока не готов к process.getBuiltinModule()
|
|
43
|
+
"n/prefer-promises/dns": "error",
|
|
44
|
+
"n/prefer-promises/fs": "error",
|
|
45
|
+
"n/process-exit-as-throw": "error",
|
|
46
|
+
};
|
package/dist/rules/stylistic.js
CHANGED
|
@@ -47,8 +47,26 @@ export const stylisticRules = {
|
|
|
47
47
|
"@stylistic/line-comment-position": "off", // Без разницы где ставить комментарий
|
|
48
48
|
"@stylistic/linebreak-style": ["error", "unix"],
|
|
49
49
|
"@stylistic/lines-around-comment": "off", // Без разницы где ставить комментарий
|
|
50
|
-
"@stylistic/lines-between-class-members": "error",
|
|
51
|
-
|
|
50
|
+
"@stylistic/lines-between-class-members": ["error",
|
|
51
|
+
{
|
|
52
|
+
enforce: [
|
|
53
|
+
{ blankLine: "always", prev: "method", next: "method" },
|
|
54
|
+
{ blankLine: "always", prev: "field", next: "method" },
|
|
55
|
+
{ blankLine: "always", prev: "method", next: "field" },
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
{ exceptAfterOverload: true }
|
|
59
|
+
],
|
|
60
|
+
"@stylistic/max-len": ["error", {
|
|
61
|
+
code: 120,
|
|
62
|
+
tabWidth: 1,
|
|
63
|
+
ignoreComments: true,
|
|
64
|
+
ignoreTrailingComments: true,
|
|
65
|
+
ignoreUrls: true,
|
|
66
|
+
ignoreStrings: true,
|
|
67
|
+
ignoreTemplateLiterals: true,
|
|
68
|
+
ignoreRegExpLiterals: true
|
|
69
|
+
}],
|
|
52
70
|
"@stylistic/max-statements-per-line": ["error", { max: 1 }],
|
|
53
71
|
"@stylistic/member-delimiter-style": ["error", {
|
|
54
72
|
multiline: {
|
|
@@ -83,7 +101,7 @@ export const stylisticRules = {
|
|
|
83
101
|
groups: [["&&", "||", "?:"]],
|
|
84
102
|
allowSamePrecedence: true,
|
|
85
103
|
}],
|
|
86
|
-
"@stylistic/no-mixed-spaces-and-tabs": "
|
|
104
|
+
"@stylistic/no-mixed-spaces-and-tabs": "off", // разобраться
|
|
87
105
|
"@stylistic/no-multi-spaces": "error",
|
|
88
106
|
"@stylistic/no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 1 }],
|
|
89
107
|
"@stylistic/no-tabs": "off",
|
|
@@ -91,13 +109,14 @@ export const stylisticRules = {
|
|
|
91
109
|
"@stylistic/no-whitespace-before-property": "error",
|
|
92
110
|
"@stylistic/nonblock-statement-body-position": "error",
|
|
93
111
|
"@stylistic/object-curly-newline": "error",
|
|
94
|
-
"@stylistic/object-curly-spacing": "error",
|
|
112
|
+
"@stylistic/object-curly-spacing": ["error", "always"],
|
|
95
113
|
"@stylistic/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
|
|
96
114
|
"@stylistic/one-var-declaration-per-line": "off",
|
|
97
115
|
"@stylistic/operator-linebreak": ["error", "after", {
|
|
98
116
|
overrides: {
|
|
99
117
|
"?": "before",
|
|
100
118
|
":": "before",
|
|
119
|
+
"|": "before",
|
|
101
120
|
},
|
|
102
121
|
}],
|
|
103
122
|
"@stylistic/padded-blocks": ["error", "never"],
|
package/dist/rules/typescript.js
CHANGED
|
@@ -40,6 +40,7 @@ export const typescriptRules = {
|
|
|
40
40
|
"@typescript-eslint/method-signature-style": ["error", "method"],
|
|
41
41
|
"@typescript-eslint/no-array-constructor": "off", // есть no-array-constructor
|
|
42
42
|
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
43
|
+
"@typescript-eslint/no-deprecated": "error",
|
|
43
44
|
"@typescript-eslint/no-dupe-class-members": "off", // оно в TS вообще не нужно
|
|
44
45
|
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
45
46
|
"@typescript-eslint/no-dynamic-delete": "error",
|
|
@@ -52,7 +53,6 @@ export const typescriptRules = {
|
|
|
52
53
|
"@typescript-eslint/no-inferrable-types": "error",
|
|
53
54
|
"@typescript-eslint/no-invalid-this": "off", // есть no-invalid-this
|
|
54
55
|
"@typescript-eslint/no-invalid-void-type": ["error", { allowAsThisParameter: true }],
|
|
55
|
-
"@typescript-eslint/no-loop-func": "off", // есть no-loop-func
|
|
56
56
|
"@typescript-eslint/no-magic-numbers": "off", // есть no-magic-numbers
|
|
57
57
|
"@typescript-eslint/no-misused-new": "error",
|
|
58
58
|
"@typescript-eslint/no-namespace": "error",
|
|
@@ -61,7 +61,6 @@ export const typescriptRules = {
|
|
|
61
61
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|
62
62
|
"@typescript-eslint/no-redeclare": "off", // TS сам справится
|
|
63
63
|
"@typescript-eslint/no-require-imports": "error",
|
|
64
|
-
"@typescript-eslint/no-restricted-imports": "off", // есть no-restricted-imports
|
|
65
64
|
"@typescript-eslint/no-restricted-types": "off",
|
|
66
65
|
"@typescript-eslint/no-shadow": "off", // есть no-shadow
|
|
67
66
|
"@typescript-eslint/no-this-alias": "error",
|
|
@@ -137,11 +136,7 @@ export const typescriptTypeAwareRules = {
|
|
|
137
136
|
],
|
|
138
137
|
"@typescript-eslint/no-array-delete": "error",
|
|
139
138
|
"@typescript-eslint/no-base-to-string": "error",
|
|
140
|
-
"@typescript-eslint/no-confusing-void-expression":
|
|
141
|
-
{
|
|
142
|
-
ignoreVoidReturningFunctions: true,
|
|
143
|
-
}
|
|
144
|
-
],
|
|
139
|
+
"@typescript-eslint/no-confusing-void-expression": "off",
|
|
145
140
|
"@typescript-eslint/no-floating-promises": ["error", {
|
|
146
141
|
ignoreIIFE: true,
|
|
147
142
|
}],
|
|
@@ -194,7 +189,7 @@ export const typescriptTypeAwareRules = {
|
|
|
194
189
|
"@typescript-eslint/prefer-regexp-exec": "error",
|
|
195
190
|
"@typescript-eslint/prefer-return-this-type": "error",
|
|
196
191
|
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
197
|
-
"@typescript-eslint/promise-function-async": "
|
|
192
|
+
"@typescript-eslint/promise-function-async": "off",
|
|
198
193
|
"@typescript-eslint/related-getter-setter-pairs": "error",
|
|
199
194
|
"@typescript-eslint/require-array-sort-compare": "error",
|
|
200
195
|
"require-await": "off",
|
|
@@ -208,11 +203,14 @@ export const typescriptTypeAwareRules = {
|
|
|
208
203
|
allowAny: false,
|
|
209
204
|
allowNever: false,
|
|
210
205
|
allowArray: false,
|
|
211
|
-
allow: [
|
|
206
|
+
allow: [
|
|
207
|
+
{ from: "lib", name: ["Error", "URL", "URLSearchParams"] },
|
|
208
|
+
{ from: "package", name: ["Big"], package: "big.js" },
|
|
209
|
+
],
|
|
212
210
|
}],
|
|
213
211
|
"@typescript-eslint/return-await": ["error", "in-try-catch"],
|
|
214
212
|
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
215
|
-
"@typescript-eslint/strict-void-return": "
|
|
213
|
+
"@typescript-eslint/strict-void-return": "off",
|
|
216
214
|
"@typescript-eslint/switch-exhaustiveness-check": ["error", { requireDefaultForNonUnion: true }],
|
|
217
215
|
"@typescript-eslint/unbound-method": "error",
|
|
218
216
|
"@typescript-eslint/use-unknown-in-catch-callback-variable": "error",
|
package/package.json
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@xaliksss/eslint-config",
|
|
3
|
-
"version": "4.0.
|
|
4
|
-
"main": "dist/index.js",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"author": {
|
|
7
|
-
"name": "Xaliks",
|
|
8
|
-
"url": "https://github.com/Xaliks"
|
|
9
|
-
},
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/Xaliks/eslint-config.git"
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"dist"
|
|
16
|
-
],
|
|
17
|
-
"exports": {
|
|
18
|
-
".": "./dist/index.js"
|
|
19
|
-
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "tsc"
|
|
22
|
-
},
|
|
23
|
-
"license": "MIT",
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"@stylistic/eslint-plugin": "
|
|
26
|
-
"eslint": "
|
|
27
|
-
"eslint-plugin-import": "
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@xaliksss/eslint-config",
|
|
3
|
+
"version": "4.0.2",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Xaliks",
|
|
8
|
+
"url": "https://github.com/Xaliks"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/Xaliks/eslint-config.git"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@stylistic/eslint-plugin": "5.10.0",
|
|
26
|
+
"eslint": "10.10.0",
|
|
27
|
+
"eslint-plugin-import-x": "^4.17.1",
|
|
28
|
+
"eslint-plugin-n": "^18.3.0",
|
|
29
|
+
"globals": "17.12.0",
|
|
30
|
+
"typescript-eslint": "8.69.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"typescript": "^6.0.3"
|
|
34
|
+
}
|
|
35
|
+
}
|
package/dist/rules/import.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Linter } from "eslint";
|
|
2
|
-
export const importRules = {
|
|
3
|
-
"import/export": "error",
|
|
4
|
-
"import/no-deprecated": "error",
|
|
5
|
-
"import/no-empty-named-blocks": "error",
|
|
6
|
-
"import/no-extraneous-dependencies": "error",
|
|
7
|
-
"import/no-mutable-exports": "error",
|
|
8
|
-
"import/no-named-as-default-member": "error",
|
|
9
|
-
"import/no-unused-modules": "error",
|
|
10
|
-
"import/no-amd": "error",
|
|
11
|
-
"import/no-commonjs": "error",
|
|
12
|
-
"import/no-import-module-exports": "error",
|
|
13
|
-
"import/no-nodejs-modules": "off",
|
|
14
|
-
"import/unambiguous": "error",
|
|
15
|
-
"import/default": "error", // Под вопросом
|
|
16
|
-
"import/enforce-node-protocol-usage": ["error", "always"],
|
|
17
|
-
"import/named": "error", // Под вопросом
|
|
18
|
-
"import/namespace": "error",
|
|
19
|
-
"import/no-absolute-path": "error",
|
|
20
|
-
"import/no-cycle": ["error", {
|
|
21
|
-
maxDepth: 2, // Возможно придется обновить на 1
|
|
22
|
-
ignoreExternal: true,
|
|
23
|
-
allowUnsafeDynamicCyclicDependency: false
|
|
24
|
-
}],
|
|
25
|
-
"import/no-dynamic-require": "error",
|
|
26
|
-
"import/no-internal-modules": "off",
|
|
27
|
-
"import/no-relative-packages": "off",
|
|
28
|
-
"import/no-relative-parent-imports": "off",
|
|
29
|
-
"import/no-self-import": "error",
|
|
30
|
-
"import/no-unresolved": "off",
|
|
31
|
-
"import/no-useless-path-segments": "error",
|
|
32
|
-
"import/no-webpack-loader-syntax": "error",
|
|
33
|
-
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
34
|
-
"import/dynamic-import-chunkname": "off",
|
|
35
|
-
"import/exports-last": "off",
|
|
36
|
-
"import/extensions": "off",
|
|
37
|
-
"import/first": "error",
|
|
38
|
-
"import/group-exports": "off",
|
|
39
|
-
"import/max-dependencies": "off",
|
|
40
|
-
"import/newline-after-import": ["error", { count: 1, considerComments: false }],
|
|
41
|
-
"import/no-anonymous-default-export": "error",
|
|
42
|
-
"import/no-default-export": "off",
|
|
43
|
-
"import/no-duplicates": "error",
|
|
44
|
-
"import/no-named-default": "error",
|
|
45
|
-
"import/no-named-export": "off",
|
|
46
|
-
"import/no-namespace": "off",
|
|
47
|
-
"import/no-unassigned-import": "off",
|
|
48
|
-
"import/order": ["error",
|
|
49
|
-
{
|
|
50
|
-
groups: ["builtin", "external", "type", "internal", "parent", "sibling", "index", "object"],
|
|
51
|
-
"newlines-between": "always",
|
|
52
|
-
named: true,
|
|
53
|
-
alphabetize: { order: "asc" },
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
"import/prefer-default-export": "off",
|
|
57
|
-
};
|
|
File without changes
|