@luxass/eslint-config 4.0.0-beta.8 → 4.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/README.md +351 -48
- package/dist/{chunk-TQ476NL2.mjs → chunk-4YBQZLPS.mjs} +13 -2
- package/dist/{chunk-NDNDG7BH.mjs → chunk-5NK24IKQ.mjs} +2 -5
- package/dist/{chunk-2SW2E3TH.mjs → chunk-5SDSWPKR.mjs} +14 -4
- package/dist/chunk-6T7MXPCT.mjs +17 -0
- package/dist/{chunk-ADP4MYOS.mjs → chunk-ANUYBAYV.mjs} +1 -1
- package/dist/{chunk-R4NSLRAE.mjs → chunk-ATRL3UZP.mjs} +14 -8
- package/dist/{chunk-P3N5WLFL.mjs → chunk-BXBN56WI.mjs} +11 -7
- package/dist/chunk-CJ3ZUYUJ.mjs +183 -0
- package/dist/chunk-DAJA5AV3.mjs +29 -0
- package/dist/{chunk-FK567E7G.mjs → chunk-DVQQVCGF.mjs} +7 -3
- package/dist/chunk-DZCXT6HT.mjs +288 -0
- package/dist/chunk-FU5SRKZU.mjs +104 -0
- package/dist/{chunk-LQLF2CMA.mjs → chunk-GBLPCM3X.mjs} +14 -17
- package/dist/chunk-KJ7ZCBK4.mjs +48 -0
- package/dist/{chunk-BAKUP7QM.mjs → chunk-P3QUAOFO.mjs} +36 -34
- package/dist/{chunk-I2ECCPNN.mjs → chunk-PYS26PF3.mjs} +15 -10
- package/dist/chunk-Q57BF3CR.mjs +63 -0
- package/dist/{chunk-SPQZTV4E.mjs → chunk-QK56GX3F.mjs} +12 -14
- package/dist/{chunk-3QHLEAXK.mjs → chunk-RDZJT36Z.mjs} +22 -8
- package/dist/{chunk-HE56XDG6.mjs → chunk-RVSUTDCE.mjs} +15 -5
- package/dist/chunk-UMUUVFB7.mjs +69 -0
- package/dist/{chunk-NUG6FLHN.mjs → chunk-VZ2YFMWH.mjs} +54 -11
- package/dist/chunk-WDSV2EFG.mjs +7 -0
- package/dist/{chunk-M5WNLLBT.mjs → chunk-WOYZWHPM.mjs} +20 -7
- package/dist/chunk-WRURTO5T.mjs +144 -0
- package/dist/configs/astro.cjs +11 -21
- package/dist/configs/astro.d.cts +3 -6
- package/dist/configs/astro.d.ts +3 -6
- package/dist/configs/astro.mjs +3 -3
- package/dist/configs/comments.cjs +9 -12
- package/dist/configs/comments.d.cts +3 -2
- package/dist/configs/comments.d.ts +3 -2
- package/dist/configs/comments.mjs +1 -2
- package/dist/configs/formatters.cjs +274 -0
- package/dist/configs/formatters.d.cts +11 -0
- package/dist/configs/formatters.d.ts +11 -0
- package/dist/configs/formatters.mjs +9 -0
- package/dist/configs/ignores.cjs +1 -8
- package/dist/configs/ignores.d.cts +3 -2
- package/dist/configs/ignores.d.ts +3 -2
- package/dist/configs/ignores.mjs +2 -2
- package/dist/configs/imports.cjs +35 -9
- package/dist/configs/imports.d.cts +13 -4
- package/dist/configs/imports.d.ts +13 -4
- package/dist/configs/imports.mjs +2 -2
- package/dist/configs/index.cjs +1116 -707
- package/dist/configs/index.d.cts +7 -18
- package/dist/configs/index.d.ts +7 -18
- package/dist/configs/index.mjs +40 -36
- package/dist/configs/javascript.cjs +9 -23
- package/dist/configs/javascript.d.cts +3 -6
- package/dist/configs/javascript.d.ts +3 -6
- package/dist/configs/javascript.mjs +2 -3
- package/dist/configs/jsdoc.cjs +6 -2
- package/dist/configs/jsdoc.d.cts +17 -4
- package/dist/configs/jsdoc.d.ts +17 -4
- package/dist/configs/jsdoc.mjs +2 -2
- package/dist/configs/jsonc.cjs +8 -11
- package/dist/configs/jsonc.d.cts +3 -6
- package/dist/configs/jsonc.d.ts +3 -6
- package/dist/configs/jsonc.mjs +3 -3
- package/dist/configs/markdown.cjs +46 -35
- package/dist/configs/markdown.d.cts +25 -4
- package/dist/configs/markdown.d.ts +25 -4
- package/dist/configs/markdown.mjs +3 -3
- package/dist/configs/nextjs.cjs +15 -12
- package/dist/configs/nextjs.d.cts +3 -6
- package/dist/configs/nextjs.d.ts +3 -6
- package/dist/configs/nextjs.mjs +3 -3
- package/dist/configs/node.cjs +0 -10
- package/dist/configs/node.d.cts +3 -2
- package/dist/configs/node.d.ts +3 -2
- package/dist/configs/node.mjs +1 -2
- package/dist/configs/perfectionist.cjs +2 -20
- package/dist/configs/perfectionist.d.cts +4 -3
- package/dist/configs/perfectionist.d.ts +4 -3
- package/dist/configs/perfectionist.mjs +1 -2
- package/dist/configs/react.cjs +201 -203
- package/dist/configs/react.d.cts +3 -6
- package/dist/configs/react.d.ts +3 -6
- package/dist/configs/react.mjs +3 -3
- package/dist/configs/sort.cjs +6 -6
- package/dist/configs/sort.d.cts +3 -2
- package/dist/configs/sort.d.ts +3 -2
- package/dist/configs/sort.mjs +1 -1
- package/dist/configs/stylistic.cjs +20 -11
- package/dist/configs/stylistic.d.cts +4 -7
- package/dist/configs/stylistic.d.ts +4 -7
- package/dist/configs/stylistic.mjs +4 -3
- package/dist/configs/tailwindcss.cjs +34 -45
- package/dist/configs/tailwindcss.d.cts +3 -6
- package/dist/configs/tailwindcss.d.ts +3 -6
- package/dist/configs/tailwindcss.mjs +3 -3
- package/dist/configs/test.cjs +103 -16
- package/dist/configs/test.d.cts +3 -6
- package/dist/configs/test.d.ts +3 -6
- package/dist/configs/test.mjs +4 -3
- package/dist/configs/toml.cjs +131 -0
- package/dist/configs/toml.d.cts +11 -0
- package/dist/configs/toml.d.ts +11 -0
- package/dist/configs/toml.mjs +8 -0
- package/dist/configs/typescript.cjs +32 -43
- package/dist/configs/typescript.d.cts +3 -6
- package/dist/configs/typescript.d.ts +3 -6
- package/dist/configs/typescript.mjs +3 -4
- package/dist/configs/unicorn.cjs +13 -10
- package/dist/configs/unicorn.d.cts +3 -2
- package/dist/configs/unicorn.d.ts +3 -2
- package/dist/configs/unicorn.mjs +1 -2
- package/dist/configs/unocss.cjs +74 -4
- package/dist/configs/unocss.d.cts +3 -6
- package/dist/configs/unocss.d.ts +3 -6
- package/dist/configs/unocss.mjs +3 -2
- package/dist/configs/vue.cjs +51 -15
- package/dist/configs/vue.d.cts +3 -6
- package/dist/configs/vue.d.ts +3 -6
- package/dist/configs/vue.mjs +3 -3
- package/dist/configs/yaml.cjs +17 -11
- package/dist/configs/yaml.d.cts +3 -6
- package/dist/configs/yaml.d.ts +3 -6
- package/dist/configs/yaml.mjs +3 -3
- package/dist/custom-rules/utils.cjs +31 -0
- package/dist/custom-rules/utils.d.cts +6 -0
- package/dist/custom-rules/utils.d.ts +6 -0
- package/dist/custom-rules/utils.mjs +6 -0
- package/dist/globs.cjs +157 -0
- package/dist/globs.d.cts +28 -0
- package/dist/globs.d.ts +28 -0
- package/dist/globs.mjs +56 -0
- package/dist/index.cjs +1470 -1040
- package/dist/index.d.cts +10 -44
- package/dist/index.d.ts +10 -44
- package/dist/index.mjs +106 -140
- package/dist/types-spTEGSaV.d.cts +632 -0
- package/dist/types-spTEGSaV.d.ts +632 -0
- package/package.json +69 -37
- package/dist/chunk-24KJPXII.mjs +0 -51
- package/dist/chunk-4HH6LYJ6.mjs +0 -25
- package/dist/chunk-4JKENKIP.mjs +0 -67
- package/dist/chunk-C5VMTRKT.mjs +0 -18
- package/dist/chunk-CFSYEIE4.mjs +0 -23
- package/dist/chunk-ERFDRAGW.mjs +0 -86
- package/dist/chunk-HLDEUDLN.mjs +0 -28
- package/dist/chunk-UBPIYSHC.mjs +0 -284
- package/dist/types-fxhbVLKI.d.cts +0 -235
- package/dist/types-fxhbVLKI.d.ts +0 -235
- package/dist/{chunk-FKAOMYGL.mjs → chunk-ME2OAMS3.mjs} +0 -0
- package/dist/{chunk-FOIFEV73.mjs → chunk-XBASVDU6.mjs} +6 -6
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
interop
|
|
3
|
+
} from "./chunk-4YBQZLPS.mjs";
|
|
1
4
|
import {
|
|
2
5
|
GLOB_JSON,
|
|
3
6
|
GLOB_JSON5,
|
|
4
7
|
GLOB_JSONC
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
interop
|
|
8
|
-
} from "./chunk-TQ476NL2.mjs";
|
|
8
|
+
} from "./chunk-ATRL3UZP.mjs";
|
|
9
9
|
|
|
10
10
|
// src/configs/jsonc.ts
|
|
11
11
|
async function jsonc(options = {}) {
|
|
12
|
-
const {
|
|
12
|
+
const {
|
|
13
|
+
files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
14
|
+
overrides = {},
|
|
15
|
+
stylistic = true
|
|
16
|
+
} = options;
|
|
13
17
|
const [
|
|
14
18
|
pluginJsonc,
|
|
15
19
|
parserJsonc
|
|
@@ -25,11 +29,11 @@ async function jsonc(options = {}) {
|
|
|
25
29
|
}
|
|
26
30
|
},
|
|
27
31
|
{
|
|
28
|
-
|
|
32
|
+
name: "luxass:jsonc:rules",
|
|
33
|
+
files,
|
|
29
34
|
languageOptions: {
|
|
30
35
|
parser: parserJsonc
|
|
31
36
|
},
|
|
32
|
-
name: "luxass:jsonc:rules",
|
|
33
37
|
rules: {
|
|
34
38
|
"jsonc/no-bigint-literals": "error",
|
|
35
39
|
"jsonc/no-binary-expression": "error",
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StylisticConfigDefaults
|
|
3
|
+
} from "./chunk-RDZJT36Z.mjs";
|
|
4
|
+
import {
|
|
5
|
+
ensure,
|
|
6
|
+
interop
|
|
7
|
+
} from "./chunk-4YBQZLPS.mjs";
|
|
8
|
+
import {
|
|
9
|
+
GLOB_CSS,
|
|
10
|
+
GLOB_LESS,
|
|
11
|
+
GLOB_MARKDOWN,
|
|
12
|
+
GLOB_POSTCSS,
|
|
13
|
+
GLOB_SCSS
|
|
14
|
+
} from "./chunk-ATRL3UZP.mjs";
|
|
15
|
+
|
|
16
|
+
// src/configs/formatters.ts
|
|
17
|
+
import * as parserPlain from "eslint-parser-plain";
|
|
18
|
+
async function formatters(options = {}, stylistic = {}) {
|
|
19
|
+
await ensure([
|
|
20
|
+
"eslint-plugin-format"
|
|
21
|
+
]);
|
|
22
|
+
if (options === true) {
|
|
23
|
+
options = {
|
|
24
|
+
css: true,
|
|
25
|
+
graphql: true,
|
|
26
|
+
html: true,
|
|
27
|
+
markdown: true
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const {
|
|
31
|
+
indent,
|
|
32
|
+
quotes,
|
|
33
|
+
semi
|
|
34
|
+
} = {
|
|
35
|
+
...StylisticConfigDefaults,
|
|
36
|
+
...stylistic
|
|
37
|
+
};
|
|
38
|
+
const prettierOptions = Object.assign(
|
|
39
|
+
{
|
|
40
|
+
endOfLine: "auto",
|
|
41
|
+
semi,
|
|
42
|
+
singleQuote: quotes === "single",
|
|
43
|
+
tabWidth: typeof indent === "number" ? indent : 2,
|
|
44
|
+
trailingComma: "all",
|
|
45
|
+
useTabs: indent === "tab"
|
|
46
|
+
},
|
|
47
|
+
options.prettierOptions || {}
|
|
48
|
+
);
|
|
49
|
+
const dprintOptions = Object.assign(
|
|
50
|
+
{
|
|
51
|
+
indentWidth: typeof indent === "number" ? indent : 2,
|
|
52
|
+
quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
|
|
53
|
+
useTabs: indent === "tab"
|
|
54
|
+
},
|
|
55
|
+
options.dprintOptions || {}
|
|
56
|
+
);
|
|
57
|
+
const pluginFormat = await interop(import("eslint-plugin-format"));
|
|
58
|
+
const configs = [
|
|
59
|
+
{
|
|
60
|
+
name: "luxass:formatters:setup",
|
|
61
|
+
plugins: {
|
|
62
|
+
format: pluginFormat
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
];
|
|
66
|
+
if (options.css) {
|
|
67
|
+
configs.push(
|
|
68
|
+
{
|
|
69
|
+
name: "luxass:formatter:css",
|
|
70
|
+
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
71
|
+
languageOptions: {
|
|
72
|
+
parser: parserPlain
|
|
73
|
+
},
|
|
74
|
+
rules: {
|
|
75
|
+
"format/prettier": [
|
|
76
|
+
"error",
|
|
77
|
+
{
|
|
78
|
+
...prettierOptions,
|
|
79
|
+
parser: "css"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "luxass:formatter:scss",
|
|
86
|
+
files: [GLOB_SCSS],
|
|
87
|
+
languageOptions: {
|
|
88
|
+
parser: parserPlain
|
|
89
|
+
},
|
|
90
|
+
rules: {
|
|
91
|
+
"format/prettier": [
|
|
92
|
+
"error",
|
|
93
|
+
{
|
|
94
|
+
...prettierOptions,
|
|
95
|
+
parser: "scss"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "luxass:formatter:less",
|
|
102
|
+
files: [GLOB_LESS],
|
|
103
|
+
languageOptions: {
|
|
104
|
+
parser: parserPlain
|
|
105
|
+
},
|
|
106
|
+
rules: {
|
|
107
|
+
"format/prettier": [
|
|
108
|
+
"error",
|
|
109
|
+
{
|
|
110
|
+
...prettierOptions,
|
|
111
|
+
parser: "less"
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
if (options.html) {
|
|
119
|
+
configs.push({
|
|
120
|
+
name: "luxass:formatter:html",
|
|
121
|
+
files: ["**/*.html"],
|
|
122
|
+
languageOptions: {
|
|
123
|
+
parser: parserPlain
|
|
124
|
+
},
|
|
125
|
+
rules: {
|
|
126
|
+
"format/prettier": [
|
|
127
|
+
"error",
|
|
128
|
+
{
|
|
129
|
+
...prettierOptions,
|
|
130
|
+
parser: "html"
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (options.markdown) {
|
|
137
|
+
const formater = options.markdown === true ? "prettier" : options.markdown;
|
|
138
|
+
configs.push({
|
|
139
|
+
name: "luxass:formatter:markdown",
|
|
140
|
+
files: [GLOB_MARKDOWN],
|
|
141
|
+
languageOptions: {
|
|
142
|
+
parser: parserPlain
|
|
143
|
+
},
|
|
144
|
+
rules: {
|
|
145
|
+
[`format/${formater}`]: [
|
|
146
|
+
"error",
|
|
147
|
+
formater === "prettier" ? {
|
|
148
|
+
printWidth: 120,
|
|
149
|
+
...prettierOptions,
|
|
150
|
+
embeddedLanguageFormatting: "off",
|
|
151
|
+
parser: "markdown"
|
|
152
|
+
} : {
|
|
153
|
+
...dprintOptions,
|
|
154
|
+
language: "markdown"
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
if (options.graphql) {
|
|
161
|
+
configs.push({
|
|
162
|
+
name: "luxass:formatter:graphql",
|
|
163
|
+
files: ["**/*.graphql"],
|
|
164
|
+
languageOptions: {
|
|
165
|
+
parser: parserPlain
|
|
166
|
+
},
|
|
167
|
+
rules: {
|
|
168
|
+
"format/prettier": [
|
|
169
|
+
"error",
|
|
170
|
+
{
|
|
171
|
+
...prettierOptions,
|
|
172
|
+
parser: "graphql"
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return configs;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export {
|
|
182
|
+
formatters
|
|
183
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// src/configs/comments.ts
|
|
2
|
+
import eslintCommentsPlugin from "@eslint-community/eslint-plugin-eslint-comments";
|
|
3
|
+
async function comments() {
|
|
4
|
+
return [
|
|
5
|
+
{
|
|
6
|
+
name: "luxass:eslint-comments",
|
|
7
|
+
plugins: {
|
|
8
|
+
"eslint-comments": eslintCommentsPlugin
|
|
9
|
+
},
|
|
10
|
+
rules: {
|
|
11
|
+
// https://github.com/eslint-community/eslint-plugin-eslint-comments/blob/main/docs/rules/disable-enable-pair.md
|
|
12
|
+
"eslint-comments/disable-enable-pair": "error",
|
|
13
|
+
// https://github.com/eslint-community/eslint-plugin-eslint-comments/blob/main/docs/rules/no-aggregating-enable.md
|
|
14
|
+
"eslint-comments/no-aggregating-enable": "error",
|
|
15
|
+
// https://github.com/eslint-community/eslint-plugin-eslint-comments/blob/main/docs/rules/no-duplicate-disable.md
|
|
16
|
+
"eslint-comments/no-duplicate-disable": "error",
|
|
17
|
+
// https://github.com/eslint-community/eslint-plugin-eslint-comments/blob/main/docs/rules/no-unlimited-disable.md
|
|
18
|
+
"eslint-comments/no-unlimited-disable": "error",
|
|
19
|
+
// Deprecated in favor of official reportUnusedDisableDirectives
|
|
20
|
+
// https://github.com/eslint-community/eslint-plugin-eslint-comments/issues/133
|
|
21
|
+
"eslint-comments/no-unused-enable": "off"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
comments
|
|
29
|
+
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
interop
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4YBQZLPS.mjs";
|
|
4
4
|
|
|
5
5
|
// src/configs/jsdoc.ts
|
|
6
6
|
async function jsdoc(options = {}) {
|
|
7
|
-
const {
|
|
7
|
+
const {
|
|
8
|
+
overrides,
|
|
9
|
+
stylistic = true
|
|
10
|
+
} = options;
|
|
8
11
|
return [
|
|
9
12
|
{
|
|
10
13
|
name: "luxass:jsdoc",
|
|
@@ -30,7 +33,8 @@ async function jsdoc(options = {}) {
|
|
|
30
33
|
...stylistic ? {
|
|
31
34
|
"jsdoc/check-alignment": "warn",
|
|
32
35
|
"jsdoc/multiline-blocks": "warn"
|
|
33
|
-
} : {}
|
|
36
|
+
} : {},
|
|
37
|
+
...overrides
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
];
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ensure,
|
|
3
|
+
interop
|
|
4
|
+
} from "./chunk-4YBQZLPS.mjs";
|
|
5
|
+
import {
|
|
6
|
+
GLOB_JSX,
|
|
7
|
+
GLOB_TSX
|
|
8
|
+
} from "./chunk-ATRL3UZP.mjs";
|
|
9
|
+
|
|
10
|
+
// src/configs/react.ts
|
|
11
|
+
async function react(options = {}) {
|
|
12
|
+
const {
|
|
13
|
+
a11y = false,
|
|
14
|
+
files = [GLOB_JSX, GLOB_TSX],
|
|
15
|
+
overrides = {},
|
|
16
|
+
typescript = true
|
|
17
|
+
} = options;
|
|
18
|
+
await ensure([
|
|
19
|
+
"eslint-plugin-react",
|
|
20
|
+
"eslint-plugin-react-hooks",
|
|
21
|
+
"eslint-plugin-react-refresh",
|
|
22
|
+
...options.a11y ? ["eslint-plugin-jsx-a11y"] : []
|
|
23
|
+
]);
|
|
24
|
+
const [
|
|
25
|
+
pluginReact,
|
|
26
|
+
pluginReactHooks,
|
|
27
|
+
pluginReactRefresh,
|
|
28
|
+
pluginA11y
|
|
29
|
+
] = await Promise.all([
|
|
30
|
+
interop(import("eslint-plugin-react")),
|
|
31
|
+
interop(import("eslint-plugin-react-hooks")),
|
|
32
|
+
interop(import("eslint-plugin-react-refresh")),
|
|
33
|
+
...a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
|
|
34
|
+
]);
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
name: "luxass:react:setup",
|
|
38
|
+
plugins: {
|
|
39
|
+
"react": pluginReact,
|
|
40
|
+
"react-hooks": pluginReactHooks,
|
|
41
|
+
"react-refresh": pluginReactRefresh,
|
|
42
|
+
...a11y ? { "jsx-a11y": pluginA11y } : {}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "luxass:react:rules",
|
|
47
|
+
files,
|
|
48
|
+
languageOptions: {
|
|
49
|
+
parserOptions: {
|
|
50
|
+
ecmaFeatures: {
|
|
51
|
+
jsx: true
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
rules: {
|
|
56
|
+
...a11y ? {
|
|
57
|
+
// recommended rules for jsx-a11y
|
|
58
|
+
"jsx-a11y/alt-text": "error",
|
|
59
|
+
"jsx-a11y/anchor-ambiguous-text": "off",
|
|
60
|
+
"jsx-a11y/anchor-has-content": "error",
|
|
61
|
+
"jsx-a11y/anchor-is-valid": "error",
|
|
62
|
+
"jsx-a11y/aria-activedescendant-has-tabindex": "error",
|
|
63
|
+
"jsx-a11y/aria-props": "error",
|
|
64
|
+
"jsx-a11y/aria-proptypes": "error",
|
|
65
|
+
"jsx-a11y/aria-role": "error",
|
|
66
|
+
"jsx-a11y/aria-unsupported-elements": "error",
|
|
67
|
+
"jsx-a11y/autocomplete-valid": "error",
|
|
68
|
+
"jsx-a11y/click-events-have-key-events": "error",
|
|
69
|
+
"jsx-a11y/control-has-associated-label": [
|
|
70
|
+
"off",
|
|
71
|
+
{
|
|
72
|
+
ignoreElements: [
|
|
73
|
+
"audio",
|
|
74
|
+
"canvas",
|
|
75
|
+
"embed",
|
|
76
|
+
"input",
|
|
77
|
+
"textarea",
|
|
78
|
+
"tr",
|
|
79
|
+
"video"
|
|
80
|
+
],
|
|
81
|
+
ignoreRoles: [
|
|
82
|
+
"grid",
|
|
83
|
+
"listbox",
|
|
84
|
+
"menu",
|
|
85
|
+
"menubar",
|
|
86
|
+
"radiogroup",
|
|
87
|
+
"row",
|
|
88
|
+
"tablist",
|
|
89
|
+
"toolbar",
|
|
90
|
+
"tree",
|
|
91
|
+
"treegrid"
|
|
92
|
+
],
|
|
93
|
+
includeRoles: [
|
|
94
|
+
"alert",
|
|
95
|
+
"dialog"
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"jsx-a11y/heading-has-content": "error",
|
|
100
|
+
"jsx-a11y/html-has-lang": "error",
|
|
101
|
+
"jsx-a11y/iframe-has-title": "error",
|
|
102
|
+
"jsx-a11y/img-redundant-alt": "error",
|
|
103
|
+
"jsx-a11y/interactive-supports-focus": [
|
|
104
|
+
"error",
|
|
105
|
+
{
|
|
106
|
+
tabbable: [
|
|
107
|
+
"button",
|
|
108
|
+
"checkbox",
|
|
109
|
+
"link",
|
|
110
|
+
"searchbox",
|
|
111
|
+
"spinbutton",
|
|
112
|
+
"switch",
|
|
113
|
+
"textbox"
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"jsx-a11y/label-has-associated-control": "error",
|
|
118
|
+
"jsx-a11y/label-has-for": "off",
|
|
119
|
+
"jsx-a11y/media-has-caption": "error",
|
|
120
|
+
"jsx-a11y/mouse-events-have-key-events": "error",
|
|
121
|
+
"jsx-a11y/no-access-key": "error",
|
|
122
|
+
"jsx-a11y/no-autofocus": "error",
|
|
123
|
+
"jsx-a11y/no-distracting-elements": "error",
|
|
124
|
+
"jsx-a11y/no-interactive-element-to-noninteractive-role": [
|
|
125
|
+
"error",
|
|
126
|
+
{
|
|
127
|
+
canvas: [
|
|
128
|
+
"img"
|
|
129
|
+
],
|
|
130
|
+
tr: [
|
|
131
|
+
"none",
|
|
132
|
+
"presentation"
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"jsx-a11y/no-noninteractive-element-interactions": [
|
|
137
|
+
"error",
|
|
138
|
+
{
|
|
139
|
+
alert: [
|
|
140
|
+
"onKeyUp",
|
|
141
|
+
"onKeyDown",
|
|
142
|
+
"onKeyPress"
|
|
143
|
+
],
|
|
144
|
+
body: [
|
|
145
|
+
"onError",
|
|
146
|
+
"onLoad"
|
|
147
|
+
],
|
|
148
|
+
dialog: [
|
|
149
|
+
"onKeyUp",
|
|
150
|
+
"onKeyDown",
|
|
151
|
+
"onKeyPress"
|
|
152
|
+
],
|
|
153
|
+
handlers: [
|
|
154
|
+
"onClick",
|
|
155
|
+
"onError",
|
|
156
|
+
"onLoad",
|
|
157
|
+
"onMouseDown",
|
|
158
|
+
"onMouseUp",
|
|
159
|
+
"onKeyPress",
|
|
160
|
+
"onKeyDown",
|
|
161
|
+
"onKeyUp"
|
|
162
|
+
],
|
|
163
|
+
iframe: [
|
|
164
|
+
"onError",
|
|
165
|
+
"onLoad"
|
|
166
|
+
],
|
|
167
|
+
img: [
|
|
168
|
+
"onError",
|
|
169
|
+
"onLoad"
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"jsx-a11y/no-noninteractive-element-to-interactive-role": [
|
|
174
|
+
"error",
|
|
175
|
+
{
|
|
176
|
+
fieldset: [
|
|
177
|
+
"radiogroup",
|
|
178
|
+
"presentation"
|
|
179
|
+
],
|
|
180
|
+
li: [
|
|
181
|
+
"menuitem",
|
|
182
|
+
"option",
|
|
183
|
+
"row",
|
|
184
|
+
"tab",
|
|
185
|
+
"treeitem"
|
|
186
|
+
],
|
|
187
|
+
ol: [
|
|
188
|
+
"listbox",
|
|
189
|
+
"menu",
|
|
190
|
+
"menubar",
|
|
191
|
+
"radiogroup",
|
|
192
|
+
"tablist",
|
|
193
|
+
"tree",
|
|
194
|
+
"treegrid"
|
|
195
|
+
],
|
|
196
|
+
table: [
|
|
197
|
+
"grid"
|
|
198
|
+
],
|
|
199
|
+
td: [
|
|
200
|
+
"gridcell"
|
|
201
|
+
],
|
|
202
|
+
ul: [
|
|
203
|
+
"listbox",
|
|
204
|
+
"menu",
|
|
205
|
+
"menubar",
|
|
206
|
+
"radiogroup",
|
|
207
|
+
"tablist",
|
|
208
|
+
"tree",
|
|
209
|
+
"treegrid"
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"jsx-a11y/no-noninteractive-tabindex": [
|
|
214
|
+
"error",
|
|
215
|
+
{
|
|
216
|
+
allowExpressionValues: true,
|
|
217
|
+
roles: [
|
|
218
|
+
"tabpanel"
|
|
219
|
+
],
|
|
220
|
+
tags: []
|
|
221
|
+
}
|
|
222
|
+
],
|
|
223
|
+
"jsx-a11y/no-redundant-roles": "error",
|
|
224
|
+
"jsx-a11y/no-static-element-interactions": [
|
|
225
|
+
"error",
|
|
226
|
+
{
|
|
227
|
+
allowExpressionValues: true,
|
|
228
|
+
handlers: [
|
|
229
|
+
"onClick",
|
|
230
|
+
"onMouseDown",
|
|
231
|
+
"onMouseUp",
|
|
232
|
+
"onKeyPress",
|
|
233
|
+
"onKeyDown",
|
|
234
|
+
"onKeyUp"
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
],
|
|
238
|
+
"jsx-a11y/role-has-required-aria-props": "error",
|
|
239
|
+
"jsx-a11y/role-supports-aria-props": "error",
|
|
240
|
+
"jsx-a11y/scope": "error",
|
|
241
|
+
"jsx-a11y/tabindex-no-positive": "error"
|
|
242
|
+
} : {},
|
|
243
|
+
// recommended rules react
|
|
244
|
+
"react/display-name": "error",
|
|
245
|
+
"react/jsx-key": "error",
|
|
246
|
+
"react/jsx-no-comment-textnodes": "error",
|
|
247
|
+
"react/jsx-no-duplicate-props": "error",
|
|
248
|
+
"react/jsx-no-target-blank": "error",
|
|
249
|
+
"react/jsx-no-undef": "error",
|
|
250
|
+
"react/jsx-uses-react": "error",
|
|
251
|
+
"react/jsx-uses-vars": "error",
|
|
252
|
+
"react/no-children-prop": "error",
|
|
253
|
+
"react/no-danger-with-children": "error",
|
|
254
|
+
"react/no-deprecated": "error",
|
|
255
|
+
"react/no-direct-mutation-state": "error",
|
|
256
|
+
"react/no-find-dom-node": "error",
|
|
257
|
+
"react/no-is-mounted": "error",
|
|
258
|
+
"react/no-render-return-value": "error",
|
|
259
|
+
"react/no-string-refs": "error",
|
|
260
|
+
"react/no-unescaped-entities": "error",
|
|
261
|
+
"react/no-unknown-property": "error",
|
|
262
|
+
"react/no-unsafe": "off",
|
|
263
|
+
"react/prop-types": "error",
|
|
264
|
+
"react/react-in-jsx-scope": "off",
|
|
265
|
+
"react/require-render-return": "error",
|
|
266
|
+
// recommended rules react-hooks
|
|
267
|
+
"react-hooks/exhaustive-deps": "warn",
|
|
268
|
+
"react-hooks/rules-of-hooks": "error",
|
|
269
|
+
// react refresh
|
|
270
|
+
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
|
|
271
|
+
...typescript ? {
|
|
272
|
+
"react/prop-type": "off"
|
|
273
|
+
} : {},
|
|
274
|
+
// overrides
|
|
275
|
+
...overrides
|
|
276
|
+
},
|
|
277
|
+
settings: {
|
|
278
|
+
react: {
|
|
279
|
+
version: "detect"
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
];
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export {
|
|
287
|
+
react
|
|
288
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
interop
|
|
3
|
+
} from "./chunk-4YBQZLPS.mjs";
|
|
4
|
+
import {
|
|
5
|
+
GLOB_MARKDOWN,
|
|
6
|
+
GLOB_MARKDOWN_CODE,
|
|
7
|
+
GLOB_MARKDOWN_IN_MARKDOWN
|
|
8
|
+
} from "./chunk-ATRL3UZP.mjs";
|
|
9
|
+
|
|
10
|
+
// src/configs/markdown.ts
|
|
11
|
+
import * as parserPlain from "eslint-parser-plain";
|
|
12
|
+
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
13
|
+
async function markdown(options = {}) {
|
|
14
|
+
const {
|
|
15
|
+
exts = [],
|
|
16
|
+
files = [GLOB_MARKDOWN],
|
|
17
|
+
overrides = {}
|
|
18
|
+
} = options;
|
|
19
|
+
const markdown2 = await interop(import("eslint-plugin-markdown"));
|
|
20
|
+
return [
|
|
21
|
+
{
|
|
22
|
+
name: "luxass:markdown:setup",
|
|
23
|
+
plugins: {
|
|
24
|
+
markdown: markdown2
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "luxass:markdown:processor",
|
|
29
|
+
files,
|
|
30
|
+
ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
|
|
31
|
+
// `eslint-plugin-markdown` only creates virtual files for code blocks,
|
|
32
|
+
// but not the markdown file itself. We use `eslint-merge-processors` to
|
|
33
|
+
// add a pass-through processor for the markdown file itself.
|
|
34
|
+
processor: mergeProcessors([
|
|
35
|
+
markdown2.processors.markdown,
|
|
36
|
+
processorPassThrough
|
|
37
|
+
])
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "luxass:markdown:parser",
|
|
41
|
+
files,
|
|
42
|
+
languageOptions: {
|
|
43
|
+
parser: parserPlain
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "luxass:markdown:disables",
|
|
48
|
+
files: [
|
|
49
|
+
GLOB_MARKDOWN_CODE,
|
|
50
|
+
...exts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
|
|
51
|
+
],
|
|
52
|
+
languageOptions: {
|
|
53
|
+
parserOptions: {
|
|
54
|
+
ecmaFeatures: {
|
|
55
|
+
impliedStrict: true
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
rules: {
|
|
60
|
+
"import/newline-after-import": "off",
|
|
61
|
+
"no-alert": "off",
|
|
62
|
+
"no-console": "off",
|
|
63
|
+
"no-undef": "off",
|
|
64
|
+
"no-unused-expressions": "off",
|
|
65
|
+
"no-unused-vars": "off",
|
|
66
|
+
"node/prefer-global/process": "off",
|
|
67
|
+
"style/comma-dangle": "off",
|
|
68
|
+
"style/eol-last": "off",
|
|
69
|
+
// Type aware rules
|
|
70
|
+
"ts/await-thenable": "off",
|
|
71
|
+
"ts/consistent-type-imports": "off",
|
|
72
|
+
"ts/dot-notation": "off",
|
|
73
|
+
"ts/no-floating-promises": "off",
|
|
74
|
+
"ts/no-for-in-array": "off",
|
|
75
|
+
"ts/no-implied-eval": "off",
|
|
76
|
+
"ts/no-misused-promises": "off",
|
|
77
|
+
"ts/no-namespace": "off",
|
|
78
|
+
"ts/no-redeclare": "off",
|
|
79
|
+
"ts/no-require-imports": "off",
|
|
80
|
+
"ts/no-throw-literal": "off",
|
|
81
|
+
"ts/no-unnecessary-type-assertion": "off",
|
|
82
|
+
"ts/no-unsafe-argument": "off",
|
|
83
|
+
"ts/no-unsafe-assignment": "off",
|
|
84
|
+
"ts/no-unsafe-call": "off",
|
|
85
|
+
"ts/no-unsafe-member-access": "off",
|
|
86
|
+
"ts/no-unsafe-return": "off",
|
|
87
|
+
"ts/no-unused-vars": "off",
|
|
88
|
+
"ts/no-use-before-define": "off",
|
|
89
|
+
"ts/no-var-requires": "off",
|
|
90
|
+
"ts/restrict-plus-operands": "off",
|
|
91
|
+
"ts/restrict-template-expressions": "off",
|
|
92
|
+
"ts/unbound-method": "off",
|
|
93
|
+
"unicode-bom": "off",
|
|
94
|
+
"unused-imports/no-unused-imports": "off",
|
|
95
|
+
"unused-imports/no-unused-vars": "off",
|
|
96
|
+
...overrides
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export {
|
|
103
|
+
markdown
|
|
104
|
+
};
|