@perfective/eslint-config 0.29.2 → 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 -18
- package/README.md +20 -16
- 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 -56
- package/index.d.ts +46 -12
- package/index.js +100 -144
- package/jest-dom.js +8 -11
- package/jest.d.ts +6 -0
- package/jest.js +29 -24
- package/package.json +18 -17
- 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
package/rules/unicorn/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ export declare const unicornConfig: {
|
|
|
2
2
|
plugins: {
|
|
3
3
|
unicorn: import("eslint").ESLint.Plugin & {
|
|
4
4
|
configs: {
|
|
5
|
-
recommended: import("eslint").Linter.
|
|
6
|
-
all: import("eslint").Linter.
|
|
5
|
+
recommended: import("eslint").Linter.FlatConfig;
|
|
6
|
+
all: import("eslint").Linter.FlatConfig;
|
|
7
7
|
"flat/all": import("eslint").Linter.FlatConfig;
|
|
8
8
|
"flat/recommended": import("eslint").Linter.FlatConfig;
|
|
9
9
|
};
|
|
@@ -12,6 +12,8 @@ export declare const unicornConfig: {
|
|
|
12
12
|
rules: {
|
|
13
13
|
'unicorn/better-regex': string;
|
|
14
14
|
'unicorn/catch-error-name': string;
|
|
15
|
+
'unicorn/consistent-assert': string;
|
|
16
|
+
'unicorn/consistent-date-clone': string;
|
|
15
17
|
'unicorn/consistent-destructuring': string;
|
|
16
18
|
'unicorn/consistent-empty-array-spread': string;
|
|
17
19
|
'unicorn/consistent-existence-index-check': string;
|
|
@@ -31,6 +33,7 @@ export declare const unicornConfig: {
|
|
|
31
33
|
'unicorn/import-style': string;
|
|
32
34
|
'unicorn/new-for-builtins': string;
|
|
33
35
|
'unicorn/no-abusive-eslint-disable': string;
|
|
36
|
+
'unicorn/no-accessor-recursion': string;
|
|
34
37
|
'unicorn/no-anonymous-default-export': string;
|
|
35
38
|
'unicorn/no-array-callback-reference': string;
|
|
36
39
|
'unicorn/no-array-for-each': string;
|
|
@@ -47,6 +50,7 @@ export declare const unicornConfig: {
|
|
|
47
50
|
'unicorn/no-for-loop': string;
|
|
48
51
|
'unicorn/no-hex-escape': string;
|
|
49
52
|
'unicorn/no-instanceof-array': string;
|
|
53
|
+
'unicorn/no-instanceof-builtins': string;
|
|
50
54
|
'unicorn/no-invalid-fetch-options': string;
|
|
51
55
|
'unicorn/no-invalid-remove-event-listener': string;
|
|
52
56
|
'unicorn/no-keyword-prefix': (string | {
|
|
@@ -57,6 +61,7 @@ export declare const unicornConfig: {
|
|
|
57
61
|
'unicorn/no-length-as-slice-end': string;
|
|
58
62
|
'unicorn/no-lonely-if': string;
|
|
59
63
|
'unicorn/no-magic-array-flat-depth': string;
|
|
64
|
+
'unicorn/no-named-default': string;
|
|
60
65
|
'unicorn/no-negated-condition': string;
|
|
61
66
|
'unicorn/no-negation-in-equality-check': string;
|
|
62
67
|
'unicorn/no-nested-ternary': string;
|
package/rules/unicorn/index.js
CHANGED
|
@@ -1,209 +1,178 @@
|
|
|
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
|
-
'unicorn/prefer-query-selector': 'warn',
|
|
180
|
-
'unicorn/prefer-reflect-apply': 'warn',
|
|
181
|
-
'unicorn/prefer-regexp-test': 'off',
|
|
182
|
-
'unicorn/prefer-set-has': 'warn',
|
|
183
|
-
'unicorn/prefer-set-size': 'warn',
|
|
184
|
-
'unicorn/prefer-spread': 'off',
|
|
185
|
-
'unicorn/prefer-string-raw': 'off',
|
|
186
|
-
'unicorn/prefer-string-replace-all': 'off',
|
|
187
|
-
'unicorn/prefer-string-slice': 'warn',
|
|
188
|
-
'unicorn/prefer-string-starts-ends-with': 'warn',
|
|
189
|
-
'unicorn/prefer-string-trim-start-end': 'warn',
|
|
190
|
-
'unicorn/prefer-structured-clone': 'off',
|
|
191
|
-
'unicorn/prefer-switch': ['error', {
|
|
192
|
-
minimumCases: 3,
|
|
193
|
-
emptyDefaultCase: 'do-nothing-comment',
|
|
194
|
-
}],
|
|
195
|
-
'unicorn/prefer-ternary': 'off',
|
|
196
|
-
'unicorn/prefer-top-level-await': 'off',
|
|
197
|
-
'unicorn/prefer-type-error': 'warn',
|
|
198
|
-
'unicorn/prevent-abbreviations': ['warn', (0, prevent_abbreviations_1.unicornPreventAbbreviations)()],
|
|
199
|
-
'unicorn/relative-url-style': ['warn', 'always'],
|
|
200
|
-
'unicorn/require-array-join-separator': 'warn',
|
|
201
|
-
'unicorn/require-number-to-fixed-digits-argument': 'warn',
|
|
202
|
-
'unicorn/require-post-message-target-origin': 'error',
|
|
203
|
-
'unicorn/string-content': 'off',
|
|
204
|
-
'unicorn/switch-case-braces': 'off',
|
|
205
|
-
'unicorn/template-indent': 'warn',
|
|
206
|
-
'unicorn/text-encoding-identifier-case': 'error',
|
|
207
|
-
'unicorn/throw-new-error': 'warn',
|
|
208
|
-
},
|
|
209
|
-
};
|
|
1
|
+
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
|
|
2
|
+
import { unicornPreventAbbreviations } from "./rules/prevent-abbreviations.js";
|
|
3
|
+
export const unicornConfig = {
|
|
4
|
+
plugins: {
|
|
5
|
+
unicorn: eslintPluginUnicorn
|
|
6
|
+
},
|
|
7
|
+
rules: {
|
|
8
|
+
'unicorn/better-regex': 'warn',
|
|
9
|
+
'unicorn/catch-error-name': 'warn',
|
|
10
|
+
'unicorn/consistent-assert': 'warn',
|
|
11
|
+
'unicorn/consistent-date-clone': 'warn',
|
|
12
|
+
'unicorn/consistent-destructuring': 'warn',
|
|
13
|
+
'unicorn/consistent-empty-array-spread': 'warn',
|
|
14
|
+
'unicorn/consistent-existence-index-check': 'warn',
|
|
15
|
+
'unicorn/consistent-function-scoping': ['error', {
|
|
16
|
+
checkArrowFunctions: true
|
|
17
|
+
}],
|
|
18
|
+
'unicorn/custom-error-definition': 'warn',
|
|
19
|
+
'unicorn/empty-brace-spaces': 'warn',
|
|
20
|
+
'unicorn/error-message': 'error',
|
|
21
|
+
'unicorn/escape-case': 'warn',
|
|
22
|
+
'unicorn/expiring-todo-comments': 'error',
|
|
23
|
+
'unicorn/explicit-length-check': 'warn',
|
|
24
|
+
'unicorn/filename-case': ['error', {
|
|
25
|
+
case: 'kebabCase'
|
|
26
|
+
}],
|
|
27
|
+
'unicorn/import-index': 'off',
|
|
28
|
+
'unicorn/import-style': 'off',
|
|
29
|
+
'unicorn/new-for-builtins': 'warn',
|
|
30
|
+
'unicorn/no-abusive-eslint-disable': 'error',
|
|
31
|
+
'unicorn/no-accessor-recursion': 'error',
|
|
32
|
+
'unicorn/no-anonymous-default-export': 'error',
|
|
33
|
+
'unicorn/no-array-callback-reference': 'off',
|
|
34
|
+
'unicorn/no-array-for-each': 'off',
|
|
35
|
+
'unicorn/no-array-method-this-argument': 'warn',
|
|
36
|
+
'unicorn/no-array-push-push': ['warn', {
|
|
37
|
+
ignore: ['readable', 'this', 'this.stream']
|
|
38
|
+
}],
|
|
39
|
+
'unicorn/no-array-reduce': 'off',
|
|
40
|
+
'unicorn/no-await-expression-member': 'error',
|
|
41
|
+
'unicorn/no-await-in-promise-methods': 'error',
|
|
42
|
+
'unicorn/no-console-spaces': 'warn',
|
|
43
|
+
'unicorn/no-document-cookie': 'error',
|
|
44
|
+
'unicorn/no-empty-file': 'error',
|
|
45
|
+
'unicorn/no-for-loop': 'warn',
|
|
46
|
+
'unicorn/no-hex-escape': 'warn',
|
|
47
|
+
'unicorn/no-instanceof-array': 'off',
|
|
48
|
+
'unicorn/no-instanceof-builtins': 'warn',
|
|
49
|
+
'unicorn/no-invalid-fetch-options': 'error',
|
|
50
|
+
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
51
|
+
'unicorn/no-keyword-prefix': ['off', {
|
|
52
|
+
disallowedPrefixes: ['new', 'class'],
|
|
53
|
+
checkProperties: true,
|
|
54
|
+
onlyCamelCase: false
|
|
55
|
+
}],
|
|
56
|
+
'unicorn/no-length-as-slice-end': 'warn',
|
|
57
|
+
'unicorn/no-lonely-if': 'warn',
|
|
58
|
+
'unicorn/no-magic-array-flat-depth': 'error',
|
|
59
|
+
'unicorn/no-named-default': 'warn',
|
|
60
|
+
'unicorn/no-negated-condition': 'warn',
|
|
61
|
+
'unicorn/no-negation-in-equality-check': 'error',
|
|
62
|
+
'unicorn/no-nested-ternary': 'off',
|
|
63
|
+
'unicorn/no-new-array': 'warn',
|
|
64
|
+
'unicorn/no-new-buffer': 'warn',
|
|
65
|
+
'unicorn/no-null': 'off',
|
|
66
|
+
'unicorn/no-object-as-default-parameter': 'error',
|
|
67
|
+
'unicorn/no-process-exit': 'error',
|
|
68
|
+
'unicorn/no-single-promise-in-promise-methods': 'warn',
|
|
69
|
+
'unicorn/no-static-only-class': 'error',
|
|
70
|
+
'unicorn/no-thenable': 'error',
|
|
71
|
+
'unicorn/no-this-assignment': 'error',
|
|
72
|
+
'unicorn/no-typeof-undefined': ['warn', {
|
|
73
|
+
checkGlobalVariables: true
|
|
74
|
+
}],
|
|
75
|
+
'unicorn/no-unnecessary-await': 'warn',
|
|
76
|
+
'unicorn/no-unnecessary-polyfills': 'error',
|
|
77
|
+
'unicorn/no-unreadable-array-destructuring': 'error',
|
|
78
|
+
'unicorn/no-unreadable-iife': 'error',
|
|
79
|
+
'unicorn/no-unsafe-regex': 'off',
|
|
80
|
+
'unicorn/no-unused-properties': 'off',
|
|
81
|
+
'unicorn/no-useless-fallback-in-spread': 'warn',
|
|
82
|
+
'unicorn/no-useless-length-check': 'warn',
|
|
83
|
+
'unicorn/no-useless-promise-resolve-reject': 'warn',
|
|
84
|
+
'unicorn/no-useless-spread': 'warn',
|
|
85
|
+
'unicorn/no-useless-switch-case': 'error',
|
|
86
|
+
'unicorn/no-useless-undefined': 'off',
|
|
87
|
+
'unicorn/no-zero-fractions': 'off',
|
|
88
|
+
'unicorn/number-literal-case': 'warn',
|
|
89
|
+
'unicorn/numeric-separators-style': ['warn', {
|
|
90
|
+
hexadecimal: {
|
|
91
|
+
minimumDigits: 6,
|
|
92
|
+
groupLength: 2
|
|
93
|
+
},
|
|
94
|
+
binary: {
|
|
95
|
+
minimumDigits: 0,
|
|
96
|
+
groupLength: 4
|
|
97
|
+
},
|
|
98
|
+
octal: {
|
|
99
|
+
minimumDigits: 0,
|
|
100
|
+
groupLength: 4
|
|
101
|
+
},
|
|
102
|
+
number: {
|
|
103
|
+
minimumDigits: 6,
|
|
104
|
+
groupLength: 3
|
|
105
|
+
}
|
|
106
|
+
}],
|
|
107
|
+
'unicorn/prefer-add-event-listener': 'warn',
|
|
108
|
+
'unicorn/prefer-array-find': ['warn', {
|
|
109
|
+
checkFromLast: true
|
|
110
|
+
}],
|
|
111
|
+
'unicorn/prefer-array-flat': 'off',
|
|
112
|
+
'unicorn/prefer-array-flat-map': 'off',
|
|
113
|
+
'unicorn/prefer-array-index-of': 'warn',
|
|
114
|
+
'unicorn/prefer-array-some': 'error',
|
|
115
|
+
'unicorn/prefer-at': 'off',
|
|
116
|
+
'unicorn/prefer-blob-reading-methods': 'error',
|
|
117
|
+
'unicorn/prefer-code-point': 'error',
|
|
118
|
+
'unicorn/prefer-date-now': 'warn',
|
|
119
|
+
'unicorn/prefer-default-parameters': 'warn',
|
|
120
|
+
'unicorn/prefer-dom-node-append': 'warn',
|
|
121
|
+
'unicorn/prefer-dom-node-dataset': 'warn',
|
|
122
|
+
'unicorn/prefer-dom-node-remove': 'warn',
|
|
123
|
+
'unicorn/prefer-dom-node-text-content': 'warn',
|
|
124
|
+
'unicorn/prefer-event-target': 'error',
|
|
125
|
+
'unicorn/prefer-export-from': 'warn',
|
|
126
|
+
'unicorn/prefer-global-this': 'warn',
|
|
127
|
+
'unicorn/prefer-includes': 'warn',
|
|
128
|
+
'unicorn/prefer-json-parse-buffer': 'warn',
|
|
129
|
+
'unicorn/prefer-keyboard-event-key': 'warn',
|
|
130
|
+
'unicorn/prefer-logical-operator-over-ternary': 'error',
|
|
131
|
+
'unicorn/prefer-math-min-max': 'warn',
|
|
132
|
+
'unicorn/prefer-math-trunc': 'warn',
|
|
133
|
+
'unicorn/prefer-modern-dom-apis': 'warn',
|
|
134
|
+
'unicorn/prefer-modern-math-apis': 'warn',
|
|
135
|
+
'unicorn/prefer-module': 'off',
|
|
136
|
+
'unicorn/prefer-native-coercion-functions': 'warn',
|
|
137
|
+
'unicorn/prefer-negative-index': 'warn',
|
|
138
|
+
'unicorn/prefer-node-protocol': 'warn',
|
|
139
|
+
'unicorn/prefer-number-properties': ['warn', {
|
|
140
|
+
checkInfinity: true,
|
|
141
|
+
checkNaN: true
|
|
142
|
+
}],
|
|
143
|
+
'unicorn/prefer-object-from-entries': ['off', {
|
|
144
|
+
functions: []
|
|
145
|
+
}],
|
|
146
|
+
'unicorn/prefer-optional-catch-binding': 'warn',
|
|
147
|
+
'unicorn/prefer-prototype-methods': 'warn',
|
|
148
|
+
'unicorn/prefer-query-selector': 'warn',
|
|
149
|
+
'unicorn/prefer-reflect-apply': 'warn',
|
|
150
|
+
'unicorn/prefer-regexp-test': 'off',
|
|
151
|
+
'unicorn/prefer-set-has': 'warn',
|
|
152
|
+
'unicorn/prefer-set-size': 'warn',
|
|
153
|
+
'unicorn/prefer-spread': 'off',
|
|
154
|
+
'unicorn/prefer-string-raw': 'off',
|
|
155
|
+
'unicorn/prefer-string-replace-all': 'off',
|
|
156
|
+
'unicorn/prefer-string-slice': 'warn',
|
|
157
|
+
'unicorn/prefer-string-starts-ends-with': 'warn',
|
|
158
|
+
'unicorn/prefer-string-trim-start-end': 'warn',
|
|
159
|
+
'unicorn/prefer-structured-clone': 'off',
|
|
160
|
+
'unicorn/prefer-switch': ['error', {
|
|
161
|
+
minimumCases: 3,
|
|
162
|
+
emptyDefaultCase: 'do-nothing-comment'
|
|
163
|
+
}],
|
|
164
|
+
'unicorn/prefer-ternary': 'off',
|
|
165
|
+
'unicorn/prefer-top-level-await': 'off',
|
|
166
|
+
'unicorn/prefer-type-error': 'warn',
|
|
167
|
+
'unicorn/prevent-abbreviations': ['warn', unicornPreventAbbreviations()],
|
|
168
|
+
'unicorn/relative-url-style': ['warn', 'always'],
|
|
169
|
+
'unicorn/require-array-join-separator': 'warn',
|
|
170
|
+
'unicorn/require-number-to-fixed-digits-argument': 'warn',
|
|
171
|
+
'unicorn/require-post-message-target-origin': 'error',
|
|
172
|
+
'unicorn/string-content': 'off',
|
|
173
|
+
'unicorn/switch-case-braces': 'off',
|
|
174
|
+
'unicorn/template-indent': 'warn',
|
|
175
|
+
'unicorn/text-encoding-identifier-case': 'error',
|
|
176
|
+
'unicorn/throw-new-error': 'warn'
|
|
177
|
+
}
|
|
178
|
+
};
|
|
@@ -12,4 +12,12 @@ export interface UnicornPreventAbbreviations {
|
|
|
12
12
|
checkFilenames: boolean;
|
|
13
13
|
ignore: RegExp[];
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Allows to extend unicorn/prevent-abbreviation rules replacements, instead of overriding them.
|
|
17
|
+
*
|
|
18
|
+
* @param replacements - List of additional replacements.
|
|
19
|
+
* @param options - Additional properties to override.
|
|
20
|
+
*
|
|
21
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prevent-abbreviations.md
|
|
22
|
+
*/
|
|
15
23
|
export declare function unicornPreventAbbreviations(replacements?: UnicornPreventAbbreviationReplacements, options?: Partial<Pick<UnicornPreventAbbreviations, 'checkProperties'>>): UnicornPreventAbbreviations;
|
|
@@ -1,8 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export function unicornPreventAbbreviations(replacements = {}, options = {}) {
|
|
2
|
+
return Object.assign(Object.assign({
|
|
3
|
+
replacements: Object.assign({
|
|
4
|
+
arg: false,
|
|
5
|
+
args: false,
|
|
6
|
+
db: false,
|
|
7
|
+
doc: false,
|
|
8
|
+
docs: false,
|
|
9
|
+
dev: false,
|
|
10
|
+
env: false,
|
|
11
|
+
i: false,
|
|
12
|
+
j: false,
|
|
13
|
+
lib: false,
|
|
14
|
+
libs: false,
|
|
15
|
+
param: false,
|
|
16
|
+
params: false
|
|
17
|
+
}, replacements),
|
|
18
|
+
extendDefaultReplacements: true,
|
|
19
|
+
allowList: {},
|
|
20
|
+
extendDefaultAllowList: true,
|
|
21
|
+
checkDefaultAndNamespaceImports: 'internal',
|
|
22
|
+
checkShorthandImports: 'internal',
|
|
23
|
+
checkShorthandProperties: false,
|
|
24
|
+
checkProperties: false,
|
|
25
|
+
checkVariables: true,
|
|
26
|
+
checkFilenames: true
|
|
27
|
+
}, options), {
|
|
28
|
+
ignore: [/e2e/u]
|
|
29
|
+
});
|
|
30
|
+
}
|
package/rules.js
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "cypressImportNoExtraneousDependencies", { enumerable: true, get: function () { return no_extraneous_dependencies_1.cypressImportNoExtraneousDependencies; } });
|
|
6
|
-
Object.defineProperty(exports, "importNoExtraneousDependencies", { enumerable: true, get: function () { return no_extraneous_dependencies_1.importNoExtraneousDependencies; } });
|
|
7
|
-
Object.defineProperty(exports, "jestImportNoExtraneousDependencies", { enumerable: true, get: function () { return no_extraneous_dependencies_1.jestImportNoExtraneousDependencies; } });
|
|
8
|
-
Object.defineProperty(exports, "jsImportNoExtraneousDependencies", { enumerable: true, get: function () { return no_extraneous_dependencies_1.jsImportNoExtraneousDependencies; } });
|
|
9
|
-
var imports_1 = require("./rules/simple-import-sort/rules/imports");
|
|
10
|
-
Object.defineProperty(exports, "simpleImportSortImports", { enumerable: true, get: function () { return imports_1.simpleImportSortImports; } });
|
|
11
|
-
var typescript_eslint_naming_convention_1 = require("./rules/typescript-eslint/rules/typescript-eslint-naming-convention");
|
|
12
|
-
Object.defineProperty(exports, "typescriptEslintNamingConvention", { enumerable: true, get: function () { return typescript_eslint_naming_convention_1.typescriptEslintNamingConvention; } });
|
|
13
|
-
var prevent_abbreviations_1 = require("./rules/unicorn/rules/prevent-abbreviations");
|
|
14
|
-
Object.defineProperty(exports, "unicornPreventAbbreviations", { enumerable: true, get: function () { return prevent_abbreviations_1.unicornPreventAbbreviations; } });
|
|
1
|
+
export { cypressImportNoExtraneousDependencies, importNoExtraneousDependencies, jestImportNoExtraneousDependencies, jsImportNoExtraneousDependencies } from "./rules/import/rules/no-extraneous-dependencies.js";
|
|
2
|
+
export { simpleImportSortImports } from "./rules/simple-import-sort/rules/imports.js";
|
|
3
|
+
export { typescriptEslintNamingConvention } from "./rules/typescript-eslint/rules/typescript-eslint-naming-convention.js";
|
|
4
|
+
export { unicornPreventAbbreviations } from "./rules/unicorn/rules/prevent-abbreviations.js";
|
package/rxjs.d.ts
CHANGED
package/rxjs.js
CHANGED
|
@@ -1,58 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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.rxjsConfig = rxjsConfig;
|
|
37
|
-
const tsEslint = __importStar(require("typescript-eslint"));
|
|
38
|
-
const rxjs_1 = require("./rules/rxjs");
|
|
39
|
-
function rxjsConfig(files = ['**/*.ts?(x)']) {
|
|
40
|
-
return {
|
|
41
|
-
files,
|
|
42
|
-
languageOptions: {
|
|
43
|
-
sourceType: 'module',
|
|
44
|
-
ecmaVersion: 'latest',
|
|
45
|
-
parser: tsEslint.parser,
|
|
46
|
-
parserOptions: {
|
|
47
|
-
ecmaFeatures: {
|
|
48
|
-
globalReturn: false,
|
|
49
|
-
impliedStrict: true,
|
|
50
|
-
},
|
|
51
|
-
projectService: true,
|
|
52
|
-
warnOnUnsupportedTypeScriptVersion: true,
|
|
53
|
-
},
|
|
1
|
+
import { parser } from 'typescript-eslint';
|
|
2
|
+
import { rxjsConfig as rxjsPluginConfig } from "./rules/rxjs/index.js";
|
|
3
|
+
export function rxjsConfig(files = ['**/*.ts?(x)']) {
|
|
4
|
+
return {
|
|
5
|
+
files,
|
|
6
|
+
languageOptions: {
|
|
7
|
+
sourceType: 'module',
|
|
8
|
+
ecmaVersion: 'latest',
|
|
9
|
+
parser,
|
|
10
|
+
parserOptions: {
|
|
11
|
+
ecmaFeatures: {
|
|
12
|
+
globalReturn: false,
|
|
13
|
+
impliedStrict: true
|
|
54
14
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
15
|
+
projectService: true,
|
|
16
|
+
warnOnUnsupportedTypeScriptVersion: true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
plugins: Object.assign({}, rxjsPluginConfig.plugins),
|
|
20
|
+
rules: Object.assign({}, rxjsPluginConfig.rules)
|
|
21
|
+
};
|
|
22
|
+
}
|