@lzear/eslint-config 2.0.0 → 3.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/configs/a11y/index.cjs +54 -0
- package/dist/configs/a11y/index.mjs +54 -0
- package/dist/configs/core/index.cjs +88 -0
- package/dist/configs/core/index.mjs +88 -0
- package/dist/configs/node/index.cjs +49 -0
- package/dist/configs/node/index.mjs +31 -0
- package/dist/configs/package-json/index.cjs +33 -0
- package/dist/configs/package-json/index.mjs +16 -0
- package/dist/configs/perfectionist/index.cjs +73 -0
- package/dist/configs/perfectionist/index.mjs +55 -0
- package/dist/configs/react/index.cjs +73 -0
- package/dist/configs/react/index.mjs +55 -0
- package/dist/configs/src/files.cjs +24 -0
- package/dist/configs/src/files.mjs +24 -0
- package/dist/configs/typescript/index.cjs +53 -0
- package/dist/configs/typescript/index.mjs +35 -0
- package/dist/configs/vitest/index.cjs +65 -0
- package/dist/configs/vitest/index.mjs +47 -0
- package/dist/index.cjs +59 -0
- package/dist/index.d.ts +17 -4
- package/dist/index.mjs +56 -67
- package/dist/utils.cjs +21 -0
- package/dist/utils.mjs +21 -0
- package/license.md +20 -0
- package/package.json +41 -44
- package/readme.md +31 -23
- package/dist/index.js +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxA11y = require("eslint-plugin-jsx-a11y");
|
|
4
|
+
const a11y = (config) => {
|
|
5
|
+
if (!config.react) {
|
|
6
|
+
return {};
|
|
7
|
+
}
|
|
8
|
+
const files = ["**/*.jsx"];
|
|
9
|
+
if (config.typescript) {
|
|
10
|
+
files.push("**/*.tsx");
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
name: "lzear/a11y",
|
|
14
|
+
files,
|
|
15
|
+
plugins: {
|
|
16
|
+
"jsx-a11y": jsxA11y
|
|
17
|
+
},
|
|
18
|
+
rules: {
|
|
19
|
+
"jsx-a11y/alt-text": "error",
|
|
20
|
+
"jsx-a11y/anchor-has-content": "error",
|
|
21
|
+
"jsx-a11y/anchor-is-valid": "error",
|
|
22
|
+
"jsx-a11y/aria-activedescendant-has-tabindex": "error",
|
|
23
|
+
"jsx-a11y/aria-props": "error",
|
|
24
|
+
"jsx-a11y/aria-proptypes": "error",
|
|
25
|
+
"jsx-a11y/aria-role": "error",
|
|
26
|
+
"jsx-a11y/aria-unsupported-elements": "error",
|
|
27
|
+
"jsx-a11y/autocomplete-valid": "error",
|
|
28
|
+
"jsx-a11y/heading-has-content": "error",
|
|
29
|
+
"jsx-a11y/html-has-lang": "error",
|
|
30
|
+
"jsx-a11y/iframe-has-title": "error",
|
|
31
|
+
"jsx-a11y/img-redundant-alt": "error",
|
|
32
|
+
"jsx-a11y/interactive-supports-focus": "error",
|
|
33
|
+
"jsx-a11y/label-has-associated-control": "error",
|
|
34
|
+
"jsx-a11y/lang": "error",
|
|
35
|
+
"jsx-a11y/media-has-caption": "error",
|
|
36
|
+
"jsx-a11y/mouse-events-have-key-events": "error",
|
|
37
|
+
"jsx-a11y/no-access-key": "error",
|
|
38
|
+
"jsx-a11y/no-aria-hidden-on-focusable": "error",
|
|
39
|
+
"jsx-a11y/no-autofocus": "error",
|
|
40
|
+
"jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
|
|
41
|
+
"jsx-a11y/no-noninteractive-element-interactions": "error",
|
|
42
|
+
"jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
|
|
43
|
+
"jsx-a11y/no-noninteractive-tabindex": "error",
|
|
44
|
+
"jsx-a11y/no-redundant-roles": "error",
|
|
45
|
+
"jsx-a11y/no-static-element-interactions": "error",
|
|
46
|
+
"jsx-a11y/prefer-tag-over-role": "error",
|
|
47
|
+
"jsx-a11y/role-has-required-aria-props": "error",
|
|
48
|
+
"jsx-a11y/role-supports-aria-props": "error",
|
|
49
|
+
"jsx-a11y/scope": "error",
|
|
50
|
+
"jsx-a11y/tabindex-no-positive": "error"
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
exports.a11y = a11y;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
2
|
+
const a11y = (config) => {
|
|
3
|
+
if (!config.react) {
|
|
4
|
+
return {};
|
|
5
|
+
}
|
|
6
|
+
const files = ["**/*.jsx"];
|
|
7
|
+
if (config.typescript) {
|
|
8
|
+
files.push("**/*.tsx");
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
name: "lzear/a11y",
|
|
12
|
+
files,
|
|
13
|
+
plugins: {
|
|
14
|
+
"jsx-a11y": jsxA11y
|
|
15
|
+
},
|
|
16
|
+
rules: {
|
|
17
|
+
"jsx-a11y/alt-text": "error",
|
|
18
|
+
"jsx-a11y/anchor-has-content": "error",
|
|
19
|
+
"jsx-a11y/anchor-is-valid": "error",
|
|
20
|
+
"jsx-a11y/aria-activedescendant-has-tabindex": "error",
|
|
21
|
+
"jsx-a11y/aria-props": "error",
|
|
22
|
+
"jsx-a11y/aria-proptypes": "error",
|
|
23
|
+
"jsx-a11y/aria-role": "error",
|
|
24
|
+
"jsx-a11y/aria-unsupported-elements": "error",
|
|
25
|
+
"jsx-a11y/autocomplete-valid": "error",
|
|
26
|
+
"jsx-a11y/heading-has-content": "error",
|
|
27
|
+
"jsx-a11y/html-has-lang": "error",
|
|
28
|
+
"jsx-a11y/iframe-has-title": "error",
|
|
29
|
+
"jsx-a11y/img-redundant-alt": "error",
|
|
30
|
+
"jsx-a11y/interactive-supports-focus": "error",
|
|
31
|
+
"jsx-a11y/label-has-associated-control": "error",
|
|
32
|
+
"jsx-a11y/lang": "error",
|
|
33
|
+
"jsx-a11y/media-has-caption": "error",
|
|
34
|
+
"jsx-a11y/mouse-events-have-key-events": "error",
|
|
35
|
+
"jsx-a11y/no-access-key": "error",
|
|
36
|
+
"jsx-a11y/no-aria-hidden-on-focusable": "error",
|
|
37
|
+
"jsx-a11y/no-autofocus": "error",
|
|
38
|
+
"jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
|
|
39
|
+
"jsx-a11y/no-noninteractive-element-interactions": "error",
|
|
40
|
+
"jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
|
|
41
|
+
"jsx-a11y/no-noninteractive-tabindex": "error",
|
|
42
|
+
"jsx-a11y/no-redundant-roles": "error",
|
|
43
|
+
"jsx-a11y/no-static-element-interactions": "error",
|
|
44
|
+
"jsx-a11y/prefer-tag-over-role": "error",
|
|
45
|
+
"jsx-a11y/role-has-required-aria-props": "error",
|
|
46
|
+
"jsx-a11y/role-supports-aria-props": "error",
|
|
47
|
+
"jsx-a11y/scope": "error",
|
|
48
|
+
"jsx-a11y/tabindex-no-positive": "error"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
a11y
|
|
54
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const js = require("@eslint/js");
|
|
4
|
+
const eslintCommentsPlugin = require("@eslint-community/eslint-plugin-eslint-comments");
|
|
5
|
+
const deMorganPlugin = require("eslint-plugin-de-morgan");
|
|
6
|
+
const importXPlugin = require("eslint-plugin-import-x");
|
|
7
|
+
const preferArrowPlugin = require("eslint-plugin-prefer-arrow");
|
|
8
|
+
const promisePlugin = require("eslint-plugin-promise");
|
|
9
|
+
const regexpPlugin = require("eslint-plugin-regexp");
|
|
10
|
+
const sonarjsPlugin = require("eslint-plugin-sonarjs");
|
|
11
|
+
const unicornPlugin = require("eslint-plugin-unicorn");
|
|
12
|
+
const globals = require("globals");
|
|
13
|
+
const core = () => {
|
|
14
|
+
const files = [
|
|
15
|
+
"**/*.js",
|
|
16
|
+
"**/*.cjs",
|
|
17
|
+
"**/*.mjs",
|
|
18
|
+
"**/*.ts",
|
|
19
|
+
"**/*.cts",
|
|
20
|
+
"**/*.mts",
|
|
21
|
+
"**/*.jsx",
|
|
22
|
+
"**/*.tsx"
|
|
23
|
+
];
|
|
24
|
+
const rules = {
|
|
25
|
+
...js.configs.recommended.rules,
|
|
26
|
+
...eslintCommentsPlugin.configs.recommended.rules,
|
|
27
|
+
"@eslint-community/eslint-comments/disable-enable-pair": 0,
|
|
28
|
+
"@eslint-community/eslint-comments/no-unlimited-disable": 0,
|
|
29
|
+
...deMorganPlugin.configs.recommended.rules,
|
|
30
|
+
...importXPlugin.configs.recommended.rules,
|
|
31
|
+
"import-x/no-unresolved": 0,
|
|
32
|
+
"import-x/order": [
|
|
33
|
+
2,
|
|
34
|
+
{
|
|
35
|
+
alphabetize: { order: "asc", orderImportKind: "asc" },
|
|
36
|
+
"newlines-between": "never"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"prefer-arrow/prefer-arrow-functions": [
|
|
40
|
+
2,
|
|
41
|
+
{
|
|
42
|
+
classPropertiesAllowed: false,
|
|
43
|
+
disallowPrototype: true,
|
|
44
|
+
singleReturnOnly: false
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
...promisePlugin.configs.recommended.rules,
|
|
48
|
+
...regexpPlugin.configs.recommended.rules,
|
|
49
|
+
...sonarjsPlugin.configs.recommended.rules,
|
|
50
|
+
"sonarjs/fixme-tag": 0,
|
|
51
|
+
"sonarjs/pseudo-random": 0,
|
|
52
|
+
"sonarjs/todo-tag": 0,
|
|
53
|
+
"sonarjs/void-use": 0,
|
|
54
|
+
...unicornPlugin.configs.recommended.rules,
|
|
55
|
+
"unicorn/no-abusive-eslint-disable": 0,
|
|
56
|
+
"unicorn/no-nested-ternary": 0,
|
|
57
|
+
"unicorn/no-null": 0,
|
|
58
|
+
"unicorn/number-literal-case": 0,
|
|
59
|
+
"unicorn/prevent-abbreviations": 0
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
name: "lzear/core",
|
|
63
|
+
files,
|
|
64
|
+
languageOptions: {
|
|
65
|
+
globals: {
|
|
66
|
+
...globals.browser,
|
|
67
|
+
...globals.es2025,
|
|
68
|
+
...globals.node
|
|
69
|
+
},
|
|
70
|
+
parserOptions: {
|
|
71
|
+
ecmaVersion: "latest",
|
|
72
|
+
sourceType: "module"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
plugins: {
|
|
76
|
+
"@eslint-community/eslint-comments": eslintCommentsPlugin,
|
|
77
|
+
"de-morgan": deMorganPlugin,
|
|
78
|
+
"import-x": importXPlugin,
|
|
79
|
+
"prefer-arrow": preferArrowPlugin,
|
|
80
|
+
promise: promisePlugin,
|
|
81
|
+
regexp: regexpPlugin,
|
|
82
|
+
sonarjs: sonarjsPlugin,
|
|
83
|
+
unicorn: unicornPlugin
|
|
84
|
+
},
|
|
85
|
+
rules
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
exports.core = core;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import eslintCommentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
|
|
3
|
+
import deMorganPlugin from "eslint-plugin-de-morgan";
|
|
4
|
+
import importXPlugin from "eslint-plugin-import-x";
|
|
5
|
+
import preferArrowPlugin from "eslint-plugin-prefer-arrow";
|
|
6
|
+
import promisePlugin from "eslint-plugin-promise";
|
|
7
|
+
import regexpPlugin from "eslint-plugin-regexp";
|
|
8
|
+
import sonarjsPlugin from "eslint-plugin-sonarjs";
|
|
9
|
+
import unicornPlugin from "eslint-plugin-unicorn";
|
|
10
|
+
import globals from "globals";
|
|
11
|
+
const core = () => {
|
|
12
|
+
const files = [
|
|
13
|
+
"**/*.js",
|
|
14
|
+
"**/*.cjs",
|
|
15
|
+
"**/*.mjs",
|
|
16
|
+
"**/*.ts",
|
|
17
|
+
"**/*.cts",
|
|
18
|
+
"**/*.mts",
|
|
19
|
+
"**/*.jsx",
|
|
20
|
+
"**/*.tsx"
|
|
21
|
+
];
|
|
22
|
+
const rules = {
|
|
23
|
+
...js.configs.recommended.rules,
|
|
24
|
+
...eslintCommentsPlugin.configs.recommended.rules,
|
|
25
|
+
"@eslint-community/eslint-comments/disable-enable-pair": 0,
|
|
26
|
+
"@eslint-community/eslint-comments/no-unlimited-disable": 0,
|
|
27
|
+
...deMorganPlugin.configs.recommended.rules,
|
|
28
|
+
...importXPlugin.configs.recommended.rules,
|
|
29
|
+
"import-x/no-unresolved": 0,
|
|
30
|
+
"import-x/order": [
|
|
31
|
+
2,
|
|
32
|
+
{
|
|
33
|
+
alphabetize: { order: "asc", orderImportKind: "asc" },
|
|
34
|
+
"newlines-between": "never"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"prefer-arrow/prefer-arrow-functions": [
|
|
38
|
+
2,
|
|
39
|
+
{
|
|
40
|
+
classPropertiesAllowed: false,
|
|
41
|
+
disallowPrototype: true,
|
|
42
|
+
singleReturnOnly: false
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
...promisePlugin.configs.recommended.rules,
|
|
46
|
+
...regexpPlugin.configs.recommended.rules,
|
|
47
|
+
...sonarjsPlugin.configs.recommended.rules,
|
|
48
|
+
"sonarjs/fixme-tag": 0,
|
|
49
|
+
"sonarjs/pseudo-random": 0,
|
|
50
|
+
"sonarjs/todo-tag": 0,
|
|
51
|
+
"sonarjs/void-use": 0,
|
|
52
|
+
...unicornPlugin.configs.recommended.rules,
|
|
53
|
+
"unicorn/no-abusive-eslint-disable": 0,
|
|
54
|
+
"unicorn/no-nested-ternary": 0,
|
|
55
|
+
"unicorn/no-null": 0,
|
|
56
|
+
"unicorn/number-literal-case": 0,
|
|
57
|
+
"unicorn/prevent-abbreviations": 0
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
name: "lzear/core",
|
|
61
|
+
files,
|
|
62
|
+
languageOptions: {
|
|
63
|
+
globals: {
|
|
64
|
+
...globals.browser,
|
|
65
|
+
...globals.es2025,
|
|
66
|
+
...globals.node
|
|
67
|
+
},
|
|
68
|
+
parserOptions: {
|
|
69
|
+
ecmaVersion: "latest",
|
|
70
|
+
sourceType: "module"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
plugins: {
|
|
74
|
+
"@eslint-community/eslint-comments": eslintCommentsPlugin,
|
|
75
|
+
"de-morgan": deMorganPlugin,
|
|
76
|
+
"import-x": importXPlugin,
|
|
77
|
+
"prefer-arrow": preferArrowPlugin,
|
|
78
|
+
promise: promisePlugin,
|
|
79
|
+
regexp: regexpPlugin,
|
|
80
|
+
sonarjs: sonarjsPlugin,
|
|
81
|
+
unicorn: unicornPlugin
|
|
82
|
+
},
|
|
83
|
+
rules
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export {
|
|
87
|
+
core
|
|
88
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
|
+
mod
|
|
19
|
+
));
|
|
20
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
21
|
+
const utils = require("../../utils.cjs");
|
|
22
|
+
const node = async (config) => {
|
|
23
|
+
if (!config.node) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
const nodePlugin = await utils.interopDefault(import("eslint-plugin-n"));
|
|
27
|
+
const files = ["**/*.js", "**/*.cjs", "**/*.mjs"];
|
|
28
|
+
if (config.typescript) {
|
|
29
|
+
files.push("**/*.ts", "**/*.cts", "**/*.mts");
|
|
30
|
+
}
|
|
31
|
+
if (config.react) {
|
|
32
|
+
files.push("**/*.jsx");
|
|
33
|
+
if (config.typescript) {
|
|
34
|
+
files.push("**/*.tsx");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
name: "lzear/node",
|
|
39
|
+
files,
|
|
40
|
+
plugins: {
|
|
41
|
+
n: nodePlugin
|
|
42
|
+
},
|
|
43
|
+
rules: {
|
|
44
|
+
...nodePlugin.configs["recommended-module"].rules,
|
|
45
|
+
"n/no-missing-import": 0
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
exports.node = node;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { interopDefault } from "../../utils.mjs";
|
|
2
|
+
const node = async (config) => {
|
|
3
|
+
if (!config.node) {
|
|
4
|
+
return {};
|
|
5
|
+
}
|
|
6
|
+
const nodePlugin = await interopDefault(import("eslint-plugin-n"));
|
|
7
|
+
const files = ["**/*.js", "**/*.cjs", "**/*.mjs"];
|
|
8
|
+
if (config.typescript) {
|
|
9
|
+
files.push("**/*.ts", "**/*.cts", "**/*.mts");
|
|
10
|
+
}
|
|
11
|
+
if (config.react) {
|
|
12
|
+
files.push("**/*.jsx");
|
|
13
|
+
if (config.typescript) {
|
|
14
|
+
files.push("**/*.tsx");
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
name: "lzear/node",
|
|
19
|
+
files,
|
|
20
|
+
plugins: {
|
|
21
|
+
n: nodePlugin
|
|
22
|
+
},
|
|
23
|
+
rules: {
|
|
24
|
+
...nodePlugin.configs["recommended-module"].rules,
|
|
25
|
+
"n/no-missing-import": 0
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
node
|
|
31
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
function _interopNamespaceDefault(e) {
|
|
6
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
|
+
if (e) {
|
|
8
|
+
for (const k in e) {
|
|
9
|
+
if (k !== "default") {
|
|
10
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: () => e[k]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
n.default = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
const packageJsonPlugin__namespace = /* @__PURE__ */ _interopNamespaceDefault(packageJsonPlugin);
|
|
22
|
+
const packageJson = () => ({
|
|
23
|
+
name: "lzear/package-json",
|
|
24
|
+
files: ["**/package.json"],
|
|
25
|
+
plugins: {
|
|
26
|
+
"package-json": packageJsonPlugin__namespace
|
|
27
|
+
},
|
|
28
|
+
languageOptions: {
|
|
29
|
+
parser: jsoncParser
|
|
30
|
+
},
|
|
31
|
+
rules: packageJsonPlugin__namespace.configs.recommended.rules
|
|
32
|
+
});
|
|
33
|
+
exports.packageJson = packageJson;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as packageJsonPlugin from "eslint-plugin-package-json";
|
|
2
|
+
import jsoncParser from "jsonc-eslint-parser";
|
|
3
|
+
const packageJson = () => ({
|
|
4
|
+
name: "lzear/package-json",
|
|
5
|
+
files: ["**/package.json"],
|
|
6
|
+
plugins: {
|
|
7
|
+
"package-json": packageJsonPlugin
|
|
8
|
+
},
|
|
9
|
+
languageOptions: {
|
|
10
|
+
parser: jsoncParser
|
|
11
|
+
},
|
|
12
|
+
rules: packageJsonPlugin.configs.recommended.rules
|
|
13
|
+
});
|
|
14
|
+
export {
|
|
15
|
+
packageJson
|
|
16
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
|
+
mod
|
|
19
|
+
));
|
|
20
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
21
|
+
const utils = require("../../utils.cjs");
|
|
22
|
+
const perfectionist = async (config) => {
|
|
23
|
+
if (!config.perfectionist) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
const perfectionistPlugin = await utils.interopDefault(
|
|
27
|
+
import("eslint-plugin-perfectionist")
|
|
28
|
+
);
|
|
29
|
+
const files = ["**/*.js", "**/*.cjs", "**/*.mjs"];
|
|
30
|
+
if (config.typescript) {
|
|
31
|
+
files.push("**/*.ts", "**/*.cts", "**/*.mts");
|
|
32
|
+
}
|
|
33
|
+
if (config.react) {
|
|
34
|
+
files.push("**/*.jsx");
|
|
35
|
+
if (config.typescript) {
|
|
36
|
+
files.push("**/*.tsx");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
name: "lzear/perfectionist",
|
|
41
|
+
files,
|
|
42
|
+
plugins: {
|
|
43
|
+
perfectionist: perfectionistPlugin
|
|
44
|
+
},
|
|
45
|
+
rules: {
|
|
46
|
+
"perfectionist/sort-array-includes": ["error"],
|
|
47
|
+
"perfectionist/sort-classes": ["error"],
|
|
48
|
+
"perfectionist/sort-decorators": ["error"],
|
|
49
|
+
"perfectionist/sort-enums": ["error"],
|
|
50
|
+
"perfectionist/sort-exports": ["error"],
|
|
51
|
+
"perfectionist/sort-heritage-clauses": ["error"],
|
|
52
|
+
"perfectionist/sort-interfaces": ["error"],
|
|
53
|
+
"perfectionist/sort-intersection-types": ["error"],
|
|
54
|
+
"perfectionist/sort-jsx-props": ["error"],
|
|
55
|
+
"perfectionist/sort-maps": ["error"],
|
|
56
|
+
"perfectionist/sort-named-exports": ["error"],
|
|
57
|
+
"perfectionist/sort-named-imports": ["error"],
|
|
58
|
+
"perfectionist/sort-object-types": ["error"],
|
|
59
|
+
"perfectionist/sort-objects": ["error"],
|
|
60
|
+
"perfectionist/sort-sets": ["error"],
|
|
61
|
+
"perfectionist/sort-switch-case": ["error"],
|
|
62
|
+
"perfectionist/sort-union-types": ["error"],
|
|
63
|
+
"perfectionist/sort-variable-declarations": ["error"]
|
|
64
|
+
},
|
|
65
|
+
settings: {
|
|
66
|
+
perfectionist: {
|
|
67
|
+
order: "desc",
|
|
68
|
+
type: "line-length"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
exports.perfectionist = perfectionist;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { interopDefault } from "../../utils.mjs";
|
|
2
|
+
const perfectionist = async (config) => {
|
|
3
|
+
if (!config.perfectionist) {
|
|
4
|
+
return {};
|
|
5
|
+
}
|
|
6
|
+
const perfectionistPlugin = await interopDefault(
|
|
7
|
+
import("eslint-plugin-perfectionist")
|
|
8
|
+
);
|
|
9
|
+
const files = ["**/*.js", "**/*.cjs", "**/*.mjs"];
|
|
10
|
+
if (config.typescript) {
|
|
11
|
+
files.push("**/*.ts", "**/*.cts", "**/*.mts");
|
|
12
|
+
}
|
|
13
|
+
if (config.react) {
|
|
14
|
+
files.push("**/*.jsx");
|
|
15
|
+
if (config.typescript) {
|
|
16
|
+
files.push("**/*.tsx");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
name: "lzear/perfectionist",
|
|
21
|
+
files,
|
|
22
|
+
plugins: {
|
|
23
|
+
perfectionist: perfectionistPlugin
|
|
24
|
+
},
|
|
25
|
+
rules: {
|
|
26
|
+
"perfectionist/sort-array-includes": ["error"],
|
|
27
|
+
"perfectionist/sort-classes": ["error"],
|
|
28
|
+
"perfectionist/sort-decorators": ["error"],
|
|
29
|
+
"perfectionist/sort-enums": ["error"],
|
|
30
|
+
"perfectionist/sort-exports": ["error"],
|
|
31
|
+
"perfectionist/sort-heritage-clauses": ["error"],
|
|
32
|
+
"perfectionist/sort-interfaces": ["error"],
|
|
33
|
+
"perfectionist/sort-intersection-types": ["error"],
|
|
34
|
+
"perfectionist/sort-jsx-props": ["error"],
|
|
35
|
+
"perfectionist/sort-maps": ["error"],
|
|
36
|
+
"perfectionist/sort-named-exports": ["error"],
|
|
37
|
+
"perfectionist/sort-named-imports": ["error"],
|
|
38
|
+
"perfectionist/sort-object-types": ["error"],
|
|
39
|
+
"perfectionist/sort-objects": ["error"],
|
|
40
|
+
"perfectionist/sort-sets": ["error"],
|
|
41
|
+
"perfectionist/sort-switch-case": ["error"],
|
|
42
|
+
"perfectionist/sort-union-types": ["error"],
|
|
43
|
+
"perfectionist/sort-variable-declarations": ["error"]
|
|
44
|
+
},
|
|
45
|
+
settings: {
|
|
46
|
+
perfectionist: {
|
|
47
|
+
order: "desc",
|
|
48
|
+
type: "line-length"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
perfectionist
|
|
55
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
18
|
+
mod
|
|
19
|
+
));
|
|
20
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
21
|
+
const utils = require("../../utils.cjs");
|
|
22
|
+
const react = async (config) => {
|
|
23
|
+
if (!config.react) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
const [
|
|
27
|
+
reactCompilerPlugin,
|
|
28
|
+
reactHooksPlugin,
|
|
29
|
+
reactPerfPlugin,
|
|
30
|
+
reactPlugin,
|
|
31
|
+
nextPlugin
|
|
32
|
+
] = await Promise.all([
|
|
33
|
+
utils.interopDefault(import("eslint-plugin-react-compiler")),
|
|
34
|
+
utils.interopDefault(import("eslint-plugin-react-hooks")),
|
|
35
|
+
utils.interopDefault(import("eslint-plugin-react-perf")),
|
|
36
|
+
utils.interopDefault(import("eslint-plugin-react")),
|
|
37
|
+
utils.interopDefault(import("@next/eslint-plugin-next"))
|
|
38
|
+
]);
|
|
39
|
+
const files = ["**/*.jsx"];
|
|
40
|
+
if (config.typescript) {
|
|
41
|
+
files.push("**/*.tsx");
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
name: "lzear/react",
|
|
45
|
+
files,
|
|
46
|
+
plugins: {
|
|
47
|
+
"@next/next": nextPlugin,
|
|
48
|
+
react: reactPlugin,
|
|
49
|
+
"react-compiler": reactCompilerPlugin,
|
|
50
|
+
"react-hooks": reactHooksPlugin,
|
|
51
|
+
"react-perf": reactPerfPlugin
|
|
52
|
+
},
|
|
53
|
+
rules: {
|
|
54
|
+
"react-compiler/react-compiler": 2,
|
|
55
|
+
...reactHooksPlugin.configs.recommended.rules,
|
|
56
|
+
...reactPerfPlugin.configs.recommended.rules,
|
|
57
|
+
"react-perf/jsx-no-new-function-as-prop": 0,
|
|
58
|
+
"react-perf/jsx-no-new-object-as-prop": 0,
|
|
59
|
+
...reactPlugin.configs.recommended.rules,
|
|
60
|
+
...nextPlugin.configs.recommended.rules,
|
|
61
|
+
...nextPlugin.configs["core-web-vitals"].rules,
|
|
62
|
+
"react/react-in-jsx-scope": 0
|
|
63
|
+
},
|
|
64
|
+
settings: {
|
|
65
|
+
react: {
|
|
66
|
+
fragment: "Fragment",
|
|
67
|
+
pragma: "React",
|
|
68
|
+
version: "detect"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
exports.react = react;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { interopDefault } from "../../utils.mjs";
|
|
2
|
+
const react = async (config) => {
|
|
3
|
+
if (!config.react) {
|
|
4
|
+
return {};
|
|
5
|
+
}
|
|
6
|
+
const [
|
|
7
|
+
reactCompilerPlugin,
|
|
8
|
+
reactHooksPlugin,
|
|
9
|
+
reactPerfPlugin,
|
|
10
|
+
reactPlugin,
|
|
11
|
+
nextPlugin
|
|
12
|
+
] = await Promise.all([
|
|
13
|
+
interopDefault(import("eslint-plugin-react-compiler")),
|
|
14
|
+
interopDefault(import("eslint-plugin-react-hooks")),
|
|
15
|
+
interopDefault(import("eslint-plugin-react-perf")),
|
|
16
|
+
interopDefault(import("eslint-plugin-react")),
|
|
17
|
+
interopDefault(import("@next/eslint-plugin-next"))
|
|
18
|
+
]);
|
|
19
|
+
const files = ["**/*.jsx"];
|
|
20
|
+
if (config.typescript) {
|
|
21
|
+
files.push("**/*.tsx");
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
name: "lzear/react",
|
|
25
|
+
files,
|
|
26
|
+
plugins: {
|
|
27
|
+
"@next/next": nextPlugin,
|
|
28
|
+
react: reactPlugin,
|
|
29
|
+
"react-compiler": reactCompilerPlugin,
|
|
30
|
+
"react-hooks": reactHooksPlugin,
|
|
31
|
+
"react-perf": reactPerfPlugin
|
|
32
|
+
},
|
|
33
|
+
rules: {
|
|
34
|
+
"react-compiler/react-compiler": 2,
|
|
35
|
+
...reactHooksPlugin.configs.recommended.rules,
|
|
36
|
+
...reactPerfPlugin.configs.recommended.rules,
|
|
37
|
+
"react-perf/jsx-no-new-function-as-prop": 0,
|
|
38
|
+
"react-perf/jsx-no-new-object-as-prop": 0,
|
|
39
|
+
...reactPlugin.configs.recommended.rules,
|
|
40
|
+
...nextPlugin.configs.recommended.rules,
|
|
41
|
+
...nextPlugin.configs["core-web-vitals"].rules,
|
|
42
|
+
"react/react-in-jsx-scope": 0
|
|
43
|
+
},
|
|
44
|
+
settings: {
|
|
45
|
+
react: {
|
|
46
|
+
fragment: "Fragment",
|
|
47
|
+
pragma: "React",
|
|
48
|
+
version: "detect"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
react
|
|
55
|
+
};
|