@azat-io/eslint-config 2.71.0 → 2.73.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/dist/a11y/index.js +43 -51
- package/dist/astro/index.js +82 -96
- package/dist/core/index.js +541 -653
- package/dist/index.js +61 -79
- package/dist/node/index.js +44 -56
- package/dist/package-json/index.js +48 -66
- package/dist/perfectionist/index.js +47 -63
- package/dist/qwik/index.js +22 -30
- package/dist/react/index.js +103 -130
- package/dist/svelte/index.js +74 -88
- package/dist/typescript/index.js +188 -247
- package/dist/utilities.js +11 -17
- package/dist/vitest/index.js +63 -84
- package/dist/vue/index.js +177 -202
- package/package.json +15 -16
- package/readme.md +0 -1
package/dist/react/index.js
CHANGED
|
@@ -1,133 +1,106 @@
|
|
|
1
1
|
import { interopDefault } from "../utilities.js";
|
|
2
2
|
async function react(config) {
|
|
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
|
-
"react-x/no-component-will-receive-props": "error",
|
|
106
|
-
"react-x/no-component-will-update": "error",
|
|
107
|
-
"react-x/no-duplicate-key": "error",
|
|
108
|
-
"react-x/no-nested-component-definitions": "error",
|
|
109
|
-
"react-x/no-unnecessary-key": "error",
|
|
110
|
-
"react-x/no-unnecessary-use-callback": "error",
|
|
111
|
-
"react-x/no-unnecessary-use-memo": "error",
|
|
112
|
-
"react-x/no-unnecessary-use-prefix": "error",
|
|
113
|
-
"react-x/no-unsafe-component-will-update": "error",
|
|
114
|
-
"react-x/no-unstable-context-value": "error",
|
|
115
|
-
"react-x/no-unused-props": "error",
|
|
116
|
-
"react-x/no-unused-state": "error",
|
|
117
|
-
"react-x/no-use-context": "error",
|
|
118
|
-
"react-x/no-useless-fragment": "error",
|
|
119
|
-
"react-x/prefer-namespace-import": "error",
|
|
120
|
-
"react-x/prefer-use-state-lazy-initialization": "error"
|
|
121
|
-
},
|
|
122
|
-
settings: {
|
|
123
|
-
react: {
|
|
124
|
-
fragment: "Fragment",
|
|
125
|
-
pragma: "React",
|
|
126
|
-
version: "detect"
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
};
|
|
3
|
+
if (!config.react) return {};
|
|
4
|
+
let [reactCompilerPlugin, reactDomPlugin, reactHooksPlugin, reactNamingConventionPlugin, reactPerfPlugin, reactWebApiPlugin, reactXPlugin] = await Promise.all([
|
|
5
|
+
interopDefault(import("eslint-plugin-react-compiler")),
|
|
6
|
+
interopDefault(import("eslint-plugin-react-dom")),
|
|
7
|
+
interopDefault(import("eslint-plugin-react-hooks")),
|
|
8
|
+
interopDefault(import("eslint-plugin-react-naming-convention")),
|
|
9
|
+
interopDefault(import("eslint-plugin-react-perf")),
|
|
10
|
+
interopDefault(import("eslint-plugin-react-web-api")),
|
|
11
|
+
interopDefault(import("eslint-plugin-react-x"))
|
|
12
|
+
]);
|
|
13
|
+
let files = ["**/*.jsx"];
|
|
14
|
+
if (config.typescript) files.push("**/*.tsx");
|
|
15
|
+
return {
|
|
16
|
+
name: "azat-io/react/rules",
|
|
17
|
+
files,
|
|
18
|
+
plugins: {
|
|
19
|
+
"react-compiler": reactCompilerPlugin,
|
|
20
|
+
"react-dom": reactDomPlugin,
|
|
21
|
+
"react-hooks": reactHooksPlugin,
|
|
22
|
+
"react-naming-convention": reactNamingConventionPlugin,
|
|
23
|
+
"react-perf": reactPerfPlugin,
|
|
24
|
+
"react-web-api": reactWebApiPlugin,
|
|
25
|
+
"react-x": reactXPlugin
|
|
26
|
+
},
|
|
27
|
+
rules: {
|
|
28
|
+
"react-compiler/react-compiler": "error",
|
|
29
|
+
"react-dom/no-dangerously-set-innerhtml": "error",
|
|
30
|
+
"react-dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
31
|
+
"react-dom/no-find-dom-node": "error",
|
|
32
|
+
"react-dom/no-flush-sync": "error",
|
|
33
|
+
"react-dom/no-hydrate": "error",
|
|
34
|
+
"react-dom/no-missing-button-type": "error",
|
|
35
|
+
"react-dom/no-missing-iframe-sandbox": "error",
|
|
36
|
+
"react-dom/no-namespace": "error",
|
|
37
|
+
"react-dom/no-render": "error",
|
|
38
|
+
"react-dom/no-render-return-value": "error",
|
|
39
|
+
"react-dom/no-script-url": "error",
|
|
40
|
+
"react-dom/no-unknown-property": "error",
|
|
41
|
+
"react-dom/no-unsafe-iframe-sandbox": "error",
|
|
42
|
+
"react-dom/no-unsafe-target-blank": "error",
|
|
43
|
+
"react-dom/no-use-form-state": "error",
|
|
44
|
+
"react-dom/no-void-elements-with-children": "error",
|
|
45
|
+
"react-hooks/exhaustive-deps": "error",
|
|
46
|
+
"react-hooks/rules-of-hooks": "error",
|
|
47
|
+
"react-naming-convention/context-name": "error",
|
|
48
|
+
"react-naming-convention/id-name": "error",
|
|
49
|
+
"react-naming-convention/use-state": "error",
|
|
50
|
+
"react-perf/jsx-no-jsx-as-prop": "error",
|
|
51
|
+
"react-perf/jsx-no-new-array-as-prop": "error",
|
|
52
|
+
"react-perf/jsx-no-new-function-as-prop": "error",
|
|
53
|
+
"react-perf/jsx-no-new-object-as-prop": "error",
|
|
54
|
+
"react-web-api/no-leaked-absolute-orientation-sensor": "error",
|
|
55
|
+
"react-web-api/no-leaked-ambient-light-sensor": "error",
|
|
56
|
+
"react-web-api/no-leaked-animation-frame": "error",
|
|
57
|
+
"react-web-api/no-leaked-broadcast-channel": "error",
|
|
58
|
+
"react-web-api/no-leaked-event-listener": "error",
|
|
59
|
+
"react-web-api/no-leaked-event-source": "error",
|
|
60
|
+
"react-web-api/no-leaked-geolocation": "error",
|
|
61
|
+
"react-web-api/no-leaked-gravity-sensor": "error",
|
|
62
|
+
"react-web-api/no-leaked-gyroscope": "error",
|
|
63
|
+
"react-web-api/no-leaked-idle-callback": "error",
|
|
64
|
+
"react-web-api/no-leaked-intersection-observer": "error",
|
|
65
|
+
"react-web-api/no-leaked-interval": "error",
|
|
66
|
+
"react-web-api/no-leaked-linear-acceleration-sensor": "error",
|
|
67
|
+
"react-web-api/no-leaked-magnetometer": "error",
|
|
68
|
+
"react-web-api/no-leaked-mutation-observer": "error",
|
|
69
|
+
"react-web-api/no-leaked-orientation-sensor": "error",
|
|
70
|
+
"react-web-api/no-leaked-performance-observer": "error",
|
|
71
|
+
"react-web-api/no-leaked-relative-accelerometer": "error",
|
|
72
|
+
"react-web-api/no-leaked-resize-observer": "error",
|
|
73
|
+
"react-web-api/no-leaked-timeout": "error",
|
|
74
|
+
"react-web-api/no-leaked-websocket": "error",
|
|
75
|
+
"react-x/jsx-key-before-spread": "error",
|
|
76
|
+
"react-x/jsx-shorthand-boolean": "error",
|
|
77
|
+
"react-x/jsx-shorthand-fragment": "error",
|
|
78
|
+
"react-x/no-access-state-in-setstate": "error",
|
|
79
|
+
"react-x/no-array-index-key": "error",
|
|
80
|
+
"react-x/no-class-component": "error",
|
|
81
|
+
"react-x/no-complex-conditional-rendering": "error",
|
|
82
|
+
"react-x/no-component-will-mount": "error",
|
|
83
|
+
"react-x/no-component-will-receive-props": "error",
|
|
84
|
+
"react-x/no-component-will-update": "error",
|
|
85
|
+
"react-x/no-duplicate-key": "error",
|
|
86
|
+
"react-x/no-nested-component-definitions": "error",
|
|
87
|
+
"react-x/no-unnecessary-use-callback": "error",
|
|
88
|
+
"react-x/no-unnecessary-use-memo": "error",
|
|
89
|
+
"react-x/no-unnecessary-use-prefix": "error",
|
|
90
|
+
"react-x/no-unsafe-component-will-update": "error",
|
|
91
|
+
"react-x/no-unstable-context-value": "error",
|
|
92
|
+
"react-x/no-unused-props": "error",
|
|
93
|
+
"react-x/no-unused-state": "error",
|
|
94
|
+
"react-x/no-use-context": "error",
|
|
95
|
+
"react-x/no-useless-fragment": "error",
|
|
96
|
+
"react-x/prefer-namespace-import": "error",
|
|
97
|
+
"react-x/set-state-in-effect": "error"
|
|
98
|
+
},
|
|
99
|
+
settings: { react: {
|
|
100
|
+
fragment: "Fragment",
|
|
101
|
+
pragma: "React",
|
|
102
|
+
version: "detect"
|
|
103
|
+
} }
|
|
104
|
+
};
|
|
130
105
|
}
|
|
131
|
-
export {
|
|
132
|
-
react
|
|
133
|
-
};
|
|
106
|
+
export { react };
|
package/dist/svelte/index.js
CHANGED
|
@@ -1,91 +1,77 @@
|
|
|
1
1
|
import { interopDefault } from "../utilities.js";
|
|
2
2
|
async function svelte(config) {
|
|
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
|
-
"svelte/prefer-svelte-reactivity": "error",
|
|
77
|
-
"svelte/prefer-writable-derived": "error",
|
|
78
|
-
"svelte/require-each-key": "error",
|
|
79
|
-
"svelte/require-event-prefix": "error",
|
|
80
|
-
"svelte/require-store-reactive-access": "error",
|
|
81
|
-
"svelte/require-stores-init": "error",
|
|
82
|
-
"svelte/shorthand-attribute": "error",
|
|
83
|
-
"svelte/shorthand-directive": "error",
|
|
84
|
-
"svelte/system": "error",
|
|
85
|
-
"svelte/valid-each-key": "error"
|
|
86
|
-
}
|
|
87
|
-
};
|
|
3
|
+
if (!config.svelte) return {};
|
|
4
|
+
let files = ["**/*.svelte"];
|
|
5
|
+
let [sveltePlugin, svelteParser] = await Promise.all([interopDefault(import("eslint-plugin-svelte")), interopDefault(import("svelte-eslint-parser"))]);
|
|
6
|
+
let additionalParserOptions = {};
|
|
7
|
+
if (config.typescript) {
|
|
8
|
+
let { parser: typescriptParser } = await interopDefault(import("typescript-eslint"));
|
|
9
|
+
additionalParserOptions = {
|
|
10
|
+
...additionalParserOptions,
|
|
11
|
+
parser: typescriptParser,
|
|
12
|
+
projectService: true,
|
|
13
|
+
tsconfigRootDir: process.cwd()
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
name: "azat-io/svelte/rules",
|
|
18
|
+
files,
|
|
19
|
+
languageOptions: {
|
|
20
|
+
parser: svelteParser,
|
|
21
|
+
parserOptions: {
|
|
22
|
+
ecmaVersion: "latest",
|
|
23
|
+
extraFileExtensions: [".svelte"],
|
|
24
|
+
sourceType: "module",
|
|
25
|
+
...additionalParserOptions
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
plugins: { svelte: sveltePlugin },
|
|
29
|
+
rules: {
|
|
30
|
+
"svelte/block-lang": ["error", {
|
|
31
|
+
enforceScriptPresent: true,
|
|
32
|
+
enforceStylePresent: false,
|
|
33
|
+
script: ["ts", null]
|
|
34
|
+
}],
|
|
35
|
+
"svelte/button-has-type": "error",
|
|
36
|
+
"svelte/comment-directive": "error",
|
|
37
|
+
"svelte/derived-has-same-inputs-outputs": "error",
|
|
38
|
+
"svelte/infinite-reactive-loop": "error",
|
|
39
|
+
"svelte/no-add-event-listener": "error",
|
|
40
|
+
"svelte/no-at-debug-tags": "error",
|
|
41
|
+
"svelte/no-at-html-tags": "error",
|
|
42
|
+
"svelte/no-dom-manipulating": "error",
|
|
43
|
+
"svelte/no-dupe-else-if-blocks": "error",
|
|
44
|
+
"svelte/no-dupe-on-directives": "error",
|
|
45
|
+
"svelte/no-dupe-style-properties": "error",
|
|
46
|
+
"svelte/no-dupe-use-directives": "error",
|
|
47
|
+
"svelte/no-extra-reactive-curlies": "error",
|
|
48
|
+
"svelte/no-ignored-unsubscribe": "error",
|
|
49
|
+
"svelte/no-immutable-reactive-statements": "error",
|
|
50
|
+
"svelte/no-inner-declarations": "error",
|
|
51
|
+
"svelte/no-inspect": "error",
|
|
52
|
+
"svelte/no-object-in-text-mustaches": "error",
|
|
53
|
+
"svelte/no-reactive-functions": "error",
|
|
54
|
+
"svelte/no-shorthand-style-property-overrides": "error",
|
|
55
|
+
"svelte/no-svelte-internal": "error",
|
|
56
|
+
"svelte/no-target-blank": "error",
|
|
57
|
+
"svelte/no-top-level-browser-globals": "error",
|
|
58
|
+
"svelte/no-unknown-style-directive-property": "error",
|
|
59
|
+
"svelte/no-unused-svelte-ignore": "error",
|
|
60
|
+
"svelte/no-useless-mustaches": "error",
|
|
61
|
+
"svelte/prefer-class-directive": "error",
|
|
62
|
+
"svelte/prefer-destructured-store-props": "error",
|
|
63
|
+
"svelte/prefer-style-directive": "error",
|
|
64
|
+
"svelte/prefer-svelte-reactivity": "error",
|
|
65
|
+
"svelte/prefer-writable-derived": "error",
|
|
66
|
+
"svelte/require-each-key": "error",
|
|
67
|
+
"svelte/require-event-prefix": "error",
|
|
68
|
+
"svelte/require-store-reactive-access": "error",
|
|
69
|
+
"svelte/require-stores-init": "error",
|
|
70
|
+
"svelte/shorthand-attribute": "error",
|
|
71
|
+
"svelte/shorthand-directive": "error",
|
|
72
|
+
"svelte/system": "error",
|
|
73
|
+
"svelte/valid-each-key": "error"
|
|
74
|
+
}
|
|
75
|
+
};
|
|
88
76
|
}
|
|
89
|
-
export {
|
|
90
|
-
svelte
|
|
91
|
-
};
|
|
77
|
+
export { svelte };
|