@azat-io/eslint-config 2.0.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.cjs +53 -0
- package/dist/a11y/index.mjs +53 -0
- package/dist/astro/index.cjs +93 -0
- package/dist/astro/index.mjs +93 -0
- package/dist/core/index.cjs +631 -0
- package/dist/core/index.mjs +631 -0
- package/dist/index.cjs +76 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.mjs +77 -0
- package/dist/node/index.cjs +55 -0
- package/dist/node/index.mjs +55 -0
- package/dist/package-json/index.cjs +34 -0
- package/dist/package-json/index.mjs +34 -0
- package/dist/perfectionist/index.cjs +59 -0
- package/dist/perfectionist/index.mjs +59 -0
- package/dist/qwik/index.cjs +31 -0
- package/dist/qwik/index.mjs +31 -0
- package/dist/react/index.cjs +109 -0
- package/dist/react/index.mjs +109 -0
- package/dist/svelte/index.cjs +82 -0
- package/dist/svelte/index.mjs +82 -0
- package/dist/typescript/index.cjs +232 -0
- package/dist/typescript/index.mjs +232 -0
- package/dist/vitest/index.cjs +81 -0
- package/dist/vitest/index.mjs +81 -0
- package/dist/vue/index.cjs +189 -0
- package/dist/vue/index.mjs +189 -0
- package/license.md +20 -0
- package/package.json +66 -0
- package/readme.md +151 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const index$c = require("./perfectionist/index.cjs");
|
|
3
|
+
const index$b = require("./package-json/index.cjs");
|
|
4
|
+
const index$5 = require("./typescript/index.cjs");
|
|
5
|
+
const index$8 = require("./svelte/index.cjs");
|
|
6
|
+
const index$6 = require("./vitest/index.cjs");
|
|
7
|
+
const index$4 = require("./react/index.cjs");
|
|
8
|
+
const index$7 = require("./astro/index.cjs");
|
|
9
|
+
const index$9 = require("./qwik/index.cjs");
|
|
10
|
+
const index$3 = require("./a11y/index.cjs");
|
|
11
|
+
const index$1 = require("./core/index.cjs");
|
|
12
|
+
const index$2 = require("./node/index.cjs");
|
|
13
|
+
const index$a = require("./vue/index.cjs");
|
|
14
|
+
const CONFIG_OPTIONS = [
|
|
15
|
+
"perfectionist",
|
|
16
|
+
"typescript",
|
|
17
|
+
"svelte",
|
|
18
|
+
"vitest",
|
|
19
|
+
"astro",
|
|
20
|
+
"react",
|
|
21
|
+
"qwik",
|
|
22
|
+
"node",
|
|
23
|
+
"vue"
|
|
24
|
+
];
|
|
25
|
+
const index = ({
|
|
26
|
+
extends: customExtends = {},
|
|
27
|
+
...rawConfig
|
|
28
|
+
} = {}) => {
|
|
29
|
+
let config = {};
|
|
30
|
+
for (let configName of CONFIG_OPTIONS) {
|
|
31
|
+
config[configName] = rawConfig[configName] ?? false;
|
|
32
|
+
}
|
|
33
|
+
return [
|
|
34
|
+
{
|
|
35
|
+
ignores: [
|
|
36
|
+
"**/.eslint-config-inspector/**",
|
|
37
|
+
"**/vite.config.*.timestamp-*",
|
|
38
|
+
"**/.vitepress/cache/**",
|
|
39
|
+
"**/node_modules/**",
|
|
40
|
+
"**/.svelte-kit/**",
|
|
41
|
+
"**/coverage/**",
|
|
42
|
+
"**/.history/**",
|
|
43
|
+
"**/.netlify/**",
|
|
44
|
+
"**/.vercel/**",
|
|
45
|
+
"**/.output/**",
|
|
46
|
+
"**/.astro/**",
|
|
47
|
+
"**/output/**",
|
|
48
|
+
"**/.cache/**",
|
|
49
|
+
"**/.temp/**",
|
|
50
|
+
"**/build/**",
|
|
51
|
+
"**/.nuxt/**",
|
|
52
|
+
"**/.next/**",
|
|
53
|
+
"**/dist/**",
|
|
54
|
+
"**/temp/**",
|
|
55
|
+
"**/.tmp/**",
|
|
56
|
+
"**/tmp/**"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
...[
|
|
60
|
+
index$1.core,
|
|
61
|
+
index$2.node,
|
|
62
|
+
index$3.a11y,
|
|
63
|
+
index$4.react,
|
|
64
|
+
index$5.typescript,
|
|
65
|
+
index$6.vitest,
|
|
66
|
+
index$7.astro,
|
|
67
|
+
index$8.svelte,
|
|
68
|
+
index$9.qwik,
|
|
69
|
+
index$a.vue,
|
|
70
|
+
index$b.packageJson,
|
|
71
|
+
index$c.perfectionist
|
|
72
|
+
].map((createConfigFunction) => createConfigFunction(config)),
|
|
73
|
+
...Array.isArray(customExtends) ? customExtends : [customExtends]
|
|
74
|
+
];
|
|
75
|
+
};
|
|
76
|
+
module.exports = index;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Linter } from 'eslint';
|
|
2
|
+
declare const CONFIG_OPTIONS: readonly ["perfectionist", "typescript", "svelte", "vitest", "astro", "react", "qwik", "node", "vue"];
|
|
3
|
+
type ConfigOptionKeys = (typeof CONFIG_OPTIONS)[number];
|
|
4
|
+
type ConfigOptionFlags = Record<ConfigOptionKeys, boolean>;
|
|
5
|
+
type RawConfigOptions = {
|
|
6
|
+
extends?: Linter.Config[] | Linter.Config;
|
|
7
|
+
} & Partial<ConfigOptionFlags>;
|
|
8
|
+
export type ConfigOptions = Required<ConfigOptionFlags>;
|
|
9
|
+
declare const _default: ({ extends: customExtends, ...rawConfig }?: RawConfigOptions) => Linter.Config[];
|
|
10
|
+
export default _default;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { perfectionist } from "./perfectionist/index.mjs";
|
|
2
|
+
import { packageJson } from "./package-json/index.mjs";
|
|
3
|
+
import { typescript } from "./typescript/index.mjs";
|
|
4
|
+
import { svelte } from "./svelte/index.mjs";
|
|
5
|
+
import { vitest } from "./vitest/index.mjs";
|
|
6
|
+
import { react } from "./react/index.mjs";
|
|
7
|
+
import { astro } from "./astro/index.mjs";
|
|
8
|
+
import { qwik } from "./qwik/index.mjs";
|
|
9
|
+
import { a11y } from "./a11y/index.mjs";
|
|
10
|
+
import { core } from "./core/index.mjs";
|
|
11
|
+
import { node } from "./node/index.mjs";
|
|
12
|
+
import { vue } from "./vue/index.mjs";
|
|
13
|
+
const CONFIG_OPTIONS = [
|
|
14
|
+
"perfectionist",
|
|
15
|
+
"typescript",
|
|
16
|
+
"svelte",
|
|
17
|
+
"vitest",
|
|
18
|
+
"astro",
|
|
19
|
+
"react",
|
|
20
|
+
"qwik",
|
|
21
|
+
"node",
|
|
22
|
+
"vue"
|
|
23
|
+
];
|
|
24
|
+
const index = ({
|
|
25
|
+
extends: customExtends = {},
|
|
26
|
+
...rawConfig
|
|
27
|
+
} = {}) => {
|
|
28
|
+
let config = {};
|
|
29
|
+
for (let configName of CONFIG_OPTIONS) {
|
|
30
|
+
config[configName] = rawConfig[configName] ?? false;
|
|
31
|
+
}
|
|
32
|
+
return [
|
|
33
|
+
{
|
|
34
|
+
ignores: [
|
|
35
|
+
"**/.eslint-config-inspector/**",
|
|
36
|
+
"**/vite.config.*.timestamp-*",
|
|
37
|
+
"**/.vitepress/cache/**",
|
|
38
|
+
"**/node_modules/**",
|
|
39
|
+
"**/.svelte-kit/**",
|
|
40
|
+
"**/coverage/**",
|
|
41
|
+
"**/.history/**",
|
|
42
|
+
"**/.netlify/**",
|
|
43
|
+
"**/.vercel/**",
|
|
44
|
+
"**/.output/**",
|
|
45
|
+
"**/.astro/**",
|
|
46
|
+
"**/output/**",
|
|
47
|
+
"**/.cache/**",
|
|
48
|
+
"**/.temp/**",
|
|
49
|
+
"**/build/**",
|
|
50
|
+
"**/.nuxt/**",
|
|
51
|
+
"**/.next/**",
|
|
52
|
+
"**/dist/**",
|
|
53
|
+
"**/temp/**",
|
|
54
|
+
"**/.tmp/**",
|
|
55
|
+
"**/tmp/**"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
...[
|
|
59
|
+
core,
|
|
60
|
+
node,
|
|
61
|
+
a11y,
|
|
62
|
+
react,
|
|
63
|
+
typescript,
|
|
64
|
+
vitest,
|
|
65
|
+
astro,
|
|
66
|
+
svelte,
|
|
67
|
+
qwik,
|
|
68
|
+
vue,
|
|
69
|
+
packageJson,
|
|
70
|
+
perfectionist
|
|
71
|
+
].map((createConfigFunction) => createConfigFunction(config)),
|
|
72
|
+
...Array.isArray(customExtends) ? customExtends : [customExtends]
|
|
73
|
+
];
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
index as default
|
|
77
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const nPlugin = require("eslint-plugin-n");
|
|
4
|
+
let node = (config) => {
|
|
5
|
+
if (!config.node) {
|
|
6
|
+
return {};
|
|
7
|
+
}
|
|
8
|
+
let files = ["**/*.js", "**/*.cjs", "**/*.mjs"];
|
|
9
|
+
if (config.typescript) {
|
|
10
|
+
files.push("**/*.ts", "**/*.cts", "**/*.mts");
|
|
11
|
+
}
|
|
12
|
+
if (config.react || config.qwik) {
|
|
13
|
+
files.push("**/*.jsx");
|
|
14
|
+
if (config.typescript) {
|
|
15
|
+
files.push("**/*.tsx");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (config.astro) {
|
|
19
|
+
files.push("**/*.astro");
|
|
20
|
+
}
|
|
21
|
+
if (config.svelte) {
|
|
22
|
+
files.push("**/*.svelte");
|
|
23
|
+
}
|
|
24
|
+
if (config.vue) {
|
|
25
|
+
files.push("**/*.vue");
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
files,
|
|
29
|
+
plugins: {
|
|
30
|
+
n: nPlugin
|
|
31
|
+
},
|
|
32
|
+
rules: {
|
|
33
|
+
"n/handle-callback-err": ["error", "^(err|error)$"],
|
|
34
|
+
"n/hashbang": "error",
|
|
35
|
+
"n/no-deprecated-api": "error",
|
|
36
|
+
"n/no-exports-assign": "error",
|
|
37
|
+
"n/no-extraneous-require": "error",
|
|
38
|
+
"n/no-new-require": "error",
|
|
39
|
+
"n/no-path-concat": "error",
|
|
40
|
+
"n/no-unpublished-bin": "error",
|
|
41
|
+
"n/no-unsupported-features/es-builtins": "error",
|
|
42
|
+
"n/prefer-global/buffer": ["error", "always"],
|
|
43
|
+
"n/prefer-global/console": ["error", "always"],
|
|
44
|
+
"n/prefer-global/process": ["error", "always"],
|
|
45
|
+
"n/prefer-global/text-decoder": ["error", "always"],
|
|
46
|
+
"n/prefer-global/text-encoder": ["error", "always"],
|
|
47
|
+
"n/prefer-global/url": ["error", "always"],
|
|
48
|
+
"n/prefer-global/url-search-params": ["error", "always"],
|
|
49
|
+
"n/prefer-node-protocol": "error",
|
|
50
|
+
"n/prefer-promises/fs": "error",
|
|
51
|
+
"n/process-exit-as-throw": "error"
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
exports.node = node;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import nPlugin from "eslint-plugin-n";
|
|
2
|
+
let node = (config) => {
|
|
3
|
+
if (!config.node) {
|
|
4
|
+
return {};
|
|
5
|
+
}
|
|
6
|
+
let files = ["**/*.js", "**/*.cjs", "**/*.mjs"];
|
|
7
|
+
if (config.typescript) {
|
|
8
|
+
files.push("**/*.ts", "**/*.cts", "**/*.mts");
|
|
9
|
+
}
|
|
10
|
+
if (config.react || config.qwik) {
|
|
11
|
+
files.push("**/*.jsx");
|
|
12
|
+
if (config.typescript) {
|
|
13
|
+
files.push("**/*.tsx");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
if (config.astro) {
|
|
17
|
+
files.push("**/*.astro");
|
|
18
|
+
}
|
|
19
|
+
if (config.svelte) {
|
|
20
|
+
files.push("**/*.svelte");
|
|
21
|
+
}
|
|
22
|
+
if (config.vue) {
|
|
23
|
+
files.push("**/*.vue");
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
files,
|
|
27
|
+
plugins: {
|
|
28
|
+
n: nPlugin
|
|
29
|
+
},
|
|
30
|
+
rules: {
|
|
31
|
+
"n/handle-callback-err": ["error", "^(err|error)$"],
|
|
32
|
+
"n/hashbang": "error",
|
|
33
|
+
"n/no-deprecated-api": "error",
|
|
34
|
+
"n/no-exports-assign": "error",
|
|
35
|
+
"n/no-extraneous-require": "error",
|
|
36
|
+
"n/no-new-require": "error",
|
|
37
|
+
"n/no-path-concat": "error",
|
|
38
|
+
"n/no-unpublished-bin": "error",
|
|
39
|
+
"n/no-unsupported-features/es-builtins": "error",
|
|
40
|
+
"n/prefer-global/buffer": ["error", "always"],
|
|
41
|
+
"n/prefer-global/console": ["error", "always"],
|
|
42
|
+
"n/prefer-global/process": ["error", "always"],
|
|
43
|
+
"n/prefer-global/text-decoder": ["error", "always"],
|
|
44
|
+
"n/prefer-global/text-encoder": ["error", "always"],
|
|
45
|
+
"n/prefer-global/url": ["error", "always"],
|
|
46
|
+
"n/prefer-global/url-search-params": ["error", "always"],
|
|
47
|
+
"n/prefer-node-protocol": "error",
|
|
48
|
+
"n/prefer-promises/fs": "error",
|
|
49
|
+
"n/process-exit-as-throw": "error"
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
node
|
|
55
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const packageJsonPlugin = require("eslint-plugin-package-json");
|
|
4
|
+
const jsoncParser = require("jsonc-eslint-parser");
|
|
5
|
+
let packageJson = (_config) => ({
|
|
6
|
+
files: ["**/package.json"],
|
|
7
|
+
plugins: {
|
|
8
|
+
"package-json": packageJsonPlugin
|
|
9
|
+
},
|
|
10
|
+
languageOptions: {
|
|
11
|
+
parser: jsoncParser
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
"package-json/order-properties": [
|
|
15
|
+
"error",
|
|
16
|
+
{
|
|
17
|
+
order: "sort-package-json"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"package-json/repository-shorthand": [
|
|
21
|
+
"error",
|
|
22
|
+
{
|
|
23
|
+
form: "shorthand"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"package-json/sort-collections": "error",
|
|
27
|
+
"package-json/unique-dependencies": "error",
|
|
28
|
+
"package-json/valid-local-dependency": "error",
|
|
29
|
+
"package-json/valid-name": "error",
|
|
30
|
+
"package-json/valid-package-def": "error",
|
|
31
|
+
"package-json/valid-version": "error"
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
exports.packageJson = packageJson;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import packageJsonPlugin from "eslint-plugin-package-json";
|
|
2
|
+
import jsoncParser from "jsonc-eslint-parser";
|
|
3
|
+
let packageJson = (_config) => ({
|
|
4
|
+
files: ["**/package.json"],
|
|
5
|
+
plugins: {
|
|
6
|
+
"package-json": packageJsonPlugin
|
|
7
|
+
},
|
|
8
|
+
languageOptions: {
|
|
9
|
+
parser: jsoncParser
|
|
10
|
+
},
|
|
11
|
+
rules: {
|
|
12
|
+
"package-json/order-properties": [
|
|
13
|
+
"error",
|
|
14
|
+
{
|
|
15
|
+
order: "sort-package-json"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"package-json/repository-shorthand": [
|
|
19
|
+
"error",
|
|
20
|
+
{
|
|
21
|
+
form: "shorthand"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"package-json/sort-collections": "error",
|
|
25
|
+
"package-json/unique-dependencies": "error",
|
|
26
|
+
"package-json/valid-local-dependency": "error",
|
|
27
|
+
"package-json/valid-name": "error",
|
|
28
|
+
"package-json/valid-package-def": "error",
|
|
29
|
+
"package-json/valid-version": "error"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
packageJson
|
|
34
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const perfectionistPlugin = require("eslint-plugin-perfectionist");
|
|
4
|
+
let perfectionist = (config) => {
|
|
5
|
+
if (!config.perfectionist) {
|
|
6
|
+
return {};
|
|
7
|
+
}
|
|
8
|
+
let files = ["**/*.js", "**/*.cjs", "**/*.mjs"];
|
|
9
|
+
if (config.typescript) {
|
|
10
|
+
files.push("**/*.ts", "**/*.cts", "**/*.mts");
|
|
11
|
+
}
|
|
12
|
+
if (config.react || config.qwik) {
|
|
13
|
+
files.push("**/*.jsx");
|
|
14
|
+
if (config.typescript) {
|
|
15
|
+
files.push("**/*.tsx");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (config.astro) {
|
|
19
|
+
files.push("**/*.astro");
|
|
20
|
+
}
|
|
21
|
+
if (config.svelte) {
|
|
22
|
+
files.push("**/*.svelte");
|
|
23
|
+
}
|
|
24
|
+
if (config.vue) {
|
|
25
|
+
files.push("**/*.vue");
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
files,
|
|
29
|
+
plugins: {
|
|
30
|
+
perfectionist: perfectionistPlugin
|
|
31
|
+
},
|
|
32
|
+
rules: {
|
|
33
|
+
"perfectionist/sort-array-includes": ["error"],
|
|
34
|
+
"perfectionist/sort-classes": ["error"],
|
|
35
|
+
"perfectionist/sort-enums": ["error"],
|
|
36
|
+
"perfectionist/sort-exports": ["error"],
|
|
37
|
+
"perfectionist/sort-imports": ["error"],
|
|
38
|
+
"perfectionist/sort-interfaces": ["error"],
|
|
39
|
+
"perfectionist/sort-intersection-types": ["error"],
|
|
40
|
+
"perfectionist/sort-jsx-props": ["error"],
|
|
41
|
+
"perfectionist/sort-maps": ["error"],
|
|
42
|
+
"perfectionist/sort-named-exports": ["error"],
|
|
43
|
+
"perfectionist/sort-named-imports": ["error"],
|
|
44
|
+
"perfectionist/sort-object-types": ["error"],
|
|
45
|
+
"perfectionist/sort-objects": ["error"],
|
|
46
|
+
"perfectionist/sort-sets": ["error"],
|
|
47
|
+
"perfectionist/sort-switch-case": ["error"],
|
|
48
|
+
"perfectionist/sort-union-types": ["error"],
|
|
49
|
+
"perfectionist/sort-variable-declarations": ["error"]
|
|
50
|
+
},
|
|
51
|
+
settings: {
|
|
52
|
+
perfectionist: {
|
|
53
|
+
order: "desc",
|
|
54
|
+
type: "line-length"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
exports.perfectionist = perfectionist;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import perfectionistPlugin from "eslint-plugin-perfectionist";
|
|
2
|
+
let perfectionist = (config) => {
|
|
3
|
+
if (!config.perfectionist) {
|
|
4
|
+
return {};
|
|
5
|
+
}
|
|
6
|
+
let files = ["**/*.js", "**/*.cjs", "**/*.mjs"];
|
|
7
|
+
if (config.typescript) {
|
|
8
|
+
files.push("**/*.ts", "**/*.cts", "**/*.mts");
|
|
9
|
+
}
|
|
10
|
+
if (config.react || config.qwik) {
|
|
11
|
+
files.push("**/*.jsx");
|
|
12
|
+
if (config.typescript) {
|
|
13
|
+
files.push("**/*.tsx");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
if (config.astro) {
|
|
17
|
+
files.push("**/*.astro");
|
|
18
|
+
}
|
|
19
|
+
if (config.svelte) {
|
|
20
|
+
files.push("**/*.svelte");
|
|
21
|
+
}
|
|
22
|
+
if (config.vue) {
|
|
23
|
+
files.push("**/*.vue");
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
files,
|
|
27
|
+
plugins: {
|
|
28
|
+
perfectionist: perfectionistPlugin
|
|
29
|
+
},
|
|
30
|
+
rules: {
|
|
31
|
+
"perfectionist/sort-array-includes": ["error"],
|
|
32
|
+
"perfectionist/sort-classes": ["error"],
|
|
33
|
+
"perfectionist/sort-enums": ["error"],
|
|
34
|
+
"perfectionist/sort-exports": ["error"],
|
|
35
|
+
"perfectionist/sort-imports": ["error"],
|
|
36
|
+
"perfectionist/sort-interfaces": ["error"],
|
|
37
|
+
"perfectionist/sort-intersection-types": ["error"],
|
|
38
|
+
"perfectionist/sort-jsx-props": ["error"],
|
|
39
|
+
"perfectionist/sort-maps": ["error"],
|
|
40
|
+
"perfectionist/sort-named-exports": ["error"],
|
|
41
|
+
"perfectionist/sort-named-imports": ["error"],
|
|
42
|
+
"perfectionist/sort-object-types": ["error"],
|
|
43
|
+
"perfectionist/sort-objects": ["error"],
|
|
44
|
+
"perfectionist/sort-sets": ["error"],
|
|
45
|
+
"perfectionist/sort-switch-case": ["error"],
|
|
46
|
+
"perfectionist/sort-union-types": ["error"],
|
|
47
|
+
"perfectionist/sort-variable-declarations": ["error"]
|
|
48
|
+
},
|
|
49
|
+
settings: {
|
|
50
|
+
perfectionist: {
|
|
51
|
+
order: "desc",
|
|
52
|
+
type: "line-length"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
perfectionist
|
|
59
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const qwikPlugin = require("eslint-plugin-qwik");
|
|
4
|
+
let qwik = (config) => {
|
|
5
|
+
if (!config.qwik) {
|
|
6
|
+
return {};
|
|
7
|
+
}
|
|
8
|
+
let files = ["**/*.jsx"];
|
|
9
|
+
if (config.typescript) {
|
|
10
|
+
files.push("**/*.tsx");
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
files,
|
|
14
|
+
plugins: {
|
|
15
|
+
qwik: qwikPlugin
|
|
16
|
+
},
|
|
17
|
+
rules: {
|
|
18
|
+
"qwik/jsx-a": "error",
|
|
19
|
+
"qwik/jsx-img": "error",
|
|
20
|
+
"qwik/jsx-key": "error",
|
|
21
|
+
"qwik/loader-location": "error",
|
|
22
|
+
"qwik/no-react-props": "error",
|
|
23
|
+
"qwik/no-use-visible-task": "error",
|
|
24
|
+
"qwik/prefer-classlist": "error",
|
|
25
|
+
"qwik/unused-server": "error",
|
|
26
|
+
"qwik/use-method-usage": "error",
|
|
27
|
+
"qwik/valid-lexical-scope": "error"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
exports.qwik = qwik;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import qwikPlugin from "eslint-plugin-qwik";
|
|
2
|
+
let qwik = (config) => {
|
|
3
|
+
if (!config.qwik) {
|
|
4
|
+
return {};
|
|
5
|
+
}
|
|
6
|
+
let files = ["**/*.jsx"];
|
|
7
|
+
if (config.typescript) {
|
|
8
|
+
files.push("**/*.tsx");
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
files,
|
|
12
|
+
plugins: {
|
|
13
|
+
qwik: qwikPlugin
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
"qwik/jsx-a": "error",
|
|
17
|
+
"qwik/jsx-img": "error",
|
|
18
|
+
"qwik/jsx-key": "error",
|
|
19
|
+
"qwik/loader-location": "error",
|
|
20
|
+
"qwik/no-react-props": "error",
|
|
21
|
+
"qwik/no-use-visible-task": "error",
|
|
22
|
+
"qwik/prefer-classlist": "error",
|
|
23
|
+
"qwik/unused-server": "error",
|
|
24
|
+
"qwik/use-method-usage": "error",
|
|
25
|
+
"qwik/valid-lexical-scope": "error"
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
qwik
|
|
31
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const reactCompilerPlugin = require("eslint-plugin-react-compiler");
|
|
4
|
+
const reactHooksPlugin = require("eslint-plugin-react-hooks");
|
|
5
|
+
const reactPerfPlugin = require("eslint-plugin-react-perf");
|
|
6
|
+
const reactPlugin = require("eslint-plugin-react");
|
|
7
|
+
let react = (config) => {
|
|
8
|
+
if (!config.react) {
|
|
9
|
+
return {};
|
|
10
|
+
}
|
|
11
|
+
let files = ["**/*.jsx"];
|
|
12
|
+
if (config.typescript) {
|
|
13
|
+
files.push("**/*.tsx");
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
files,
|
|
17
|
+
plugins: {
|
|
18
|
+
react: reactPlugin,
|
|
19
|
+
"react-compiler": reactCompilerPlugin,
|
|
20
|
+
"react-hooks": reactHooksPlugin,
|
|
21
|
+
"react-perf": reactPerfPlugin
|
|
22
|
+
},
|
|
23
|
+
rules: {
|
|
24
|
+
"react/button-has-type": "error",
|
|
25
|
+
"react/checked-requires-onchange-or-readonly": "error",
|
|
26
|
+
"react/forbid-prop-types": "error",
|
|
27
|
+
"react/forward-ref-uses-ref": "error",
|
|
28
|
+
"react/function-component-definition": [
|
|
29
|
+
"error",
|
|
30
|
+
{
|
|
31
|
+
namedComponents: "arrow-function"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"react/hook-use-state": [
|
|
35
|
+
"error",
|
|
36
|
+
{
|
|
37
|
+
allowDestructuredState: true
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"react/jsx-boolean-value": "error",
|
|
41
|
+
"react/jsx-curly-brace-presence": [
|
|
42
|
+
"error",
|
|
43
|
+
{
|
|
44
|
+
children: "never",
|
|
45
|
+
propElementValues: "always",
|
|
46
|
+
props: "never"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"react/jsx-fragments": "error",
|
|
50
|
+
"react/jsx-key": "error",
|
|
51
|
+
"react/jsx-no-comment-textnodes": "error",
|
|
52
|
+
"react/jsx-no-constructed-context-values": "error",
|
|
53
|
+
"react/jsx-no-duplicate-props": "error",
|
|
54
|
+
"react/jsx-no-leaked-render": "error",
|
|
55
|
+
"react/jsx-no-target-blank": "error",
|
|
56
|
+
"react/jsx-no-undef": "error",
|
|
57
|
+
"react/jsx-no-useless-fragment": "error",
|
|
58
|
+
"react/jsx-pascal-case": "error",
|
|
59
|
+
"react/jsx-uses-vars": "error",
|
|
60
|
+
"react/no-array-index-key": "error",
|
|
61
|
+
"react/no-arrow-function-lifecycle": "error",
|
|
62
|
+
"react/no-children-prop": "error",
|
|
63
|
+
"react/no-danger-with-children": "error",
|
|
64
|
+
"react/no-deprecated": "error",
|
|
65
|
+
"react/no-did-mount-set-state": "error",
|
|
66
|
+
"react/no-did-update-set-state": "error",
|
|
67
|
+
"react/no-direct-mutation-state": "error",
|
|
68
|
+
"react/no-find-dom-node": "error",
|
|
69
|
+
"react/no-invalid-html-attribute": "error",
|
|
70
|
+
"react/no-is-mounted": "error",
|
|
71
|
+
"react/no-namespace": "error",
|
|
72
|
+
"react/no-redundant-should-component-update": "error",
|
|
73
|
+
"react/no-render-return-value": "error",
|
|
74
|
+
"react/no-string-refs": "error",
|
|
75
|
+
"react/no-this-in-sfc": "error",
|
|
76
|
+
"react/no-typos": "error",
|
|
77
|
+
"react/no-unescaped-entities": "error",
|
|
78
|
+
"react/no-unknown-property": "error",
|
|
79
|
+
"react/no-unused-class-component-methods": "error",
|
|
80
|
+
"react/no-unused-state": "error",
|
|
81
|
+
"react/no-will-update-set-state": "error",
|
|
82
|
+
"react/require-render-return": "error",
|
|
83
|
+
"react/self-closing-comp": [
|
|
84
|
+
"error",
|
|
85
|
+
{
|
|
86
|
+
component: true,
|
|
87
|
+
html: true
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"react/style-prop-object": "error",
|
|
91
|
+
"react/void-dom-elements-no-children": "error",
|
|
92
|
+
"react-compiler/react-compiler": "error",
|
|
93
|
+
"react-hooks/exhaustive-deps": "error",
|
|
94
|
+
"react-hooks/rules-of-hooks": "error",
|
|
95
|
+
"react-perf/jsx-no-jsx-as-prop": "error",
|
|
96
|
+
"react-perf/jsx-no-new-array-as-prop": "error",
|
|
97
|
+
"react-perf/jsx-no-new-function-as-prop": "error",
|
|
98
|
+
"react-perf/jsx-no-new-object-as-prop": "error"
|
|
99
|
+
},
|
|
100
|
+
settings: {
|
|
101
|
+
react: {
|
|
102
|
+
fragment: "Fragment",
|
|
103
|
+
pragma: "React",
|
|
104
|
+
version: "detect"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
exports.react = react;
|