@perfective/eslint-config 0.29.1 → 0.30.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/LICENSE +1 -1
- package/README.adoc +24 -19
- package/README.md +20 -17
- package/config/node.d.ts +7 -0
- package/config/node.js +7 -11
- package/config/plugin.d.ts +9 -0
- package/config/plugin.js +22 -26
- package/config.js +1 -6
- package/cypress.d.ts +5 -0
- package/cypress.js +31 -58
- package/index.d.ts +58 -26
- package/index.js +100 -145
- package/jest-dom.js +8 -11
- package/jest.d.ts +6 -0
- package/jest.js +29 -24
- package/package.json +18 -18
- package/rules/array-func/index.d.ts +1 -2
- package/rules/array-func/index.js +14 -50
- package/rules/cypress/index.d.ts +11 -3
- package/rules/cypress/index.js +23 -57
- package/rules/eslint/index.js +6 -9
- package/rules/eslint/layout-formatting.js +64 -67
- package/rules/eslint/possible-problems.js +96 -99
- package/rules/eslint/suggestions.js +181 -182
- package/rules/eslint-comments/best-practices.js +8 -11
- package/rules/eslint-comments/index.d.ts +1 -2
- package/rules/eslint-comments/index.js +9 -45
- package/rules/eslint-comments/stylistic-issues.js +9 -18
- package/rules/import/helpful-warnings.js +11 -14
- package/rules/import/index.js +11 -14
- package/rules/import/module-systems.js +10 -13
- package/rules/import/rules/no-extraneous-dependencies.d.ts +3 -0
- package/rules/import/rules/no-extraneous-dependencies.js +20 -21
- package/rules/import/static-analysis.js +26 -29
- package/rules/import/style-guide.js +33 -36
- package/rules/jest/index.js +98 -72
- package/rules/jest/typescript-eslint.js +5 -8
- package/rules/jest-dom/index.js +19 -55
- package/rules/jsdoc/index.d.ts +1 -1
- package/rules/jsdoc/index.js +158 -344
- package/rules/n/index.d.ts +1 -1
- package/rules/n/index.js +64 -98
- package/rules/prefer-arrow/index.d.ts +1 -2
- package/rules/prefer-arrow/index.js +14 -50
- package/rules/promise/index.d.ts +1 -2
- package/rules/promise/index.js +35 -73
- package/rules/rxjs/index.d.ts +1 -1
- package/rules/rxjs/index.js +60 -96
- package/rules/security/index.d.ts +1 -2
- package/rules/security/index.js +22 -58
- package/rules/simple-import-sort/index.js +12 -48
- package/rules/simple-import-sort/rules/imports.d.ts +11 -0
- package/rules/simple-import-sort/rules/imports.js +18 -32
- package/rules/stylistic/js/index.d.ts +9 -2
- package/rules/stylistic/js/index.js +198 -236
- package/rules/stylistic/jsx/index.d.ts +8 -2
- package/rules/stylistic/jsx/index.js +81 -117
- package/rules/stylistic/plus/index.d.ts +6 -2
- package/rules/stylistic/plus/index.js +14 -50
- package/rules/stylistic/ts/index.d.ts +8 -2
- package/rules/stylistic/ts/index.js +135 -169
- package/rules/testing-library/index.js +41 -77
- package/rules/typescript-eslint/extension-rules.js +113 -116
- package/rules/typescript-eslint/index.d.ts +2 -0
- package/rules/typescript-eslint/index.js +9 -45
- package/rules/typescript-eslint/rules/typescript-eslint-naming-convention.d.ts +5 -0
- package/rules/typescript-eslint/rules/typescript-eslint-naming-convention.js +24 -30
- package/rules/typescript-eslint/supported-rules.d.ts +2 -0
- package/rules/typescript-eslint/supported-rules.js +256 -319
- package/rules/unicorn/index.d.ts +7 -2
- package/rules/unicorn/index.js +178 -209
- package/rules/unicorn/rules/prevent-abbreviations.d.ts +8 -0
- package/rules/unicorn/rules/prevent-abbreviations.js +30 -8
- package/rules.js +4 -14
- package/rxjs.d.ts +5 -0
- package/rxjs.js +21 -57
- package/testing-library.js +8 -11
|
@@ -1,182 +1,181 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
};
|
|
1
|
+
export const eslintSuggestionsRules = {
|
|
2
|
+
'accessor-pairs': 'error',
|
|
3
|
+
'arrow-body-style': ['warn', 'as-needed'],
|
|
4
|
+
'block-scoped-var': 'error',
|
|
5
|
+
'camelcase': 'off',
|
|
6
|
+
'capitalized-comments': ['warn', 'always', {
|
|
7
|
+
ignorePattern: 'eslint|tslint',
|
|
8
|
+
ignoreConsecutiveComments: true
|
|
9
|
+
}],
|
|
10
|
+
'class-methods-use-this': 'off',
|
|
11
|
+
'complexity': ['error', 3],
|
|
12
|
+
'consistent-return': 'error',
|
|
13
|
+
'consistent-this': ['error', 'self'],
|
|
14
|
+
'curly': ['warn', 'all'],
|
|
15
|
+
'default-case': 'error',
|
|
16
|
+
'default-case-last': 'error',
|
|
17
|
+
'default-param-last': 'error',
|
|
18
|
+
'dot-notation': ['warn', {
|
|
19
|
+
allowKeywords: true
|
|
20
|
+
}],
|
|
21
|
+
'eqeqeq': ['warn', 'always'],
|
|
22
|
+
'func-name-matching': ['error', 'always'],
|
|
23
|
+
'func-names': ['error', 'always'],
|
|
24
|
+
'func-style': ['error', 'declaration'],
|
|
25
|
+
'grouped-accessor-pairs': ['error', 'setBeforeGet'],
|
|
26
|
+
'guard-for-in': 'error',
|
|
27
|
+
'id-denylist': ['error', 'arr', 'ctx', 'el', 'elem', 'err', 'ind', 'ptr'],
|
|
28
|
+
'id-length': 'off',
|
|
29
|
+
'id-match': 'off',
|
|
30
|
+
'init-declarations': ['error', 'always'],
|
|
31
|
+
'logical-assignment-operators': ['warn', 'always', {
|
|
32
|
+
enforceForIfStatements: true
|
|
33
|
+
}],
|
|
34
|
+
'max-classes-per-file': ['error', 1],
|
|
35
|
+
'max-depth': ['error', 4],
|
|
36
|
+
'max-lines': 'off',
|
|
37
|
+
'max-lines-per-function': 'off',
|
|
38
|
+
'max-nested-callbacks': ['error', 2],
|
|
39
|
+
'max-params': ['off', {
|
|
40
|
+
max: 3
|
|
41
|
+
}],
|
|
42
|
+
'max-statements': ['off', {
|
|
43
|
+
max: 10
|
|
44
|
+
}],
|
|
45
|
+
'multiline-comment-style': 'off',
|
|
46
|
+
'new-cap': ['error', {
|
|
47
|
+
newIsCap: true,
|
|
48
|
+
capIsNew: true,
|
|
49
|
+
properties: true
|
|
50
|
+
}],
|
|
51
|
+
'no-alert': 'error',
|
|
52
|
+
'no-array-constructor': 'error',
|
|
53
|
+
'no-bitwise': 'error',
|
|
54
|
+
'no-caller': 'error',
|
|
55
|
+
'no-case-declarations': 'error',
|
|
56
|
+
'no-confusing-arrow': 'off',
|
|
57
|
+
'no-console': 'error',
|
|
58
|
+
'no-continue': 'error',
|
|
59
|
+
'no-delete-var': 'error',
|
|
60
|
+
'no-div-regex': 'warn',
|
|
61
|
+
'no-else-return': ['warn', {
|
|
62
|
+
allowElseIf: false
|
|
63
|
+
}],
|
|
64
|
+
'no-empty': 'error',
|
|
65
|
+
'no-empty-function': 'error',
|
|
66
|
+
'no-empty-static-block': 'error',
|
|
67
|
+
'no-eq-null': 'error',
|
|
68
|
+
'no-eval': 'error',
|
|
69
|
+
'no-extend-native': 'error',
|
|
70
|
+
'no-extra-bind': 'warn',
|
|
71
|
+
'no-extra-boolean-cast': ['warn', {
|
|
72
|
+
enforceForInnerExpressions: true
|
|
73
|
+
}],
|
|
74
|
+
'no-extra-label': 'warn',
|
|
75
|
+
'no-extra-semi': 'off',
|
|
76
|
+
'no-floating-decimal': 'off',
|
|
77
|
+
'no-global-assign': 'error',
|
|
78
|
+
'no-implicit-coercion': 'warn',
|
|
79
|
+
'no-implicit-globals': 'error',
|
|
80
|
+
'no-implied-eval': 'error',
|
|
81
|
+
'no-inline-comments': ['error', {
|
|
82
|
+
ignorePattern: '^ == .+'
|
|
83
|
+
}],
|
|
84
|
+
'no-invalid-this': 'error',
|
|
85
|
+
'no-iterator': 'error',
|
|
86
|
+
'no-label-var': 'error',
|
|
87
|
+
'no-labels': 'error',
|
|
88
|
+
'no-lone-blocks': 'error',
|
|
89
|
+
'no-lonely-if': 'warn',
|
|
90
|
+
'no-loop-func': 'error',
|
|
91
|
+
'no-magic-numbers': 'off',
|
|
92
|
+
'no-mixed-operators': 'off',
|
|
93
|
+
'no-multi-assign': 'error',
|
|
94
|
+
'no-multi-str': 'error',
|
|
95
|
+
'no-negated-condition': 'off',
|
|
96
|
+
'no-nested-ternary': 'error',
|
|
97
|
+
'no-new': 'error',
|
|
98
|
+
'no-new-func': 'error',
|
|
99
|
+
'no-new-object': 'off',
|
|
100
|
+
'no-new-wrappers': 'error',
|
|
101
|
+
'no-nonoctal-decimal-escape': 'error',
|
|
102
|
+
'no-object-constructor': 'error',
|
|
103
|
+
'no-octal': 'error',
|
|
104
|
+
'no-octal-escape': 'error',
|
|
105
|
+
'no-param-reassign': 'error',
|
|
106
|
+
'no-plusplus': ['error', {
|
|
107
|
+
allowForLoopAfterthoughts: true
|
|
108
|
+
}],
|
|
109
|
+
'no-proto': 'error',
|
|
110
|
+
'no-redeclare': 'error',
|
|
111
|
+
'no-regex-spaces': 'warn',
|
|
112
|
+
'no-restricted-exports': 'off',
|
|
113
|
+
'no-restricted-globals': 'error',
|
|
114
|
+
'no-restricted-imports': 'error',
|
|
115
|
+
'no-restricted-properties': 'error',
|
|
116
|
+
'no-restricted-syntax': ['error', 'ForInStatement'],
|
|
117
|
+
'no-return-assign': 'error',
|
|
118
|
+
'no-script-url': 'error',
|
|
119
|
+
'no-sequences': ['error', {
|
|
120
|
+
allowInParentheses: false
|
|
121
|
+
}],
|
|
122
|
+
'no-shadow': 'off',
|
|
123
|
+
'no-shadow-restricted-names': 'error',
|
|
124
|
+
'no-ternary': 'off',
|
|
125
|
+
'no-throw-literal': 'error',
|
|
126
|
+
'no-undef-init': 'warn',
|
|
127
|
+
'no-undefined': 'off',
|
|
128
|
+
'no-underscore-dangle': ['error', {
|
|
129
|
+
allowAfterSuper: false,
|
|
130
|
+
allowAfterThis: true,
|
|
131
|
+
allowAfterThisConstructor: false,
|
|
132
|
+
allowFunctionParams: true,
|
|
133
|
+
enforceInMethodNames: true,
|
|
134
|
+
enforceInClassFields: true
|
|
135
|
+
}],
|
|
136
|
+
'no-unneeded-ternary': 'warn',
|
|
137
|
+
'no-unused-expressions': 'error',
|
|
138
|
+
'no-unused-labels': 'warn',
|
|
139
|
+
'no-useless-call': 'error',
|
|
140
|
+
'no-useless-catch': 'error',
|
|
141
|
+
'no-useless-computed-key': 'warn',
|
|
142
|
+
'no-useless-concat': 'error',
|
|
143
|
+
'no-useless-constructor': 'error',
|
|
144
|
+
'no-useless-escape': 'error',
|
|
145
|
+
'no-useless-rename': 'warn',
|
|
146
|
+
'no-useless-return': 'warn',
|
|
147
|
+
'no-var': 'warn',
|
|
148
|
+
'no-void': 'error',
|
|
149
|
+
'no-warning-comments': 'off',
|
|
150
|
+
'no-with': 'error',
|
|
151
|
+
'object-shorthand': ['warn', 'always'],
|
|
152
|
+
'one-var': ['warn', 'never'],
|
|
153
|
+
'one-var-declaration-per-line': 'off',
|
|
154
|
+
'operator-assignment': ['warn', 'always'],
|
|
155
|
+
'prefer-arrow-callback': 'warn',
|
|
156
|
+
'prefer-const': 'warn',
|
|
157
|
+
'prefer-destructuring': 'off',
|
|
158
|
+
'prefer-exponentiation-operator': 'warn',
|
|
159
|
+
'prefer-named-capture-group': 'off',
|
|
160
|
+
'prefer-numeric-literals': 'warn',
|
|
161
|
+
'prefer-object-has-own': 'off',
|
|
162
|
+
'prefer-object-spread': 'warn',
|
|
163
|
+
'prefer-promise-reject-errors': 'error',
|
|
164
|
+
'prefer-regex-literals': 'off',
|
|
165
|
+
'prefer-rest-params': 'error',
|
|
166
|
+
'prefer-spread': 'error',
|
|
167
|
+
'prefer-template': 'warn',
|
|
168
|
+
'quote-props': 'off',
|
|
169
|
+
'radix': 'error',
|
|
170
|
+
'require-await': 'error',
|
|
171
|
+
'require-unicode-regexp': 'error',
|
|
172
|
+
'require-yield': 'error',
|
|
173
|
+
'sort-imports': 'off',
|
|
174
|
+
'sort-keys': 'off',
|
|
175
|
+
'sort-vars': 'off',
|
|
176
|
+
'spaced-comment': 'off',
|
|
177
|
+
'strict': 'warn',
|
|
178
|
+
'symbol-description': 'error',
|
|
179
|
+
'vars-on-top': 'error',
|
|
180
|
+
'yoda': ['warn', 'never']
|
|
181
|
+
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
'eslint-comments/no-unused-disable': 'error',
|
|
10
|
-
'eslint-comments/no-unused-enable': 'error',
|
|
11
|
-
};
|
|
1
|
+
export const bestPracticesRules = {
|
|
2
|
+
'eslint-comments/disable-enable-pair': 'error',
|
|
3
|
+
'eslint-comments/no-aggregating-enable': 'error',
|
|
4
|
+
'eslint-comments/no-duplicate-disable': 'error',
|
|
5
|
+
'eslint-comments/no-unlimited-disable': 'error',
|
|
6
|
+
'eslint-comments/no-unused-disable': 'error',
|
|
7
|
+
'eslint-comments/no-unused-enable': 'error'
|
|
8
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as eslintPluginEslintComments from 'eslint-plugin-eslint-comments';
|
|
2
1
|
export declare const eslintCommentsConfig: {
|
|
3
2
|
plugins: {
|
|
4
|
-
'eslint-comments':
|
|
3
|
+
'eslint-comments': import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.Plugin;
|
|
5
4
|
};
|
|
6
5
|
rules: {
|
|
7
6
|
'eslint-comments/no-restricted-disable': string;
|
|
@@ -1,45 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.eslintCommentsConfig = void 0;
|
|
37
|
-
const eslintPluginEslintComments = __importStar(require("eslint-plugin-eslint-comments"));
|
|
38
|
-
const best_practices_1 = require("./best-practices");
|
|
39
|
-
const stylistic_issues_1 = require("./stylistic-issues");
|
|
40
|
-
exports.eslintCommentsConfig = {
|
|
41
|
-
plugins: {
|
|
42
|
-
'eslint-comments': eslintPluginEslintComments,
|
|
43
|
-
},
|
|
44
|
-
rules: Object.assign(Object.assign({}, best_practices_1.bestPracticesRules), stylistic_issues_1.stylisticIssuesRules),
|
|
45
|
-
};
|
|
1
|
+
import eslintPluginEslintComments from 'eslint-plugin-eslint-comments';
|
|
2
|
+
import { bestPracticesRules } from "./best-practices.js";
|
|
3
|
+
import { stylisticIssuesRules } from "./stylistic-issues.js";
|
|
4
|
+
export const eslintCommentsConfig = {
|
|
5
|
+
plugins: {
|
|
6
|
+
'eslint-comments': eslintPluginEslintComments
|
|
7
|
+
},
|
|
8
|
+
rules: Object.assign(Object.assign({}, bestPracticesRules), stylisticIssuesRules)
|
|
9
|
+
};
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
'eslint-enable',
|
|
11
|
-
],
|
|
12
|
-
}],
|
|
13
|
-
'eslint-comments/require-description': ['error', {
|
|
14
|
-
ignore: [
|
|
15
|
-
'eslint-enable',
|
|
16
|
-
],
|
|
17
|
-
}],
|
|
18
|
-
};
|
|
1
|
+
export const stylisticIssuesRules = {
|
|
2
|
+
'eslint-comments/no-restricted-disable': 'off',
|
|
3
|
+
'eslint-comments/no-use': ['error', {
|
|
4
|
+
allow: ['eslint-disable', 'eslint-disable-next-line', 'eslint-enable']
|
|
5
|
+
}],
|
|
6
|
+
'eslint-comments/require-description': ['error', {
|
|
7
|
+
ignore: ['eslint-enable']
|
|
8
|
+
}]
|
|
9
|
+
};
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
'import/no-named-as-default-member': 'error',
|
|
13
|
-
'import/no-unused-modules': 'error',
|
|
14
|
-
};
|
|
1
|
+
import { importNoExtraneousDependencies } from "./rules/no-extraneous-dependencies.js";
|
|
2
|
+
export const helpfulWarningsRules = {
|
|
3
|
+
'import/export': 'error',
|
|
4
|
+
'import/no-deprecated': 'off',
|
|
5
|
+
'import/no-empty-named-blocks': 'warn',
|
|
6
|
+
'import/no-extraneous-dependencies': ['error', importNoExtraneousDependencies()],
|
|
7
|
+
'import/no-mutable-exports': 'error',
|
|
8
|
+
'import/no-named-as-default': 'error',
|
|
9
|
+
'import/no-named-as-default-member': 'error',
|
|
10
|
+
'import/no-unused-modules': 'error'
|
|
11
|
+
};
|
package/rules/import/index.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
rules: Object.assign(Object.assign(Object.assign(Object.assign({}, static_analysis_1.staticAnalysisRules), helpful_warnings_1.helpfulWarningsRules), module_systems_1.moduleSystemsRules), style_guide_1.styleGuideRules),
|
|
14
|
-
};
|
|
1
|
+
import { flatConfigs } from 'eslint-plugin-import';
|
|
2
|
+
import { helpfulWarningsRules } from "./helpful-warnings.js";
|
|
3
|
+
import { moduleSystemsRules } from "./module-systems.js";
|
|
4
|
+
import { staticAnalysisRules } from "./static-analysis.js";
|
|
5
|
+
import { styleGuideRules } from "./style-guide.js";
|
|
6
|
+
export const importConfig = {
|
|
7
|
+
plugins: {
|
|
8
|
+
import: flatConfigs.recommended.plugins.import
|
|
9
|
+
},
|
|
10
|
+
rules: Object.assign(Object.assign(Object.assign(Object.assign({}, staticAnalysisRules), helpfulWarningsRules), moduleSystemsRules), styleGuideRules)
|
|
11
|
+
};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'import/no-nodejs-modules': 'off',
|
|
12
|
-
'import/unambiguous': 'error',
|
|
13
|
-
};
|
|
1
|
+
export const moduleSystemsRules = {
|
|
2
|
+
'import/no-amd': 'error',
|
|
3
|
+
'import/no-commonjs': ['error', {
|
|
4
|
+
allowConditionalRequire: true,
|
|
5
|
+
allowPrimitiveModules: true
|
|
6
|
+
}],
|
|
7
|
+
'import/no-import-module-exports': 'error',
|
|
8
|
+
'import/no-nodejs-modules': 'off',
|
|
9
|
+
'import/unambiguous': 'error'
|
|
10
|
+
};
|
|
@@ -5,6 +5,9 @@ export interface ImportNoExtraneousDependencies {
|
|
|
5
5
|
bundledDependencies: boolean | string[];
|
|
6
6
|
packageDir?: string;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Returns configuration for the `import/no-extraneous-dependencies` rule.
|
|
10
|
+
*/
|
|
8
11
|
export declare function importNoExtraneousDependencies(overrides?: Partial<ImportNoExtraneousDependencies>): ImportNoExtraneousDependencies;
|
|
9
12
|
export declare function jsImportNoExtraneousDependencies(devDependencies?: boolean | string[]): ImportNoExtraneousDependencies;
|
|
10
13
|
export declare function jestImportNoExtraneousDependencies(devDependencies?: boolean | string[]): ImportNoExtraneousDependencies;
|