@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,20 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GLOB_VUE
|
|
3
|
-
} from "./chunk-R4NSLRAE.mjs";
|
|
4
1
|
import {
|
|
5
2
|
interop
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4YBQZLPS.mjs";
|
|
4
|
+
import {
|
|
5
|
+
GLOB_VUE
|
|
6
|
+
} from "./chunk-ATRL3UZP.mjs";
|
|
7
7
|
|
|
8
8
|
// src/configs/vue.ts
|
|
9
|
+
import { mergeProcessors } from "eslint-merge-processors";
|
|
9
10
|
async function vue(options = {}) {
|
|
10
|
-
const {
|
|
11
|
+
const {
|
|
12
|
+
a11y = true,
|
|
13
|
+
files = [GLOB_VUE],
|
|
14
|
+
overrides = {},
|
|
15
|
+
stylistic = true
|
|
16
|
+
} = options;
|
|
11
17
|
const [
|
|
12
18
|
pluginVue,
|
|
13
|
-
parserVue
|
|
19
|
+
parserVue,
|
|
20
|
+
processorVueBlocks,
|
|
21
|
+
pluginA11y
|
|
14
22
|
] = await Promise.all([
|
|
15
23
|
interop(import("eslint-plugin-vue")),
|
|
16
|
-
interop(import("vue-eslint-parser"))
|
|
24
|
+
interop(import("vue-eslint-parser")),
|
|
25
|
+
interop(import("eslint-processor-vue-blocks")),
|
|
26
|
+
...a11y ? [interop(import("eslint-plugin-vuejs-accessibility"))] : []
|
|
17
27
|
]);
|
|
28
|
+
const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
|
|
18
29
|
const {
|
|
19
30
|
indent = 2
|
|
20
31
|
} = typeof stylistic === "boolean" ? {} : stylistic;
|
|
@@ -22,11 +33,13 @@ async function vue(options = {}) {
|
|
|
22
33
|
{
|
|
23
34
|
name: "luxass:vue:setup",
|
|
24
35
|
plugins: {
|
|
25
|
-
vue: pluginVue
|
|
36
|
+
vue: pluginVue,
|
|
37
|
+
...a11y ? { "vue-a11y": pluginA11y } : {}
|
|
26
38
|
}
|
|
27
39
|
},
|
|
28
40
|
{
|
|
29
|
-
|
|
41
|
+
name: "luxass:vue:rules",
|
|
42
|
+
files,
|
|
30
43
|
languageOptions: {
|
|
31
44
|
parser: parserVue,
|
|
32
45
|
parserOptions: {
|
|
@@ -38,8 +51,16 @@ async function vue(options = {}) {
|
|
|
38
51
|
sourceType: "module"
|
|
39
52
|
}
|
|
40
53
|
},
|
|
41
|
-
|
|
42
|
-
|
|
54
|
+
processor: sfcBlocks === false ? pluginVue.processors[".vue"] : mergeProcessors([
|
|
55
|
+
pluginVue.processors[".vue"],
|
|
56
|
+
processorVueBlocks({
|
|
57
|
+
...sfcBlocks,
|
|
58
|
+
blocks: {
|
|
59
|
+
styles: true,
|
|
60
|
+
...sfcBlocks.blocks
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
]),
|
|
43
64
|
rules: {
|
|
44
65
|
...pluginVue.configs.base.rules,
|
|
45
66
|
...pluginVue.configs["vue3-essential"].rules,
|
|
@@ -148,6 +169,28 @@ async function vue(options = {}) {
|
|
|
148
169
|
"vue/space-in-parens": ["error", "never"],
|
|
149
170
|
"vue/template-curly-spacing": "error"
|
|
150
171
|
} : {},
|
|
172
|
+
...a11y ? {
|
|
173
|
+
"vue-a11y/alt-text": "error",
|
|
174
|
+
"vue-a11y/anchor-has-content": "error",
|
|
175
|
+
"vue-a11y/aria-props": "error",
|
|
176
|
+
"vue-a11y/aria-role": "error",
|
|
177
|
+
"vue-a11y/aria-unsupported-elements": "error",
|
|
178
|
+
"vue-a11y/click-events-have-key-events": "error",
|
|
179
|
+
"vue-a11y/form-control-has-label": "error",
|
|
180
|
+
"vue-a11y/heading-has-content": "error",
|
|
181
|
+
"vue-a11y/iframe-has-title": "error",
|
|
182
|
+
"vue-a11y/interactive-supports-focus": "error",
|
|
183
|
+
"vue-a11y/label-has-for": "error",
|
|
184
|
+
"vue-a11y/media-has-caption": "error",
|
|
185
|
+
"vue-a11y/mouse-events-have-key-events": "error",
|
|
186
|
+
"vue-a11y/no-access-key": "error",
|
|
187
|
+
"vue-a11y/no-autofocus": "error",
|
|
188
|
+
"vue-a11y/no-distracting-elements": "error",
|
|
189
|
+
"vue-a11y/no-redundant-roles": "error",
|
|
190
|
+
"vue-a11y/no-static-element-interactions": "error",
|
|
191
|
+
"vue-a11y/role-has-required-aria-props": "error",
|
|
192
|
+
"vue-a11y/tabindex-no-positive": "error"
|
|
193
|
+
} : {},
|
|
151
194
|
...overrides
|
|
152
195
|
}
|
|
153
196
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GLOB_YAML
|
|
3
|
-
} from "./chunk-R4NSLRAE.mjs";
|
|
4
1
|
import {
|
|
5
2
|
interop
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4YBQZLPS.mjs";
|
|
4
|
+
import {
|
|
5
|
+
GLOB_YAML
|
|
6
|
+
} from "./chunk-ATRL3UZP.mjs";
|
|
7
7
|
|
|
8
8
|
// src/configs/yaml.ts
|
|
9
9
|
async function yaml(options = {}) {
|
|
10
|
-
const {
|
|
10
|
+
const {
|
|
11
|
+
files = [GLOB_YAML],
|
|
12
|
+
overrides = {},
|
|
13
|
+
stylistic = true
|
|
14
|
+
} = options;
|
|
11
15
|
const [
|
|
12
16
|
pluginYaml,
|
|
13
17
|
parserYaml
|
|
@@ -27,16 +31,17 @@ async function yaml(options = {}) {
|
|
|
27
31
|
}
|
|
28
32
|
},
|
|
29
33
|
{
|
|
30
|
-
|
|
34
|
+
name: "luxass:yaml:rules",
|
|
35
|
+
files,
|
|
31
36
|
languageOptions: {
|
|
32
37
|
parser: parserYaml
|
|
33
38
|
},
|
|
34
|
-
name: "luxass:yaml:rules",
|
|
35
39
|
rules: {
|
|
36
40
|
"style/spaced-comment": "off",
|
|
37
41
|
"yaml/block-mapping": "error",
|
|
38
42
|
"yaml/block-sequence": "error",
|
|
39
43
|
"yaml/no-empty-key": "error",
|
|
44
|
+
"yaml/no-empty-mapping-value": "error",
|
|
40
45
|
"yaml/no-empty-sequence-entry": "error",
|
|
41
46
|
"yaml/no-irregular-whitespace": "error",
|
|
42
47
|
"yaml/plain-scalar": "error",
|
|
@@ -59,6 +64,14 @@ async function yaml(options = {}) {
|
|
|
59
64
|
} : {},
|
|
60
65
|
...overrides
|
|
61
66
|
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "luxass:yaml:github-actions",
|
|
70
|
+
files: ["**/.github/workflows/*.{yml,yaml}"],
|
|
71
|
+
rules: {
|
|
72
|
+
// GitHub Actions supports empty values to enable features
|
|
73
|
+
"yaml/no-empty-mapping-value": "off"
|
|
74
|
+
}
|
|
62
75
|
}
|
|
63
76
|
];
|
|
64
77
|
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createRule
|
|
3
|
+
} from "./chunk-WDSV2EFG.mjs";
|
|
4
|
+
import {
|
|
5
|
+
interop
|
|
6
|
+
} from "./chunk-4YBQZLPS.mjs";
|
|
7
|
+
import {
|
|
8
|
+
GLOB_TESTS
|
|
9
|
+
} from "./chunk-ATRL3UZP.mjs";
|
|
10
|
+
|
|
11
|
+
// src/custom-rules/no-only-tests/index.ts
|
|
12
|
+
var DEFAULT_OPTIONS = {
|
|
13
|
+
blocks: ["describe", "it", "test"],
|
|
14
|
+
focus: ["only"]
|
|
15
|
+
};
|
|
16
|
+
function getPath(node, path = []) {
|
|
17
|
+
if (node) {
|
|
18
|
+
const nodeName = node.name || node.property && node.property.name;
|
|
19
|
+
if (node.object) {
|
|
20
|
+
return getPath(node.object, [
|
|
21
|
+
nodeName,
|
|
22
|
+
...path
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
if (node.callee)
|
|
26
|
+
return getPath(node.callee, path);
|
|
27
|
+
return [nodeName, ...path];
|
|
28
|
+
}
|
|
29
|
+
return path;
|
|
30
|
+
}
|
|
31
|
+
var noOnlyTests = createRule({
|
|
32
|
+
name: "no-only-tests",
|
|
33
|
+
create: (context, [options]) => {
|
|
34
|
+
const {
|
|
35
|
+
blocks = DEFAULT_OPTIONS.blocks,
|
|
36
|
+
focus = DEFAULT_OPTIONS.focus
|
|
37
|
+
} = options;
|
|
38
|
+
const handler = {
|
|
39
|
+
Identifier(node) {
|
|
40
|
+
const parent = node.parent?.object;
|
|
41
|
+
if (!parent)
|
|
42
|
+
return;
|
|
43
|
+
if (!focus.includes(node.name))
|
|
44
|
+
return;
|
|
45
|
+
const callPath = getPath(node.parent).join(".");
|
|
46
|
+
const found = blocks.find((block) => {
|
|
47
|
+
if (block.endsWith("*"))
|
|
48
|
+
return callPath.startsWith(block.replace(/\*$/, ""));
|
|
49
|
+
return callPath.startsWith(`${block}.`);
|
|
50
|
+
});
|
|
51
|
+
if (found) {
|
|
52
|
+
context.report({
|
|
53
|
+
data: { block: callPath.split(".")[0], focus: node.name },
|
|
54
|
+
messageId: "notPermitted",
|
|
55
|
+
node
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return handler;
|
|
61
|
+
},
|
|
62
|
+
defaultOptions: [{
|
|
63
|
+
blocks: ["describe", "it", "test"],
|
|
64
|
+
focus: ["only"]
|
|
65
|
+
}],
|
|
66
|
+
meta: {
|
|
67
|
+
docs: {
|
|
68
|
+
description: "disallow .only blocks in tests",
|
|
69
|
+
recommended: "recommended"
|
|
70
|
+
},
|
|
71
|
+
messages: {
|
|
72
|
+
notPermitted: "{{ block }}.{{ focus }} not permitted"
|
|
73
|
+
},
|
|
74
|
+
schema: [{
|
|
75
|
+
additionalProperties: false,
|
|
76
|
+
properties: {
|
|
77
|
+
blocks: {
|
|
78
|
+
items: {
|
|
79
|
+
type: "string"
|
|
80
|
+
},
|
|
81
|
+
type: "array",
|
|
82
|
+
uniqueItems: true
|
|
83
|
+
},
|
|
84
|
+
focus: {
|
|
85
|
+
items: {
|
|
86
|
+
type: "string"
|
|
87
|
+
},
|
|
88
|
+
type: "array",
|
|
89
|
+
uniqueItems: true
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
type: "object"
|
|
93
|
+
}],
|
|
94
|
+
type: "layout"
|
|
95
|
+
}
|
|
96
|
+
// i need to have this here, otherwise typechecking fails.
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// src/configs/test.ts
|
|
100
|
+
async function test(options = {}) {
|
|
101
|
+
const {
|
|
102
|
+
editor = false,
|
|
103
|
+
files = GLOB_TESTS,
|
|
104
|
+
overrides = {}
|
|
105
|
+
} = options;
|
|
106
|
+
const [
|
|
107
|
+
pluginVitest
|
|
108
|
+
] = await Promise.all([
|
|
109
|
+
interop(import("eslint-plugin-vitest"))
|
|
110
|
+
]);
|
|
111
|
+
return [
|
|
112
|
+
{
|
|
113
|
+
name: "luxass:test:setup",
|
|
114
|
+
plugins: {
|
|
115
|
+
test: {
|
|
116
|
+
...pluginVitest,
|
|
117
|
+
rules: {
|
|
118
|
+
...pluginVitest.rules,
|
|
119
|
+
"no-only-tests": noOnlyTests
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "luxass:test:rules",
|
|
126
|
+
files,
|
|
127
|
+
rules: {
|
|
128
|
+
"test/consistent-test-it": [
|
|
129
|
+
"error",
|
|
130
|
+
{ fn: "it", withinDescribe: "it" }
|
|
131
|
+
],
|
|
132
|
+
"test/no-identical-title": "error",
|
|
133
|
+
"test/no-only-tests": editor ? "off" : "error",
|
|
134
|
+
"test/prefer-hooks-in-order": "error",
|
|
135
|
+
"test/prefer-lowercase-title": "error",
|
|
136
|
+
...overrides
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export {
|
|
143
|
+
test
|
|
144
|
+
};
|
package/dist/configs/astro.cjs
CHANGED
|
@@ -36,9 +36,7 @@ module.exports = __toCommonJS(astro_exports);
|
|
|
36
36
|
|
|
37
37
|
// src/globs.ts
|
|
38
38
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
39
|
-
var GLOB_SRC =
|
|
40
|
-
var GLOB_JSX_EXT = "[jt]sx";
|
|
41
|
-
var GLOB_JSX = `**/*.${GLOB_JSX_EXT}`;
|
|
39
|
+
var GLOB_SRC = `**/*.${GLOB_SRC_EXT}`;
|
|
42
40
|
var GLOB_MARKDOWN = "**/*.md";
|
|
43
41
|
var GLOB_ASTRO = "**/*.astro";
|
|
44
42
|
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
@@ -49,11 +47,6 @@ var GLOB_TESTS = [
|
|
|
49
47
|
`**/*.bench.${GLOB_SRC_EXT}`,
|
|
50
48
|
`**/*.benchmark.${GLOB_SRC_EXT}`
|
|
51
49
|
];
|
|
52
|
-
var GLOB_NEXTJS_OG = [
|
|
53
|
-
`**/app/**/opengraph-image.${GLOB_JSX_EXT}`,
|
|
54
|
-
`**/app/**/twitter-image.${GLOB_JSX_EXT}`,
|
|
55
|
-
`**/app/**/route.${GLOB_JSX_EXT}`
|
|
56
|
-
];
|
|
57
50
|
var GLOB_NEXTJS_ROUTES = [
|
|
58
51
|
`**/app/**/page.${GLOB_SRC_EXT}`,
|
|
59
52
|
`**/app/**/layout.${GLOB_SRC_EXT}`,
|
|
@@ -78,14 +71,10 @@ async function interop(m) {
|
|
|
78
71
|
async function astro(options) {
|
|
79
72
|
const {
|
|
80
73
|
a11y = false,
|
|
81
|
-
|
|
82
|
-
|
|
74
|
+
files = [GLOB_ASTRO],
|
|
75
|
+
overrides = {},
|
|
76
|
+
typescript = true
|
|
83
77
|
} = options;
|
|
84
|
-
await interop([
|
|
85
|
-
"eslint-plugin-astro",
|
|
86
|
-
"astro-eslint-parser",
|
|
87
|
-
...options.a11y ? ["eslint-plugin-jsx-a11y"] : []
|
|
88
|
-
]);
|
|
89
78
|
const [
|
|
90
79
|
pluginAstro,
|
|
91
80
|
parserAstro,
|
|
@@ -93,7 +82,7 @@ async function astro(options) {
|
|
|
93
82
|
] = await Promise.all([
|
|
94
83
|
interop(import("eslint-plugin-astro")),
|
|
95
84
|
interop(import("astro-eslint-parser")),
|
|
96
|
-
...
|
|
85
|
+
...a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
|
|
97
86
|
]);
|
|
98
87
|
return [
|
|
99
88
|
{
|
|
@@ -104,7 +93,8 @@ async function astro(options) {
|
|
|
104
93
|
}
|
|
105
94
|
},
|
|
106
95
|
{
|
|
107
|
-
|
|
96
|
+
name: "luxass:astro:rules",
|
|
97
|
+
files,
|
|
108
98
|
languageOptions: {
|
|
109
99
|
// @ts-expect-error hmmm
|
|
110
100
|
globals: {
|
|
@@ -113,21 +103,22 @@ async function astro(options) {
|
|
|
113
103
|
parser: parserAstro,
|
|
114
104
|
parserOptions: {
|
|
115
105
|
extraFileExtensions: [".astro"],
|
|
116
|
-
parser:
|
|
106
|
+
parser: typescript ? await interop(import("@typescript-eslint/parser")) : null,
|
|
117
107
|
sourceType: "module"
|
|
118
108
|
}
|
|
119
109
|
},
|
|
120
|
-
name: "luxass:astro:rules",
|
|
121
110
|
// @ts-expect-error hmmm
|
|
122
111
|
rules: {
|
|
123
112
|
"style/jsx-closing-tag-location": "off",
|
|
124
113
|
"style/jsx-indent": "off",
|
|
125
114
|
"style/jsx-one-expression-per-line": "off",
|
|
126
115
|
...pluginAstro.configs.all.rules,
|
|
116
|
+
"style/multiline-ternary": ["error", "never"],
|
|
127
117
|
...overrides
|
|
128
118
|
}
|
|
129
119
|
},
|
|
130
120
|
{
|
|
121
|
+
name: "luxass:astro:rules:scripts",
|
|
131
122
|
files: [
|
|
132
123
|
"**/*.astro/*.js",
|
|
133
124
|
"*.astro/*.js"
|
|
@@ -140,8 +131,7 @@ async function astro(options) {
|
|
|
140
131
|
parserOptions: {
|
|
141
132
|
sourceType: "module"
|
|
142
133
|
}
|
|
143
|
-
}
|
|
144
|
-
name: "luxass:astro:rules:scripts"
|
|
134
|
+
}
|
|
145
135
|
}
|
|
146
136
|
];
|
|
147
137
|
}
|
package/dist/configs/astro.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export { A as AstroOptions, f as astro } from '../types-spTEGSaV.cjs';
|
|
2
2
|
import 'eslint-config-flat-gitignore';
|
|
3
|
-
import '@typescript-eslint/parser';
|
|
4
3
|
import '@antfu/eslint-define-config';
|
|
5
4
|
import '@eslint-types/jsdoc/types';
|
|
6
5
|
import '@eslint-types/typescript-eslint/types';
|
|
@@ -8,7 +7,5 @@ import '@eslint-types/unicorn/types';
|
|
|
8
7
|
import 'eslint-plugin-antfu';
|
|
9
8
|
import '@stylistic/eslint-plugin';
|
|
10
9
|
import 'eslint';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export { astro };
|
|
10
|
+
import '@typescript-eslint/parser';
|
|
11
|
+
import 'eslint-processor-vue-blocks';
|
package/dist/configs/astro.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export { A as AstroOptions, f as astro } from '../types-spTEGSaV.js';
|
|
2
2
|
import 'eslint-config-flat-gitignore';
|
|
3
|
-
import '@typescript-eslint/parser';
|
|
4
3
|
import '@antfu/eslint-define-config';
|
|
5
4
|
import '@eslint-types/jsdoc/types';
|
|
6
5
|
import '@eslint-types/typescript-eslint/types';
|
|
@@ -8,7 +7,5 @@ import '@eslint-types/unicorn/types';
|
|
|
8
7
|
import 'eslint-plugin-antfu';
|
|
9
8
|
import '@stylistic/eslint-plugin';
|
|
10
9
|
import 'eslint';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export { astro };
|
|
10
|
+
import '@typescript-eslint/parser';
|
|
11
|
+
import 'eslint-processor-vue-blocks';
|
package/dist/configs/astro.mjs
CHANGED
|
@@ -33,17 +33,7 @@ __export(comments_exports, {
|
|
|
33
33
|
comments: () => comments
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(comments_exports);
|
|
36
|
-
|
|
37
|
-
// src/plugins.ts
|
|
38
|
-
var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
|
|
39
|
-
var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
|
|
40
|
-
var pluginImport = __toESM(require("eslint-plugin-i"), 1);
|
|
41
|
-
var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
|
|
42
|
-
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
43
|
-
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
44
|
-
var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
|
|
45
|
-
|
|
46
|
-
// src/configs/comments.ts
|
|
36
|
+
var import_eslint_plugin_eslint_comments = __toESM(require("@eslint-community/eslint-plugin-eslint-comments"), 1);
|
|
47
37
|
async function comments() {
|
|
48
38
|
return [
|
|
49
39
|
{
|
|
@@ -52,10 +42,17 @@ async function comments() {
|
|
|
52
42
|
"eslint-comments": import_eslint_plugin_eslint_comments.default
|
|
53
43
|
},
|
|
54
44
|
rules: {
|
|
45
|
+
// https://github.com/eslint-community/eslint-plugin-eslint-comments/blob/main/docs/rules/disable-enable-pair.md
|
|
46
|
+
"eslint-comments/disable-enable-pair": "error",
|
|
47
|
+
// https://github.com/eslint-community/eslint-plugin-eslint-comments/blob/main/docs/rules/no-aggregating-enable.md
|
|
55
48
|
"eslint-comments/no-aggregating-enable": "error",
|
|
49
|
+
// https://github.com/eslint-community/eslint-plugin-eslint-comments/blob/main/docs/rules/no-duplicate-disable.md
|
|
56
50
|
"eslint-comments/no-duplicate-disable": "error",
|
|
51
|
+
// https://github.com/eslint-community/eslint-plugin-eslint-comments/blob/main/docs/rules/no-unlimited-disable.md
|
|
57
52
|
"eslint-comments/no-unlimited-disable": "error",
|
|
58
|
-
|
|
53
|
+
// Deprecated in favor of official reportUnusedDisableDirectives
|
|
54
|
+
// https://github.com/eslint-community/eslint-plugin-eslint-comments/issues/133
|
|
55
|
+
"eslint-comments/no-unused-enable": "off"
|
|
59
56
|
}
|
|
60
57
|
}
|
|
61
58
|
];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as FlatConfigItem } from '../types-spTEGSaV.cjs';
|
|
2
2
|
import 'eslint-config-flat-gitignore';
|
|
3
|
-
import '@typescript-eslint/parser';
|
|
4
3
|
import '@antfu/eslint-define-config';
|
|
5
4
|
import '@eslint-types/jsdoc/types';
|
|
6
5
|
import '@eslint-types/typescript-eslint/types';
|
|
@@ -8,6 +7,8 @@ import '@eslint-types/unicorn/types';
|
|
|
8
7
|
import 'eslint-plugin-antfu';
|
|
9
8
|
import '@stylistic/eslint-plugin';
|
|
10
9
|
import 'eslint';
|
|
10
|
+
import '@typescript-eslint/parser';
|
|
11
|
+
import 'eslint-processor-vue-blocks';
|
|
11
12
|
|
|
12
13
|
declare function comments(): Promise<FlatConfigItem[]>;
|
|
13
14
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as FlatConfigItem } from '../types-spTEGSaV.js';
|
|
2
2
|
import 'eslint-config-flat-gitignore';
|
|
3
|
-
import '@typescript-eslint/parser';
|
|
4
3
|
import '@antfu/eslint-define-config';
|
|
5
4
|
import '@eslint-types/jsdoc/types';
|
|
6
5
|
import '@eslint-types/typescript-eslint/types';
|
|
@@ -8,6 +7,8 @@ import '@eslint-types/unicorn/types';
|
|
|
8
7
|
import 'eslint-plugin-antfu';
|
|
9
8
|
import '@stylistic/eslint-plugin';
|
|
10
9
|
import 'eslint';
|
|
10
|
+
import '@typescript-eslint/parser';
|
|
11
|
+
import 'eslint-processor-vue-blocks';
|
|
11
12
|
|
|
12
13
|
declare function comments(): Promise<FlatConfigItem[]>;
|
|
13
14
|
|