@luxass/eslint-config 4.0.0-beta.2 → 4.0.0-beta.4
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/{chunk-ZTOORI5P.mjs → chunk-24LIS25A.mjs} +5 -2
- package/dist/chunk-2TYG7WFX.mjs +69 -0
- package/dist/{chunk-G6V66ILI.mjs → chunk-2XXYFOA7.mjs} +1 -1
- package/dist/{chunk-NRBPL3VW.mjs → chunk-AOKXEX6L.mjs} +7 -3
- package/dist/{chunk-6SYSH62F.mjs → chunk-C22IQSUX.mjs} +1 -1
- package/dist/{chunk-2EQRCLEQ.mjs → chunk-DCAOYLG4.mjs} +6 -6
- package/dist/{chunk-BTZJDCAN.mjs → chunk-ETF3RTA4.mjs} +1 -1
- package/dist/{chunk-R3GRT6P5.mjs → chunk-F2BEG6UB.mjs} +4 -4
- package/dist/{chunk-AM4JLG65.mjs → chunk-N6ELMARC.mjs} +3 -3
- package/dist/chunk-PMOB43IB.mjs +77 -0
- package/dist/{chunk-DCGVBPLE.mjs → chunk-R5QPJQWU.mjs} +1 -1
- package/dist/{chunk-WVJWB3E2.mjs → chunk-VJYICA7B.mjs} +1 -1
- package/dist/{chunk-5CXAPQV3.mjs → chunk-YPPGNIVG.mjs} +4 -18
- package/dist/{chunk-MAFD6GLW.mjs → chunk-ZCBXPKVL.mjs} +4 -5
- package/dist/configs/astro.cjs +144 -0
- package/dist/configs/astro.d.cts +14 -0
- package/dist/configs/astro.d.ts +14 -0
- package/dist/configs/astro.mjs +8 -0
- package/dist/configs/comments.d.cts +1 -1
- package/dist/configs/comments.d.ts +1 -1
- package/dist/configs/ignores.cjs +1 -0
- package/dist/configs/ignores.d.cts +1 -1
- package/dist/configs/ignores.d.ts +1 -1
- package/dist/configs/ignores.mjs +2 -2
- package/dist/configs/imports.d.cts +1 -1
- package/dist/configs/imports.d.ts +1 -1
- package/dist/configs/index.cjs +115 -435
- package/dist/configs/index.d.cts +2 -1
- package/dist/configs/index.d.ts +2 -1
- package/dist/configs/index.mjs +21 -17
- package/dist/configs/javascript.cjs +1 -0
- package/dist/configs/javascript.d.cts +1 -1
- package/dist/configs/javascript.d.ts +1 -1
- package/dist/configs/javascript.mjs +2 -2
- package/dist/configs/jsdoc.d.cts +1 -1
- package/dist/configs/jsdoc.d.ts +1 -1
- package/dist/configs/jsonc.cjs +1 -0
- package/dist/configs/jsonc.d.cts +1 -1
- package/dist/configs/jsonc.d.ts +1 -1
- package/dist/configs/jsonc.mjs +2 -2
- package/dist/configs/markdown.cjs +1 -0
- package/dist/configs/markdown.d.cts +1 -1
- package/dist/configs/markdown.d.ts +1 -1
- package/dist/configs/markdown.mjs +2 -2
- package/dist/configs/nextjs.cjs +6 -5
- package/dist/configs/nextjs.d.cts +1 -1
- package/dist/configs/nextjs.d.ts +1 -1
- package/dist/configs/nextjs.mjs +2 -2
- package/dist/configs/node.d.cts +1 -1
- package/dist/configs/node.d.ts +1 -1
- package/dist/configs/perfectionist.d.cts +1 -1
- package/dist/configs/perfectionist.d.ts +1 -1
- package/dist/configs/react.cjs +26 -422
- package/dist/configs/react.d.cts +2 -2
- package/dist/configs/react.d.ts +2 -2
- package/dist/configs/react.mjs +2 -2
- package/dist/configs/sort.d.cts +1 -1
- package/dist/configs/sort.d.ts +1 -1
- package/dist/configs/stylistic.cjs +4 -5
- package/dist/configs/stylistic.d.cts +1 -1
- package/dist/configs/stylistic.d.ts +1 -1
- package/dist/configs/stylistic.mjs +1 -1
- package/dist/configs/tailwindcss.cjs +1 -0
- package/dist/configs/tailwindcss.d.cts +1 -1
- package/dist/configs/tailwindcss.d.ts +1 -1
- package/dist/configs/tailwindcss.mjs +2 -2
- package/dist/configs/test.cjs +1 -0
- package/dist/configs/test.d.cts +1 -1
- package/dist/configs/test.d.ts +1 -1
- package/dist/configs/test.mjs +2 -2
- package/dist/configs/typescript.cjs +1 -0
- package/dist/configs/typescript.d.cts +1 -1
- package/dist/configs/typescript.d.ts +1 -1
- package/dist/configs/typescript.mjs +2 -2
- package/dist/configs/unicorn.d.cts +1 -1
- package/dist/configs/unicorn.d.ts +1 -1
- package/dist/configs/unocss.d.cts +1 -1
- package/dist/configs/unocss.d.ts +1 -1
- package/dist/configs/vue.cjs +5 -1
- package/dist/configs/vue.d.cts +1 -1
- package/dist/configs/vue.d.ts +1 -1
- package/dist/configs/vue.mjs +2 -2
- package/dist/configs/yaml.cjs +7 -2
- package/dist/configs/yaml.d.cts +1 -1
- package/dist/configs/yaml.d.ts +1 -1
- package/dist/configs/yaml.mjs +2 -2
- package/dist/index.cjs +134 -457
- package/dist/index.d.cts +5 -6
- package/dist/index.d.ts +5 -6
- package/dist/index.mjs +44 -30
- package/dist/{types-3xH9kIfB.d.ts → types-d6wL74Fv.d.ts} +15 -2
- package/package.json +3 -1
- package/dist/chunk-OGH5EICB.mjs +0 -465
- /package/dist/{chunk-QMWKLGGE.mjs → chunk-FKAOMYGL.mjs} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GLOB_VUE
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YPPGNIVG.mjs";
|
|
4
4
|
import {
|
|
5
5
|
interop
|
|
6
6
|
} from "./chunk-4VUK6ART.mjs";
|
|
@@ -15,6 +15,9 @@ async function vue(options = {}) {
|
|
|
15
15
|
interop(import("eslint-plugin-vue")),
|
|
16
16
|
interop(import("vue-eslint-parser"))
|
|
17
17
|
]);
|
|
18
|
+
const {
|
|
19
|
+
indent = 2
|
|
20
|
+
} = typeof stylistic === "boolean" ? {} : stylistic;
|
|
18
21
|
return [
|
|
19
22
|
{
|
|
20
23
|
name: "luxass:vue:setup",
|
|
@@ -66,7 +69,7 @@ async function vue(options = {}) {
|
|
|
66
69
|
"vue/dot-location": ["error", "property"],
|
|
67
70
|
"vue/dot-notation": ["error", { allowKeywords: true }],
|
|
68
71
|
"vue/eqeqeq": ["error", "smart"],
|
|
69
|
-
"vue/html-indent": ["error",
|
|
72
|
+
"vue/html-indent": ["error", indent],
|
|
70
73
|
"vue/html-quotes": ["error", "double"],
|
|
71
74
|
"vue/max-attributes-per-line": "off",
|
|
72
75
|
"vue/multi-word-component-names": "off",
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GLOB_JSX
|
|
3
|
+
} from "./chunk-YPPGNIVG.mjs";
|
|
4
|
+
import {
|
|
5
|
+
interop
|
|
6
|
+
} from "./chunk-4VUK6ART.mjs";
|
|
7
|
+
|
|
8
|
+
// src/configs/react.ts
|
|
9
|
+
import globals from "globals";
|
|
10
|
+
async function react(options) {
|
|
11
|
+
const [
|
|
12
|
+
pluginReact,
|
|
13
|
+
pluginReactHooks,
|
|
14
|
+
pluginA11y
|
|
15
|
+
] = await Promise.all([
|
|
16
|
+
interop(import("eslint-plugin-react")),
|
|
17
|
+
interop(import("eslint-plugin-react-hooks")),
|
|
18
|
+
...options.a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
|
|
19
|
+
]);
|
|
20
|
+
const {
|
|
21
|
+
a11y = false,
|
|
22
|
+
overrides = {},
|
|
23
|
+
typescript = true
|
|
24
|
+
} = options;
|
|
25
|
+
return [
|
|
26
|
+
{
|
|
27
|
+
name: "luxass:react:setup",
|
|
28
|
+
plugins: {
|
|
29
|
+
"react": pluginReact,
|
|
30
|
+
"react-hooks": pluginReactHooks,
|
|
31
|
+
...a11y ? { "jsx-a11y": pluginA11y } : {}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
files: [GLOB_JSX],
|
|
36
|
+
languageOptions: {
|
|
37
|
+
...pluginReact.configs.recommended.languageOptions,
|
|
38
|
+
globals: {
|
|
39
|
+
...globals.browser
|
|
40
|
+
},
|
|
41
|
+
parserOptions: {
|
|
42
|
+
ecmaFeatures: {
|
|
43
|
+
jsx: true
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
name: "luxass:react:rules",
|
|
48
|
+
rules: {
|
|
49
|
+
...pluginReact.configs.recommended.rules,
|
|
50
|
+
...pluginReactHooks.configs.recommended.rules,
|
|
51
|
+
...a11y ? pluginA11y.configs.recommended.rules : {},
|
|
52
|
+
"react/react-in-jsx-scope": "off",
|
|
53
|
+
...typescript ? {
|
|
54
|
+
"react/prop-type": "off"
|
|
55
|
+
} : {},
|
|
56
|
+
...overrides
|
|
57
|
+
},
|
|
58
|
+
settings: {
|
|
59
|
+
react: {
|
|
60
|
+
version: "detect"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
react
|
|
69
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GLOB_YAML
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YPPGNIVG.mjs";
|
|
4
4
|
import {
|
|
5
5
|
interop
|
|
6
6
|
} from "./chunk-4VUK6ART.mjs";
|
|
@@ -15,6 +15,10 @@ async function yaml(options = {}) {
|
|
|
15
15
|
interop(import("eslint-plugin-yml")),
|
|
16
16
|
interop(import("yaml-eslint-parser"))
|
|
17
17
|
]);
|
|
18
|
+
const {
|
|
19
|
+
indent = 2,
|
|
20
|
+
quotes = "double"
|
|
21
|
+
} = typeof stylistic === "boolean" ? {} : stylistic;
|
|
18
22
|
return [
|
|
19
23
|
{
|
|
20
24
|
name: "luxass:yaml:setup",
|
|
@@ -44,12 +48,12 @@ async function yaml(options = {}) {
|
|
|
44
48
|
"yaml/flow-mapping-curly-spacing": "error",
|
|
45
49
|
"yaml/flow-sequence-bracket-newline": "error",
|
|
46
50
|
"yaml/flow-sequence-bracket-spacing": "error",
|
|
47
|
-
"yaml/indent": ["error", 2],
|
|
51
|
+
"yaml/indent": ["error", indent === "tab" ? 2 : indent],
|
|
48
52
|
"yaml/key-spacing": "error",
|
|
49
53
|
"yaml/no-tab-indent": "error",
|
|
50
54
|
"yaml/quotes": [
|
|
51
55
|
"error",
|
|
52
|
-
{ avoidEscape: false, prefer:
|
|
56
|
+
{ avoidEscape: false, prefer: quotes }
|
|
53
57
|
],
|
|
54
58
|
"yaml/spaced-comment": "error"
|
|
55
59
|
} : {},
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
GLOB_NEXTJS_OG,
|
|
3
3
|
GLOB_NEXTJS_ROUTES,
|
|
4
4
|
GLOB_SRC
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YPPGNIVG.mjs";
|
|
6
6
|
import {
|
|
7
7
|
interop
|
|
8
8
|
} from "./chunk-4VUK6ART.mjs";
|
|
@@ -24,12 +24,11 @@ async function nextjs(options = {}) {
|
|
|
24
24
|
rules: {
|
|
25
25
|
...pluginNextjs.configs.recommended.rules,
|
|
26
26
|
...pluginNextjs.configs["core-web-vitals"].rules,
|
|
27
|
-
"@next/next/google-font-display": ["
|
|
28
|
-
"@next/next/google-font-preconnect": ["
|
|
27
|
+
"@next/next/google-font-display": ["error"],
|
|
28
|
+
"@next/next/google-font-preconnect": ["error"],
|
|
29
29
|
"@next/next/inline-script-id": ["error"],
|
|
30
30
|
"@next/next/next-script-for-ga": ["warn"],
|
|
31
31
|
"@next/next/no-assign-module-variable": ["error"],
|
|
32
|
-
"@next/next/no-before-interactive-script-outside-document": ["warn"],
|
|
33
32
|
"@next/next/no-css-tags": ["warn"],
|
|
34
33
|
"@next/next/no-document-import-in-page": ["error"],
|
|
35
34
|
"@next/next/no-duplicate-head": ["error"],
|
|
@@ -44,7 +43,7 @@ async function nextjs(options = {}) {
|
|
|
44
43
|
"@next/next/no-title-in-document-head": ["warn"],
|
|
45
44
|
"@next/next/no-typos": ["warn"],
|
|
46
45
|
"@next/next/no-unwanted-polyfillio": ["warn"],
|
|
47
|
-
"jsx-a11y/anchor-is-valid": ["off"],
|
|
46
|
+
// "jsx-a11y/anchor-is-valid": ["off"],
|
|
48
47
|
// This rule creates errors with webpack parsing on edge runtime
|
|
49
48
|
"unicorn/prefer-node-protocol": ["off"],
|
|
50
49
|
...overrides
|
|
@@ -68,8 +67,9 @@ async function nextjs(options = {}) {
|
|
|
68
67
|
},
|
|
69
68
|
{
|
|
70
69
|
files: GLOB_NEXTJS_OG,
|
|
71
|
-
name: "luxass:nextjs:
|
|
70
|
+
name: "luxass:nextjs:og-override",
|
|
72
71
|
rules: {
|
|
72
|
+
"@next/next/no-img-element": "off",
|
|
73
73
|
"react/no-unknown-property": ["error", {
|
|
74
74
|
ignore: ["tw"]
|
|
75
75
|
}]
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GLOB_SRC,
|
|
3
|
+
GLOB_SRC_EXT
|
|
4
|
+
} from "./chunk-YPPGNIVG.mjs";
|
|
1
5
|
import {
|
|
2
6
|
default as default2,
|
|
3
7
|
default5 as default3
|
|
4
8
|
} from "./chunk-C5VMTRKT.mjs";
|
|
5
|
-
import {
|
|
6
|
-
GLOB_SRC,
|
|
7
|
-
GLOB_SRC_EXT
|
|
8
|
-
} from "./chunk-5CXAPQV3.mjs";
|
|
9
9
|
|
|
10
10
|
// src/configs/javascript.ts
|
|
11
11
|
import globals from "globals";
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GLOB_ASTRO
|
|
3
|
+
} from "./chunk-YPPGNIVG.mjs";
|
|
4
|
+
import {
|
|
5
|
+
interop
|
|
6
|
+
} from "./chunk-4VUK6ART.mjs";
|
|
7
|
+
|
|
8
|
+
// src/configs/astro.ts
|
|
9
|
+
async function astro(options) {
|
|
10
|
+
const [
|
|
11
|
+
pluginAstro,
|
|
12
|
+
parserAstro,
|
|
13
|
+
pluginA11y
|
|
14
|
+
] = await Promise.all([
|
|
15
|
+
interop(import("eslint-plugin-astro")),
|
|
16
|
+
interop(import("astro-eslint-parser")),
|
|
17
|
+
...options.a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
|
|
18
|
+
]);
|
|
19
|
+
const {
|
|
20
|
+
a11y = false,
|
|
21
|
+
overrides = {}
|
|
22
|
+
// typescript = true,
|
|
23
|
+
} = options;
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
name: "luxass:astro:setup",
|
|
27
|
+
plugins: {
|
|
28
|
+
astro: pluginAstro,
|
|
29
|
+
...a11y ? { "jsx-a11y": pluginA11y } : {}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
files: [GLOB_ASTRO],
|
|
34
|
+
languageOptions: {
|
|
35
|
+
// @ts-expect-error hmmm
|
|
36
|
+
globals: {
|
|
37
|
+
...pluginAstro.configs.base.overrides[0].env
|
|
38
|
+
},
|
|
39
|
+
parser: parserAstro,
|
|
40
|
+
parserOptions: {
|
|
41
|
+
extraFileExtensions: [".astro"],
|
|
42
|
+
parser: options.typescript ? await interop(import("@typescript-eslint/parser")) : null,
|
|
43
|
+
sourceType: "module"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
name: "luxass:astro:rules",
|
|
47
|
+
// @ts-expect-error hmmm
|
|
48
|
+
rules: {
|
|
49
|
+
"style/jsx-closing-tag-location": "off",
|
|
50
|
+
"style/jsx-indent": "off",
|
|
51
|
+
"style/jsx-one-expression-per-line": "off",
|
|
52
|
+
...pluginAstro.configs.all.rules,
|
|
53
|
+
...overrides
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
files: [
|
|
58
|
+
"**/*.astro/*.js",
|
|
59
|
+
"*.astro/*.js"
|
|
60
|
+
],
|
|
61
|
+
languageOptions: {
|
|
62
|
+
// @ts-expect-error hmmm
|
|
63
|
+
globals: {
|
|
64
|
+
...pluginAstro.configs.base.overrides[1].env
|
|
65
|
+
},
|
|
66
|
+
parserOptions: {
|
|
67
|
+
sourceType: "module"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
name: "luxass:astro:rules:scripts"
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
astro
|
|
77
|
+
};
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
3
3
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
4
4
|
var GLOB_JS = "**/*.?([cm])js";
|
|
5
|
-
var GLOB_JSX = "**/*.?([cm])jsx";
|
|
6
5
|
var GLOB_TS = "**/*.?([cm])ts";
|
|
7
|
-
var GLOB_TSX = "**/*.?([cm])tsx";
|
|
8
6
|
var GLOB_JSX_EXT = "[jt]sx";
|
|
7
|
+
var GLOB_JSX = `**/*.${GLOB_JSX_EXT}`;
|
|
9
8
|
var GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
10
9
|
var GLOB_CSS = "**/*.css";
|
|
11
10
|
var GLOB_LESS = "**/*.less";
|
|
@@ -15,9 +14,9 @@ var GLOB_JSON5 = "**/*.json5";
|
|
|
15
14
|
var GLOB_JSONC = "**/*.jsonc";
|
|
16
15
|
var GLOB_MARKDOWN = "**/*.md";
|
|
17
16
|
var GLOB_VUE = "**/*.vue";
|
|
18
|
-
var GLOB_REACT = GLOB_SRC;
|
|
19
17
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
20
18
|
var GLOB_HTML = "**/*.htm?(l)";
|
|
19
|
+
var GLOB_ASTRO = "**/*.astro";
|
|
21
20
|
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
22
21
|
var GLOB_TESTS = [
|
|
23
22
|
`**/__tests__/**/*.${GLOB_SRC_EXT}`,
|
|
@@ -42,17 +41,6 @@ var GLOB_NEXTJS_ROUTES = [
|
|
|
42
41
|
`**/app/**/sitemap.${GLOB_SRC_EXT}`,
|
|
43
42
|
`**/pages/**/*.${GLOB_SRC_EXT}`
|
|
44
43
|
];
|
|
45
|
-
var GLOB_ALL_SRC = [
|
|
46
|
-
GLOB_SRC,
|
|
47
|
-
GLOB_STYLE,
|
|
48
|
-
GLOB_JSON,
|
|
49
|
-
GLOB_JSON5,
|
|
50
|
-
GLOB_MARKDOWN,
|
|
51
|
-
GLOB_VUE,
|
|
52
|
-
GLOB_YAML,
|
|
53
|
-
GLOB_HTML,
|
|
54
|
-
GLOB_REACT
|
|
55
|
-
];
|
|
56
44
|
var GLOB_EXCLUDE = [
|
|
57
45
|
"**/node_modules",
|
|
58
46
|
"**/dist",
|
|
@@ -90,10 +78,9 @@ export {
|
|
|
90
78
|
GLOB_SRC_EXT,
|
|
91
79
|
GLOB_SRC,
|
|
92
80
|
GLOB_JS,
|
|
93
|
-
GLOB_JSX,
|
|
94
81
|
GLOB_TS,
|
|
95
|
-
GLOB_TSX,
|
|
96
82
|
GLOB_JSX_EXT,
|
|
83
|
+
GLOB_JSX,
|
|
97
84
|
GLOB_STYLE,
|
|
98
85
|
GLOB_CSS,
|
|
99
86
|
GLOB_LESS,
|
|
@@ -103,13 +90,12 @@ export {
|
|
|
103
90
|
GLOB_JSONC,
|
|
104
91
|
GLOB_MARKDOWN,
|
|
105
92
|
GLOB_VUE,
|
|
106
|
-
GLOB_REACT,
|
|
107
93
|
GLOB_YAML,
|
|
108
94
|
GLOB_HTML,
|
|
95
|
+
GLOB_ASTRO,
|
|
109
96
|
GLOB_MARKDOWN_CODE,
|
|
110
97
|
GLOB_TESTS,
|
|
111
98
|
GLOB_NEXTJS_OG,
|
|
112
99
|
GLOB_NEXTJS_ROUTES,
|
|
113
|
-
GLOB_ALL_SRC,
|
|
114
100
|
GLOB_EXCLUDE
|
|
115
101
|
};
|
|
@@ -7,16 +7,15 @@ import {
|
|
|
7
7
|
|
|
8
8
|
// src/configs/stylistic.ts
|
|
9
9
|
async function stylistic(options = {}) {
|
|
10
|
-
const { jsx = true } = options;
|
|
10
|
+
const { indent = 2, jsx = true, quotes = "double", semi = true } = options;
|
|
11
11
|
const pluginStylistic = await interop(import("@stylistic/eslint-plugin"));
|
|
12
|
-
const indent = 2;
|
|
13
12
|
const config = pluginStylistic.configs.customize({
|
|
14
13
|
flat: true,
|
|
15
14
|
indent,
|
|
16
15
|
jsx,
|
|
17
16
|
pluginName: "style",
|
|
18
|
-
quotes
|
|
19
|
-
semi
|
|
17
|
+
quotes,
|
|
18
|
+
semi
|
|
20
19
|
});
|
|
21
20
|
return [
|
|
22
21
|
{
|
|
@@ -28,7 +27,7 @@ async function stylistic(options = {}) {
|
|
|
28
27
|
rules: {
|
|
29
28
|
...config.rules,
|
|
30
29
|
"antfu/consistent-list-newline": "error",
|
|
31
|
-
"antfu/if-newline": "
|
|
30
|
+
"antfu/if-newline": "off",
|
|
32
31
|
"antfu/indent-binary-ops": ["error", { indent }],
|
|
33
32
|
"antfu/top-level-function": "error",
|
|
34
33
|
"curly": ["error", "multi-line", "consistent"],
|
|
@@ -0,0 +1,144 @@
|
|
|
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 __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/configs/astro.ts
|
|
31
|
+
var astro_exports = {};
|
|
32
|
+
__export(astro_exports, {
|
|
33
|
+
astro: () => astro
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(astro_exports);
|
|
36
|
+
|
|
37
|
+
// src/globs.ts
|
|
38
|
+
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
39
|
+
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
40
|
+
var GLOB_JSX_EXT = "[jt]sx";
|
|
41
|
+
var GLOB_JSX = `**/*.${GLOB_JSX_EXT}`;
|
|
42
|
+
var GLOB_MARKDOWN = "**/*.md";
|
|
43
|
+
var GLOB_ASTRO = "**/*.astro";
|
|
44
|
+
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
45
|
+
var GLOB_TESTS = [
|
|
46
|
+
`**/__tests__/**/*.${GLOB_SRC_EXT}`,
|
|
47
|
+
`**/*.spec.${GLOB_SRC_EXT}`,
|
|
48
|
+
`**/*.test.${GLOB_SRC_EXT}`,
|
|
49
|
+
`**/*.bench.${GLOB_SRC_EXT}`,
|
|
50
|
+
`**/*.benchmark.${GLOB_SRC_EXT}`
|
|
51
|
+
];
|
|
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
|
+
var GLOB_NEXTJS_ROUTES = [
|
|
58
|
+
`**/app/**/page.${GLOB_SRC_EXT}`,
|
|
59
|
+
`**/app/**/layout.${GLOB_SRC_EXT}`,
|
|
60
|
+
`**/app/**/error.${GLOB_SRC_EXT}`,
|
|
61
|
+
`**/app/**/template.${GLOB_SRC_EXT}`,
|
|
62
|
+
`**/app/**/not-found.${GLOB_SRC_EXT}`,
|
|
63
|
+
`**/app/**/loading.${GLOB_SRC_EXT}`,
|
|
64
|
+
`**/app/**/robots.${GLOB_SRC_EXT}`,
|
|
65
|
+
`**/app/**/sitemap.${GLOB_SRC_EXT}`,
|
|
66
|
+
`**/pages/**/*.${GLOB_SRC_EXT}`
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
// src/utils.ts
|
|
70
|
+
async function interop(m) {
|
|
71
|
+
const resolved = await m;
|
|
72
|
+
return resolved.default || resolved;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// src/configs/astro.ts
|
|
76
|
+
async function astro(options) {
|
|
77
|
+
const [
|
|
78
|
+
pluginAstro,
|
|
79
|
+
parserAstro,
|
|
80
|
+
pluginA11y
|
|
81
|
+
] = await Promise.all([
|
|
82
|
+
interop(import("eslint-plugin-astro")),
|
|
83
|
+
interop(import("astro-eslint-parser")),
|
|
84
|
+
...options.a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
|
|
85
|
+
]);
|
|
86
|
+
const {
|
|
87
|
+
a11y = false,
|
|
88
|
+
overrides = {}
|
|
89
|
+
// typescript = true,
|
|
90
|
+
} = options;
|
|
91
|
+
return [
|
|
92
|
+
{
|
|
93
|
+
name: "luxass:astro:setup",
|
|
94
|
+
plugins: {
|
|
95
|
+
astro: pluginAstro,
|
|
96
|
+
...a11y ? { "jsx-a11y": pluginA11y } : {}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
files: [GLOB_ASTRO],
|
|
101
|
+
languageOptions: {
|
|
102
|
+
// @ts-expect-error hmmm
|
|
103
|
+
globals: {
|
|
104
|
+
...pluginAstro.configs.base.overrides[0].env
|
|
105
|
+
},
|
|
106
|
+
parser: parserAstro,
|
|
107
|
+
parserOptions: {
|
|
108
|
+
extraFileExtensions: [".astro"],
|
|
109
|
+
parser: options.typescript ? await interop(import("@typescript-eslint/parser")) : null,
|
|
110
|
+
sourceType: "module"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
name: "luxass:astro:rules",
|
|
114
|
+
// @ts-expect-error hmmm
|
|
115
|
+
rules: {
|
|
116
|
+
"style/jsx-closing-tag-location": "off",
|
|
117
|
+
"style/jsx-indent": "off",
|
|
118
|
+
"style/jsx-one-expression-per-line": "off",
|
|
119
|
+
...pluginAstro.configs.all.rules,
|
|
120
|
+
...overrides
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
files: [
|
|
125
|
+
"**/*.astro/*.js",
|
|
126
|
+
"*.astro/*.js"
|
|
127
|
+
],
|
|
128
|
+
languageOptions: {
|
|
129
|
+
// @ts-expect-error hmmm
|
|
130
|
+
globals: {
|
|
131
|
+
...pluginAstro.configs.base.overrides[1].env
|
|
132
|
+
},
|
|
133
|
+
parserOptions: {
|
|
134
|
+
sourceType: "module"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
name: "luxass:astro:rules:scripts"
|
|
138
|
+
}
|
|
139
|
+
];
|
|
140
|
+
}
|
|
141
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
142
|
+
0 && (module.exports = {
|
|
143
|
+
astro
|
|
144
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { C as ConfigurationOptions, O as OverrideOptions, R as ReactOptions, F as FlatConfigItem } from '../types-d6wL74Fv.js';
|
|
2
|
+
import 'eslint-config-flat-gitignore';
|
|
3
|
+
import '@typescript-eslint/parser';
|
|
4
|
+
import '@antfu/eslint-define-config';
|
|
5
|
+
import '@eslint-types/jsdoc/types';
|
|
6
|
+
import '@eslint-types/typescript-eslint/types';
|
|
7
|
+
import '@eslint-types/unicorn/types';
|
|
8
|
+
import 'eslint-plugin-antfu';
|
|
9
|
+
import '@stylistic/eslint-plugin';
|
|
10
|
+
import 'eslint';
|
|
11
|
+
|
|
12
|
+
declare function astro(options: ConfigurationOptions<"typescript"> & OverrideOptions & ReactOptions): Promise<FlatConfigItem[]>;
|
|
13
|
+
|
|
14
|
+
export { astro };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { C as ConfigurationOptions, O as OverrideOptions, R as ReactOptions, F as FlatConfigItem } from '../types-d6wL74Fv.js';
|
|
2
|
+
import 'eslint-config-flat-gitignore';
|
|
3
|
+
import '@typescript-eslint/parser';
|
|
4
|
+
import '@antfu/eslint-define-config';
|
|
5
|
+
import '@eslint-types/jsdoc/types';
|
|
6
|
+
import '@eslint-types/typescript-eslint/types';
|
|
7
|
+
import '@eslint-types/unicorn/types';
|
|
8
|
+
import 'eslint-plugin-antfu';
|
|
9
|
+
import '@stylistic/eslint-plugin';
|
|
10
|
+
import 'eslint';
|
|
11
|
+
|
|
12
|
+
declare function astro(options: ConfigurationOptions<"typescript"> & OverrideOptions & ReactOptions): Promise<FlatConfigItem[]>;
|
|
13
|
+
|
|
14
|
+
export { astro };
|
package/dist/configs/ignores.cjs
CHANGED
|
@@ -28,6 +28,7 @@ module.exports = __toCommonJS(ignores_exports);
|
|
|
28
28
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
29
29
|
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
30
30
|
var GLOB_JSX_EXT = "[jt]sx";
|
|
31
|
+
var GLOB_JSX = `**/*.${GLOB_JSX_EXT}`;
|
|
31
32
|
var GLOB_MARKDOWN = "**/*.md";
|
|
32
33
|
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
33
34
|
var GLOB_TESTS = [
|
package/dist/configs/ignores.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as StylisticOptions, F as FlatConfigItem } from '../types-
|
|
1
|
+
import { S as StylisticOptions, F as FlatConfigItem } from '../types-d6wL74Fv.js';
|
|
2
2
|
import 'eslint-config-flat-gitignore';
|
|
3
3
|
import '@typescript-eslint/parser';
|
|
4
4
|
import '@antfu/eslint-define-config';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as StylisticOptions, F as FlatConfigItem } from '../types-
|
|
1
|
+
import { S as StylisticOptions, F as FlatConfigItem } from '../types-d6wL74Fv.js';
|
|
2
2
|
import 'eslint-config-flat-gitignore';
|
|
3
3
|
import '@typescript-eslint/parser';
|
|
4
4
|
import '@antfu/eslint-define-config';
|