@dartess/eslint-plugin 0.0.8 → 0.0.9
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/CHANGELOG.md +7 -0
- package/dist/configs/recommended.js +9 -2
- package/dist/configs/vendor-rules/best-practices.d.ts +1 -3
- package/dist/configs/vendor-rules/best-practices.js +1 -8
- package/dist/configs/vendor-rules/es6.d.ts +0 -5
- package/dist/configs/vendor-rules/es6.js +0 -11
- package/dist/configs/vendor-rules/react.d.ts +0 -3
- package/dist/configs/vendor-rules/react.js +1 -8
- package/dist/configs/vendor-rules/typescript.d.ts +0 -3
- package/dist/configs/vendor-rules/typescript.js +2 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
[//]: # (https://keepachangelog.com/en/1.1.0/)
|
|
4
4
|
|
|
5
|
+
## [0.0.9] - 2026-01-02
|
|
6
|
+
|
|
7
|
+
- remove overriding `@typescript-eslint/return-await` rule
|
|
8
|
+
- cleanup disabled rules
|
|
9
|
+
- add `prefer-object-has-own` to `recomended`: previously was disabled because of old browsers support
|
|
10
|
+
- apply `no-throw-literal` only for `js`-files (for `ts` files already enabled `@typescript-eslint/only-throw-error`)
|
|
11
|
+
|
|
5
12
|
## [0.0.8] - 2025-12-28
|
|
6
13
|
|
|
7
14
|
- update `README`
|
|
@@ -49,7 +49,6 @@ const config = [
|
|
|
49
49
|
plugins: {
|
|
50
50
|
unicorn: eslintPluginUnicorn,
|
|
51
51
|
'@dartess': dartessPlugin,
|
|
52
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- https://github.com/NullVoxPopuli/eslint-plugin-decorator-position/issues/778
|
|
53
52
|
'decorator-position': eslintPluginDecoratorPosition,
|
|
54
53
|
},
|
|
55
54
|
languageOptions: {
|
|
@@ -224,8 +223,16 @@ const config = [
|
|
|
224
223
|
},
|
|
225
224
|
},
|
|
226
225
|
{
|
|
227
|
-
files: ['**/*.js'],
|
|
226
|
+
files: ['**/*.js', '**/*.mjs', '**/*.cjs', '**/*.jsx'],
|
|
228
227
|
...tsEslint.configs.disableTypeChecked,
|
|
229
228
|
},
|
|
229
|
+
{
|
|
230
|
+
name: '@dartess/recommended-js',
|
|
231
|
+
files: ['**/*.js', '**/*.mjs', '**/*.cjs', '**/*.jsx'],
|
|
232
|
+
rules: {
|
|
233
|
+
// enable for js files only
|
|
234
|
+
'no-throw-literal': 'error',
|
|
235
|
+
},
|
|
236
|
+
},
|
|
230
237
|
];
|
|
231
238
|
export default config;
|
|
@@ -87,19 +87,17 @@ declare const rules: {
|
|
|
87
87
|
'no-script-url': "error";
|
|
88
88
|
'no-self-compare': "error";
|
|
89
89
|
'no-sequences': "error";
|
|
90
|
-
'no-throw-literal': "error";
|
|
91
90
|
'no-useless-concat': "error";
|
|
92
91
|
'no-useless-return': "error";
|
|
93
92
|
'no-void': "error";
|
|
94
93
|
'prefer-promise-reject-errors': ["error", {
|
|
95
94
|
allowEmptyReject: boolean;
|
|
96
95
|
}];
|
|
97
|
-
'prefer-object-has-own': "
|
|
96
|
+
'prefer-object-has-own': "error";
|
|
98
97
|
'prefer-regex-literals': ["error", {
|
|
99
98
|
disallowRedundantWrapping: boolean;
|
|
100
99
|
}];
|
|
101
100
|
radix: "error";
|
|
102
|
-
'require-await': "off";
|
|
103
101
|
'vars-on-top': "error";
|
|
104
102
|
yoda: "error";
|
|
105
103
|
};
|
|
@@ -171,9 +171,6 @@ const rules = {
|
|
|
171
171
|
// disallow use of comma operator
|
|
172
172
|
// https://eslint.org/docs/rules/no-sequences
|
|
173
173
|
'no-sequences': 'error',
|
|
174
|
-
// restrict what can be thrown as an exception
|
|
175
|
-
// https://eslint.org/docs/rules/no-throw-literal
|
|
176
|
-
'no-throw-literal': 'error',
|
|
177
174
|
// disallow useless string concatenation
|
|
178
175
|
// https://eslint.org/docs/rules/no-useless-concat
|
|
179
176
|
'no-useless-concat': 'error',
|
|
@@ -188,8 +185,7 @@ const rules = {
|
|
|
188
185
|
'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],
|
|
189
186
|
// Prefer Object.hasOwn() over Object.prototype.hasOwnProperty.call()
|
|
190
187
|
// https://eslint.org/docs/rules/prefer-object-has-own
|
|
191
|
-
|
|
192
|
-
'prefer-object-has-own': 'off',
|
|
188
|
+
'prefer-object-has-own': 'error',
|
|
193
189
|
// https://eslint.org/docs/rules/prefer-regex-literals
|
|
194
190
|
'prefer-regex-literals': [
|
|
195
191
|
'error',
|
|
@@ -200,9 +196,6 @@ const rules = {
|
|
|
200
196
|
// require use of the second argument for parseInt()
|
|
201
197
|
// https://eslint.org/docs/rules/radix
|
|
202
198
|
radix: 'error',
|
|
203
|
-
// require `await` in `async function` (note: this is a horrible rule that should never be used)
|
|
204
|
-
// https://eslint.org/docs/rules/require-await
|
|
205
|
-
'require-await': 'off',
|
|
206
199
|
// requires to declare all vars on top of their containing scope
|
|
207
200
|
// https://eslint.org/docs/rules/vars-on-top
|
|
208
201
|
'vars-on-top': 'error',
|
|
@@ -2,17 +2,12 @@ declare const rules: {
|
|
|
2
2
|
'no-restricted-exports': ["error", {
|
|
3
3
|
restrictedNamedExports: string[];
|
|
4
4
|
}];
|
|
5
|
-
'no-restricted-imports': ["off", {
|
|
6
|
-
paths: never[];
|
|
7
|
-
patterns: never[];
|
|
8
|
-
}];
|
|
9
5
|
'no-useless-computed-key': "error";
|
|
10
6
|
'no-useless-rename': ["error", {
|
|
11
7
|
ignoreDestructuring: boolean;
|
|
12
8
|
ignoreImport: boolean;
|
|
13
9
|
ignoreExport: boolean;
|
|
14
10
|
}];
|
|
15
|
-
'no-var': "error";
|
|
16
11
|
'object-shorthand': ["error", string, {
|
|
17
12
|
ignoreConstructors: boolean;
|
|
18
13
|
avoidQuotes: boolean;
|
|
@@ -14,15 +14,6 @@ const rules = {
|
|
|
14
14
|
],
|
|
15
15
|
},
|
|
16
16
|
],
|
|
17
|
-
// disallow specific imports
|
|
18
|
-
// https://eslint.org/docs/rules/no-restricted-imports
|
|
19
|
-
'no-restricted-imports': [
|
|
20
|
-
'off',
|
|
21
|
-
{
|
|
22
|
-
paths: [],
|
|
23
|
-
patterns: [],
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
17
|
// disallow useless computed property keys
|
|
27
18
|
// https://eslint.org/docs/rules/no-useless-computed-key
|
|
28
19
|
'no-useless-computed-key': 'error',
|
|
@@ -36,8 +27,6 @@ const rules = {
|
|
|
36
27
|
ignoreExport: false,
|
|
37
28
|
},
|
|
38
29
|
],
|
|
39
|
-
// require let or const instead of var
|
|
40
|
-
'no-var': 'error',
|
|
41
30
|
// require method and property shorthand syntax for object literals
|
|
42
31
|
// https://eslint.org/docs/rules/object-shorthand
|
|
43
32
|
'object-shorthand': [
|
|
@@ -152,9 +152,6 @@ declare const rules: {
|
|
|
152
152
|
ignoreNonDOM: boolean;
|
|
153
153
|
}];
|
|
154
154
|
'jsx-a11y/aria-unsupported-elements': "error";
|
|
155
|
-
'jsx-a11y/autocomplete-valid': ["off", {
|
|
156
|
-
inputComponents: never[];
|
|
157
|
-
}];
|
|
158
155
|
'jsx-a11y/click-events-have-key-events': "error";
|
|
159
156
|
'jsx-a11y/heading-has-content': ["error", {
|
|
160
157
|
components: string[];
|
|
@@ -16,6 +16,7 @@ const rules = {
|
|
|
16
16
|
allow: ['__REDUX_DEVTOOLS_EXTENSION_COMPOSE__'],
|
|
17
17
|
},
|
|
18
18
|
],
|
|
19
|
+
// TODO check it later
|
|
19
20
|
// Prevent missing displayName in a React component definition
|
|
20
21
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md
|
|
21
22
|
'react/display-name': ['off', { ignoreTranspilerName: false }],
|
|
@@ -328,14 +329,6 @@ const rules = {
|
|
|
328
329
|
// properties do not have those attributes.
|
|
329
330
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/aria-unsupported-elements.md
|
|
330
331
|
'jsx-a11y/aria-unsupported-elements': 'error',
|
|
331
|
-
// Ensure the autocomplete attribute is correct and suitable for the form field it is used with
|
|
332
|
-
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/29c68596b15c4ff0a40daae6d4a2670e36e37d35/docs/rules/autocomplete-valid.md
|
|
333
|
-
'jsx-a11y/autocomplete-valid': [
|
|
334
|
-
'off',
|
|
335
|
-
{
|
|
336
|
-
inputComponents: [],
|
|
337
|
-
},
|
|
338
|
-
],
|
|
339
332
|
// require onClick be accompanied by onKeyUp/onKeyDown/onKeyPress
|
|
340
333
|
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/click-events-have-key-events.md
|
|
341
334
|
'jsx-a11y/click-events-have-key-events': 'error',
|
|
@@ -21,10 +21,7 @@ declare const rules: {
|
|
|
21
21
|
classes: boolean;
|
|
22
22
|
variables: boolean;
|
|
23
23
|
}];
|
|
24
|
-
'require-await': "off";
|
|
25
24
|
'@typescript-eslint/require-await': "off";
|
|
26
|
-
'no-return-await': "off";
|
|
27
|
-
'@typescript-eslint/return-await': ["error", string];
|
|
28
25
|
'import-x/extensions': ["error", string, {
|
|
29
26
|
ts: string;
|
|
30
27
|
tsx: string;
|
|
@@ -31,13 +31,9 @@ const rules = {
|
|
|
31
31
|
'no-use-before-define': 'off',
|
|
32
32
|
'@typescript-eslint/no-use-before-define': baseVariablesRules['no-use-before-define'],
|
|
33
33
|
// Replace Airbnb 'require-await' rule with '@typescript-eslint' version
|
|
34
|
+
// require `await` in `async function` (note: this is a horrible rule that should never be used)
|
|
34
35
|
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/require-await.md
|
|
35
|
-
'require-await': 'off',
|
|
36
|
-
'@typescript-eslint/require-await': baseBestPracticesRules['require-await'],
|
|
37
|
-
// Replace Airbnb 'no-return-await' rule with '@typescript-eslint' version
|
|
38
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/return-await.md
|
|
39
|
-
'no-return-await': 'off',
|
|
40
|
-
'@typescript-eslint/return-await': ['error', 'in-try-catch'],
|
|
36
|
+
'@typescript-eslint/require-await': 'off',
|
|
41
37
|
// Append 'ts' and 'tsx' to Airbnb 'import-x/extensions' rule
|
|
42
38
|
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
|
|
43
39
|
'import-x/extensions': [
|