@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/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import gitignore from "eslint-config-flat-gitignore";
|
|
2
|
-
import { defineConfig } from "eslint/config";
|
|
3
1
|
import { perfectionist } from "./perfectionist/index.js";
|
|
4
2
|
import { packageJson } from "./package-json/index.js";
|
|
5
3
|
import { typescript } from "./typescript/index.js";
|
|
@@ -12,82 +10,66 @@ import { a11y } from "./a11y/index.js";
|
|
|
12
10
|
import { core } from "./core/index.js";
|
|
13
11
|
import { node } from "./node/index.js";
|
|
14
12
|
import { vue } from "./vue/index.js";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
import gitignore from "eslint-config-flat-gitignore";
|
|
14
|
+
import { defineConfig } from "eslint/config";
|
|
15
|
+
var CONFIG_OPTIONS = [
|
|
16
|
+
"perfectionist",
|
|
17
|
+
"typescript",
|
|
18
|
+
"svelte",
|
|
19
|
+
"vitest",
|
|
20
|
+
"astro",
|
|
21
|
+
"react",
|
|
22
|
+
"qwik",
|
|
23
|
+
"node",
|
|
24
|
+
"vue"
|
|
25
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
|
-
return Array.isArray(extendsConfig) ? extendsConfig.map(prepareExtendedConfig) : [prepareExtendedConfig(extendsConfig)];
|
|
75
|
-
}
|
|
76
|
-
return defineConfig([
|
|
77
|
-
gitignore({
|
|
78
|
-
name: "azat-io/gitignore",
|
|
79
|
-
strict: false
|
|
80
|
-
}),
|
|
81
|
-
{
|
|
82
|
-
ignores: [
|
|
83
|
-
"benchmark/**/*"
|
|
84
|
-
],
|
|
85
|
-
name: "azat-io/benchmark/ignores"
|
|
86
|
-
},
|
|
87
|
-
...configs,
|
|
88
|
-
...prepareExtends(customExtends)
|
|
89
|
-
]);
|
|
90
|
-
};
|
|
91
|
-
export {
|
|
92
|
-
index as default
|
|
26
|
+
var eslint_config_default = async ({ extends: customExtends = {}, ...rawConfig } = {}) => {
|
|
27
|
+
let config = {};
|
|
28
|
+
for (let configName of CONFIG_OPTIONS) config[configName] = rawConfig[configName] ?? false;
|
|
29
|
+
let configFunctions = [
|
|
30
|
+
core,
|
|
31
|
+
a11y,
|
|
32
|
+
react,
|
|
33
|
+
node,
|
|
34
|
+
typescript,
|
|
35
|
+
vitest,
|
|
36
|
+
astro,
|
|
37
|
+
svelte,
|
|
38
|
+
qwik,
|
|
39
|
+
vue,
|
|
40
|
+
packageJson,
|
|
41
|
+
perfectionist
|
|
42
|
+
];
|
|
43
|
+
let configs = await Promise.all(configFunctions.map((createConfigFunction) => Promise.resolve(createConfigFunction(config))));
|
|
44
|
+
let plugins = configs.reduce((accumulator, current) => current.plugins ? {
|
|
45
|
+
...accumulator,
|
|
46
|
+
...current.plugins
|
|
47
|
+
} : accumulator, {});
|
|
48
|
+
function prepareExtends(extendsConfig) {
|
|
49
|
+
if (!extendsConfig) return [];
|
|
50
|
+
function prepareExtendedConfig(currentConfig) {
|
|
51
|
+
return {
|
|
52
|
+
name: "azat-io/custom-extends",
|
|
53
|
+
...currentConfig,
|
|
54
|
+
plugins: {
|
|
55
|
+
...plugins,
|
|
56
|
+
...currentConfig.plugins
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return Array.isArray(extendsConfig) ? extendsConfig.map(prepareExtendedConfig) : [prepareExtendedConfig(extendsConfig)];
|
|
61
|
+
}
|
|
62
|
+
return defineConfig([
|
|
63
|
+
gitignore({
|
|
64
|
+
name: "azat-io/gitignore",
|
|
65
|
+
strict: false
|
|
66
|
+
}),
|
|
67
|
+
{
|
|
68
|
+
ignores: ["benchmark/**/*"],
|
|
69
|
+
name: "azat-io/benchmark/ignores"
|
|
70
|
+
},
|
|
71
|
+
...configs,
|
|
72
|
+
...prepareExtends(customExtends)
|
|
73
|
+
]);
|
|
93
74
|
};
|
|
75
|
+
export { eslint_config_default as default };
|
package/dist/node/index.js
CHANGED
|
@@ -1,59 +1,47 @@
|
|
|
1
1
|
import { interopDefault } from "../utilities.js";
|
|
2
2
|
async function node(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
|
-
"node/prefer-global/text-decoder": ["error", "always"],
|
|
47
|
-
"node/prefer-global/text-encoder": ["error", "always"],
|
|
48
|
-
"node/prefer-global/timers": ["error", "always"],
|
|
49
|
-
"node/prefer-global/url": ["error", "always"],
|
|
50
|
-
"node/prefer-global/url-search-params": ["error", "always"],
|
|
51
|
-
"node/prefer-node-protocol": "error",
|
|
52
|
-
"node/prefer-promises/fs": "error",
|
|
53
|
-
"node/process-exit-as-throw": "error"
|
|
54
|
-
}
|
|
55
|
-
};
|
|
3
|
+
if (!config.node) return {};
|
|
4
|
+
let nodePlugin = await interopDefault(import("eslint-plugin-n"));
|
|
5
|
+
let files = [
|
|
6
|
+
"**/*.js",
|
|
7
|
+
"**/*.cjs",
|
|
8
|
+
"**/*.mjs"
|
|
9
|
+
];
|
|
10
|
+
if (config.typescript) files.push("**/*.ts", "**/*.cts", "**/*.mts");
|
|
11
|
+
if (config.react || config.qwik) {
|
|
12
|
+
files.push("**/*.jsx");
|
|
13
|
+
if (config.typescript) files.push("**/*.tsx");
|
|
14
|
+
}
|
|
15
|
+
if (config.astro) files.push("**/*.astro");
|
|
16
|
+
if (config.svelte) files.push("**/*.svelte");
|
|
17
|
+
if (config.vue) files.push("**/*.vue");
|
|
18
|
+
return {
|
|
19
|
+
name: "azat-io/node/rules",
|
|
20
|
+
files,
|
|
21
|
+
plugins: { node: nodePlugin },
|
|
22
|
+
rules: {
|
|
23
|
+
"node/handle-callback-err": ["error", "error"],
|
|
24
|
+
"node/hashbang": "error",
|
|
25
|
+
"node/no-deprecated-api": "error",
|
|
26
|
+
"node/no-exports-assign": "error",
|
|
27
|
+
"node/no-extraneous-require": "error",
|
|
28
|
+
"node/no-new-require": "error",
|
|
29
|
+
"node/no-path-concat": "error",
|
|
30
|
+
"node/no-unpublished-bin": "error",
|
|
31
|
+
"node/no-unsupported-features/es-builtins": "error",
|
|
32
|
+
"node/prefer-global/buffer": ["error", "always"],
|
|
33
|
+
"node/prefer-global/console": ["error", "always"],
|
|
34
|
+
"node/prefer-global/crypto": ["error", "always"],
|
|
35
|
+
"node/prefer-global/process": ["error", "always"],
|
|
36
|
+
"node/prefer-global/text-decoder": ["error", "always"],
|
|
37
|
+
"node/prefer-global/text-encoder": ["error", "always"],
|
|
38
|
+
"node/prefer-global/timers": ["error", "always"],
|
|
39
|
+
"node/prefer-global/url": ["error", "always"],
|
|
40
|
+
"node/prefer-global/url-search-params": ["error", "always"],
|
|
41
|
+
"node/prefer-node-protocol": "error",
|
|
42
|
+
"node/prefer-promises/fs": "error",
|
|
43
|
+
"node/process-exit-as-throw": "error"
|
|
44
|
+
}
|
|
45
|
+
};
|
|
56
46
|
}
|
|
57
|
-
export {
|
|
58
|
-
node
|
|
59
|
-
};
|
|
47
|
+
export { node };
|
|
@@ -2,70 +2,52 @@ import packageJsonPlugin from "eslint-plugin-package-json";
|
|
|
2
2
|
import * as jsoncParser from "jsonc-eslint-parser";
|
|
3
3
|
import depend from "eslint-plugin-depend";
|
|
4
4
|
function packageJson(_config) {
|
|
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
|
-
"package-json/unique-dependencies": "error",
|
|
53
|
-
"package-json/valid-author": "error",
|
|
54
|
-
"package-json/valid-bin": "error",
|
|
55
|
-
"package-json/valid-dependencies": "error",
|
|
56
|
-
"package-json/valid-description": "error",
|
|
57
|
-
"package-json/valid-directories": "error",
|
|
58
|
-
"package-json/valid-files": "error",
|
|
59
|
-
"package-json/valid-homepage": "error",
|
|
60
|
-
"package-json/valid-keywords": "error",
|
|
61
|
-
"package-json/valid-license": "error",
|
|
62
|
-
"package-json/valid-module": "error",
|
|
63
|
-
"package-json/valid-name": "error",
|
|
64
|
-
"package-json/valid-scripts": "error",
|
|
65
|
-
"package-json/valid-version": "error"
|
|
66
|
-
}
|
|
67
|
-
};
|
|
5
|
+
return {
|
|
6
|
+
name: "azat-io/package-json/rules",
|
|
7
|
+
files: ["**/package.json"],
|
|
8
|
+
plugins: {
|
|
9
|
+
depend,
|
|
10
|
+
"package-json": packageJsonPlugin
|
|
11
|
+
},
|
|
12
|
+
languageOptions: { parser: jsoncParser },
|
|
13
|
+
rules: {
|
|
14
|
+
"depend/ban-dependencies": "error",
|
|
15
|
+
"package-json/bin-name-casing": "error",
|
|
16
|
+
"package-json/exports-subpaths-style": ["error", { prefer: "explicit" }],
|
|
17
|
+
"package-json/no-empty-fields": "error",
|
|
18
|
+
"package-json/no-redundant-files": "error",
|
|
19
|
+
"package-json/no-redundant-publishConfig": "error",
|
|
20
|
+
"package-json/order-properties": ["error", { order: "sort-package-json" }],
|
|
21
|
+
"package-json/repository-shorthand": ["error", { form: "shorthand" }],
|
|
22
|
+
"package-json/require-author": "error",
|
|
23
|
+
"package-json/require-description": "error",
|
|
24
|
+
"package-json/require-engines": "error",
|
|
25
|
+
"package-json/require-homepage": "error",
|
|
26
|
+
"package-json/require-keywords": "error",
|
|
27
|
+
"package-json/require-name": "error",
|
|
28
|
+
"package-json/require-repository": "error",
|
|
29
|
+
"package-json/require-scripts": "error",
|
|
30
|
+
"package-json/require-type": "error",
|
|
31
|
+
"package-json/require-version": "error",
|
|
32
|
+
"package-json/scripts-name-casing": "error",
|
|
33
|
+
"package-json/sort-collections": "error",
|
|
34
|
+
"package-json/specify-peers-locally": "error",
|
|
35
|
+
"package-json/unique-dependencies": "error",
|
|
36
|
+
"package-json/valid-author": "error",
|
|
37
|
+
"package-json/valid-bin": "error",
|
|
38
|
+
"package-json/valid-dependencies": "error",
|
|
39
|
+
"package-json/valid-description": "error",
|
|
40
|
+
"package-json/valid-directories": "error",
|
|
41
|
+
"package-json/valid-files": "error",
|
|
42
|
+
"package-json/valid-funding": "error",
|
|
43
|
+
"package-json/valid-homepage": "error",
|
|
44
|
+
"package-json/valid-keywords": "error",
|
|
45
|
+
"package-json/valid-license": "error",
|
|
46
|
+
"package-json/valid-module": "error",
|
|
47
|
+
"package-json/valid-name": "error",
|
|
48
|
+
"package-json/valid-scripts": "error",
|
|
49
|
+
"package-json/valid-version": "error"
|
|
50
|
+
}
|
|
51
|
+
};
|
|
68
52
|
}
|
|
69
|
-
export {
|
|
70
|
-
packageJson
|
|
71
|
-
};
|
|
53
|
+
export { packageJson };
|
|
@@ -1,66 +1,50 @@
|
|
|
1
1
|
import { interopDefault } from "../utilities.js";
|
|
2
2
|
async function perfectionist(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
|
-
"perfectionist/sort-object-types": ["error"],
|
|
50
|
-
"perfectionist/sort-objects": ["error"],
|
|
51
|
-
"perfectionist/sort-sets": ["error"],
|
|
52
|
-
"perfectionist/sort-switch-case": ["error"],
|
|
53
|
-
"perfectionist/sort-union-types": ["error"],
|
|
54
|
-
"perfectionist/sort-variable-declarations": ["error"]
|
|
55
|
-
},
|
|
56
|
-
settings: {
|
|
57
|
-
perfectionist: {
|
|
58
|
-
order: "desc",
|
|
59
|
-
type: "line-length"
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
3
|
+
if (!config.perfectionist) return {};
|
|
4
|
+
let perfectionistPlugin = await interopDefault(import("eslint-plugin-perfectionist"));
|
|
5
|
+
let files = [
|
|
6
|
+
"**/*.js",
|
|
7
|
+
"**/*.cjs",
|
|
8
|
+
"**/*.mjs"
|
|
9
|
+
];
|
|
10
|
+
if (config.typescript) files.push("**/*.ts", "**/*.cts", "**/*.mts");
|
|
11
|
+
if (config.react || config.qwik) {
|
|
12
|
+
files.push("**/*.jsx");
|
|
13
|
+
if (config.typescript) files.push("**/*.tsx");
|
|
14
|
+
}
|
|
15
|
+
if (config.astro) files.push("**/*.astro");
|
|
16
|
+
if (config.svelte) files.push("**/*.svelte");
|
|
17
|
+
if (config.vue) files.push("**/*.vue");
|
|
18
|
+
return {
|
|
19
|
+
name: "azat-io/perfectionist/rules",
|
|
20
|
+
files,
|
|
21
|
+
plugins: { perfectionist: perfectionistPlugin },
|
|
22
|
+
rules: {
|
|
23
|
+
"perfectionist/sort-array-includes": ["error"],
|
|
24
|
+
"perfectionist/sort-classes": ["error"],
|
|
25
|
+
"perfectionist/sort-decorators": ["error"],
|
|
26
|
+
"perfectionist/sort-enums": ["error"],
|
|
27
|
+
"perfectionist/sort-exports": ["error"],
|
|
28
|
+
"perfectionist/sort-heritage-clauses": ["error"],
|
|
29
|
+
"perfectionist/sort-imports": ["error"],
|
|
30
|
+
"perfectionist/sort-interfaces": ["error"],
|
|
31
|
+
"perfectionist/sort-intersection-types": ["error"],
|
|
32
|
+
"perfectionist/sort-jsx-props": ["error"],
|
|
33
|
+
"perfectionist/sort-maps": ["error"],
|
|
34
|
+
"perfectionist/sort-modules": ["error"],
|
|
35
|
+
"perfectionist/sort-named-exports": ["error"],
|
|
36
|
+
"perfectionist/sort-named-imports": ["error"],
|
|
37
|
+
"perfectionist/sort-object-types": ["error"],
|
|
38
|
+
"perfectionist/sort-objects": ["error"],
|
|
39
|
+
"perfectionist/sort-sets": ["error"],
|
|
40
|
+
"perfectionist/sort-switch-case": ["error"],
|
|
41
|
+
"perfectionist/sort-union-types": ["error"],
|
|
42
|
+
"perfectionist/sort-variable-declarations": ["error"]
|
|
43
|
+
},
|
|
44
|
+
settings: { perfectionist: {
|
|
45
|
+
order: "desc",
|
|
46
|
+
type: "line-length"
|
|
47
|
+
} }
|
|
48
|
+
};
|
|
63
49
|
}
|
|
64
|
-
export {
|
|
65
|
-
perfectionist
|
|
66
|
-
};
|
|
50
|
+
export { perfectionist };
|
package/dist/qwik/index.js
CHANGED
|
@@ -1,33 +1,25 @@
|
|
|
1
1
|
import { interopDefault } from "../utilities.js";
|
|
2
2
|
async function qwik(config) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"qwik/prefer-classlist": "error",
|
|
25
|
-
"qwik/unused-server": "error",
|
|
26
|
-
"qwik/use-method-usage": "error",
|
|
27
|
-
"qwik/valid-lexical-scope": "error"
|
|
28
|
-
}
|
|
29
|
-
};
|
|
3
|
+
if (!config.qwik) return {};
|
|
4
|
+
let qwikPlugin = await interopDefault(import("eslint-plugin-qwik"));
|
|
5
|
+
let files = ["**/*.jsx"];
|
|
6
|
+
if (config.typescript) files.push("**/*.tsx");
|
|
7
|
+
return {
|
|
8
|
+
name: "azat-io/qwik/rules",
|
|
9
|
+
files,
|
|
10
|
+
plugins: { qwik: qwikPlugin },
|
|
11
|
+
rules: {
|
|
12
|
+
"qwik/jsx-a": "error",
|
|
13
|
+
"qwik/jsx-img": "error",
|
|
14
|
+
"qwik/jsx-key": "error",
|
|
15
|
+
"qwik/loader-location": "error",
|
|
16
|
+
"qwik/no-react-props": "error",
|
|
17
|
+
"qwik/no-use-visible-task": "error",
|
|
18
|
+
"qwik/prefer-classlist": "error",
|
|
19
|
+
"qwik/unused-server": "error",
|
|
20
|
+
"qwik/use-method-usage": "error",
|
|
21
|
+
"qwik/valid-lexical-scope": "error"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
30
24
|
}
|
|
31
|
-
export {
|
|
32
|
-
qwik
|
|
33
|
-
};
|
|
25
|
+
export { qwik };
|