@luxass/eslint-config 4.0.0-beta.7 → 4.0.0-beta.9
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-P4VCNFV7.mjs → chunk-24KJPXII.mjs} +1 -1
- package/dist/{chunk-ZCBXPKVL.mjs → chunk-3QHLEAXK.mjs} +1 -1
- package/dist/chunk-AL47KNVD.mjs +37 -0
- package/dist/{chunk-AWRK5LBF.mjs → chunk-BAKUP7QM.mjs} +1 -1
- package/dist/{chunk-E75NMIPT.mjs → chunk-ERFDRAGW.mjs} +1 -1
- package/dist/{chunk-NAAUGWPQ.mjs → chunk-FK567E7G.mjs} +1 -1
- package/dist/{chunk-6B53AW4K.mjs → chunk-LQLF2CMA.mjs} +11 -6
- package/dist/{chunk-UTGBMMZF.mjs → chunk-M5WNLLBT.mjs} +1 -1
- package/dist/{chunk-QPBW5YAJ.mjs → chunk-NUG6FLHN.mjs} +1 -1
- package/dist/{chunk-AP74CKWC.mjs → chunk-O4O6V7LI.mjs} +10 -3
- package/dist/{chunk-LGVH5YDV.mjs → chunk-P3N5WLFL.mjs} +1 -1
- package/dist/{chunk-KL4WRPMJ.mjs → chunk-QZTI72NS.mjs} +8 -3
- package/dist/chunk-TQ476NL2.mjs +57 -0
- package/dist/{chunk-ODRFH37N.mjs → chunk-UBPIYSHC.mjs} +13 -6
- package/dist/configs/astro.cjs +12 -5
- package/dist/configs/astro.d.cts +1 -1
- package/dist/configs/astro.d.ts +1 -1
- package/dist/configs/astro.mjs +2 -2
- package/dist/configs/comments.d.cts +1 -1
- package/dist/configs/comments.d.ts +1 -1
- package/dist/configs/ignores.d.cts +1 -1
- package/dist/configs/ignores.d.ts +1 -1
- package/dist/configs/imports.d.cts +1 -1
- package/dist/configs/imports.d.ts +1 -1
- package/dist/configs/index.cjs +77 -18
- package/dist/configs/index.d.cts +1 -1
- package/dist/configs/index.d.ts +1 -1
- package/dist/configs/index.mjs +14 -14
- package/dist/configs/javascript.d.cts +1 -1
- package/dist/configs/javascript.d.ts +1 -1
- package/dist/configs/jsdoc.cjs +2 -0
- package/dist/configs/jsdoc.d.cts +1 -1
- package/dist/configs/jsdoc.d.ts +1 -1
- package/dist/configs/jsdoc.mjs +2 -2
- package/dist/configs/jsonc.cjs +2 -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 +2 -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 +33 -2
- 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 +38 -5
- package/dist/configs/react.d.cts +1 -1
- package/dist/configs/react.d.ts +1 -1
- 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 +2 -0
- package/dist/configs/stylistic.d.cts +1 -1
- package/dist/configs/stylistic.d.ts +1 -1
- package/dist/configs/stylistic.mjs +2 -2
- package/dist/configs/tailwindcss.cjs +35 -2
- package/dist/configs/tailwindcss.d.cts +2 -2
- package/dist/configs/tailwindcss.d.ts +2 -2
- package/dist/configs/tailwindcss.mjs +2 -2
- package/dist/configs/test.cjs +2 -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 +4 -2
- 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.cjs +46 -2
- package/dist/configs/unocss.d.cts +2 -2
- package/dist/configs/unocss.d.ts +2 -2
- package/dist/configs/unocss.mjs +3 -2
- package/dist/configs/vue.cjs +2 -0
- 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 +2 -0
- 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 +95 -31
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +25 -20
- package/dist/{types-d6wL74Fv.d.ts → types-h9izbkUX.d.cts} +14 -8
- package/dist/{types-d6wL74Fv.d.cts → types-h9izbkUX.d.ts} +14 -8
- package/package.json +10 -11
- package/dist/chunk-4VUK6ART.mjs +0 -29
- package/dist/chunk-SLYFE6WI.mjs +0 -23
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GLOB_SRC
|
|
3
|
+
} from "./chunk-R4NSLRAE.mjs";
|
|
4
|
+
import {
|
|
5
|
+
interop
|
|
6
|
+
} from "./chunk-TQ476NL2.mjs";
|
|
7
|
+
|
|
8
|
+
// src/configs/unocss.ts
|
|
9
|
+
async function unocss(options) {
|
|
10
|
+
const pluginUnoCSS = await interop(import("@unocss/eslint-plugin"));
|
|
11
|
+
const {
|
|
12
|
+
attributify = false,
|
|
13
|
+
overrides = {}
|
|
14
|
+
} = options;
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
files: [
|
|
18
|
+
GLOB_SRC
|
|
19
|
+
],
|
|
20
|
+
name: "luxass:unocss",
|
|
21
|
+
plugins: {
|
|
22
|
+
"@unocss": pluginUnoCSS
|
|
23
|
+
},
|
|
24
|
+
rules: {
|
|
25
|
+
"unocss/order": "error",
|
|
26
|
+
...attributify && { "unocss/attributify": "error" },
|
|
27
|
+
"unocss/blocklist": "error",
|
|
28
|
+
// overrides
|
|
29
|
+
...overrides
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
unocss
|
|
37
|
+
};
|
|
@@ -3,10 +3,20 @@ import {
|
|
|
3
3
|
} from "./chunk-R4NSLRAE.mjs";
|
|
4
4
|
import {
|
|
5
5
|
interop
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TQ476NL2.mjs";
|
|
7
7
|
|
|
8
8
|
// src/configs/astro.ts
|
|
9
9
|
async function astro(options) {
|
|
10
|
+
const {
|
|
11
|
+
a11y = false,
|
|
12
|
+
overrides = {}
|
|
13
|
+
// typescript = true,
|
|
14
|
+
} = options;
|
|
15
|
+
await interop([
|
|
16
|
+
"eslint-plugin-astro",
|
|
17
|
+
"astro-eslint-parser",
|
|
18
|
+
...options.a11y ? ["eslint-plugin-jsx-a11y"] : []
|
|
19
|
+
]);
|
|
10
20
|
const [
|
|
11
21
|
pluginAstro,
|
|
12
22
|
parserAstro,
|
|
@@ -16,11 +26,6 @@ async function astro(options) {
|
|
|
16
26
|
interop(import("astro-eslint-parser")),
|
|
17
27
|
...options.a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
|
|
18
28
|
]);
|
|
19
|
-
const {
|
|
20
|
-
a11y = false,
|
|
21
|
-
overrides = {}
|
|
22
|
-
// typescript = true,
|
|
23
|
-
} = options;
|
|
24
29
|
return [
|
|
25
30
|
{
|
|
26
31
|
name: "luxass:astro:setup",
|
|
@@ -3,21 +3,26 @@ import {
|
|
|
3
3
|
GLOB_SRC
|
|
4
4
|
} from "./chunk-R4NSLRAE.mjs";
|
|
5
5
|
import {
|
|
6
|
+
ensure,
|
|
6
7
|
interop
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TQ476NL2.mjs";
|
|
8
9
|
|
|
9
10
|
// src/configs/tailwindcss.ts
|
|
10
11
|
var DEFAULT_TAILWIND_CALLEES = ["classnames", "clsx", "cx", "cn"];
|
|
11
12
|
var DEFAULT_CLASS_REGEX = "^class(Name)?$";
|
|
12
13
|
async function tailwindcss(options = {}) {
|
|
13
|
-
const pluginTailwindCSS = await interop(import("eslint-plugin-tailwindcss"));
|
|
14
14
|
const {
|
|
15
15
|
callees = DEFAULT_TAILWIND_CALLEES,
|
|
16
16
|
classRegex = DEFAULT_CLASS_REGEX,
|
|
17
17
|
config = void 0,
|
|
18
18
|
nextjs,
|
|
19
|
+
overrides,
|
|
19
20
|
removeDuplicates = true
|
|
20
21
|
} = options;
|
|
22
|
+
await ensure([
|
|
23
|
+
"eslint-plugin-tailwindcss"
|
|
24
|
+
]);
|
|
25
|
+
const pluginTailwindCSS = await interop(import("eslint-plugin-tailwindcss"));
|
|
21
26
|
const tailwindCSSCallee = callees ?? DEFAULT_TAILWIND_CALLEES;
|
|
22
27
|
return [
|
|
23
28
|
{
|
|
@@ -36,7 +41,9 @@ async function tailwindcss(options = {}) {
|
|
|
36
41
|
"tailwindcss/migration-from-tailwind-2": ["warn"],
|
|
37
42
|
"tailwindcss/no-arbitrary-value": ["off"],
|
|
38
43
|
"tailwindcss/no-contradicting-classname": ["error"],
|
|
39
|
-
"tailwindcss/no-custom-classname": ["warn"]
|
|
44
|
+
"tailwindcss/no-custom-classname": ["warn"],
|
|
45
|
+
// overrides
|
|
46
|
+
...overrides
|
|
40
47
|
},
|
|
41
48
|
settings: {
|
|
42
49
|
tailwindcss: {
|
|
@@ -4,13 +4,17 @@ import {
|
|
|
4
4
|
GLOB_SRC
|
|
5
5
|
} from "./chunk-R4NSLRAE.mjs";
|
|
6
6
|
import {
|
|
7
|
+
ensure,
|
|
7
8
|
interop
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TQ476NL2.mjs";
|
|
9
10
|
|
|
10
11
|
// src/configs/nextjs.ts
|
|
11
12
|
async function nextjs(options = {}) {
|
|
12
|
-
const pluginNextjs = await interop(import("@next/eslint-plugin-next"));
|
|
13
13
|
const { overrides, rootDir } = options;
|
|
14
|
+
await ensure([
|
|
15
|
+
"@next/eslint-plugin-next"
|
|
16
|
+
]);
|
|
17
|
+
const pluginNextjs = await interop(import("@next/eslint-plugin-next"));
|
|
14
18
|
return [
|
|
15
19
|
{
|
|
16
20
|
name: "luxass:nextjs:setup",
|
|
@@ -62,7 +66,8 @@ async function nextjs(options = {}) {
|
|
|
62
66
|
files: GLOB_NEXTJS_ROUTES,
|
|
63
67
|
name: "luxass:nextjs:default-export-override",
|
|
64
68
|
rules: {
|
|
65
|
-
"import/prefer-default-export": "error"
|
|
69
|
+
"import/prefer-default-export": "error",
|
|
70
|
+
"react-refresh/only-export-components": "off"
|
|
66
71
|
}
|
|
67
72
|
},
|
|
68
73
|
{
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/utils.ts
|
|
2
|
+
import process from "node:process";
|
|
3
|
+
import { isPackageExists } from "local-pkg";
|
|
4
|
+
async function combine(...configs) {
|
|
5
|
+
const resolved = await Promise.all(configs);
|
|
6
|
+
return resolved.flat();
|
|
7
|
+
}
|
|
8
|
+
function renameRules(rules, from, to) {
|
|
9
|
+
return Object.fromEntries(
|
|
10
|
+
Object.entries(rules).map(([key, value]) => {
|
|
11
|
+
if (key.startsWith(from)) {
|
|
12
|
+
return [to + key.slice(from.length), value];
|
|
13
|
+
}
|
|
14
|
+
return [key, value];
|
|
15
|
+
})
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function toArray(value) {
|
|
19
|
+
return Array.isArray(value) ? value : [value];
|
|
20
|
+
}
|
|
21
|
+
async function interop(m) {
|
|
22
|
+
const resolved = await m;
|
|
23
|
+
return resolved.default || resolved;
|
|
24
|
+
}
|
|
25
|
+
async function ensure(packages) {
|
|
26
|
+
if (process.env.CI || process.stdout.isTTY === false) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
;
|
|
30
|
+
const nonExistingPackages = packages.filter((i) => !isPackageExists(i));
|
|
31
|
+
if (nonExistingPackages.length === 0) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
;
|
|
35
|
+
const { default: prompts } = await import("prompts");
|
|
36
|
+
const { result } = await prompts([
|
|
37
|
+
{
|
|
38
|
+
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`,
|
|
39
|
+
name: "result",
|
|
40
|
+
type: "confirm"
|
|
41
|
+
}
|
|
42
|
+
]);
|
|
43
|
+
if (result) {
|
|
44
|
+
await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, {
|
|
45
|
+
dev: true
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
combine,
|
|
53
|
+
renameRules,
|
|
54
|
+
toArray,
|
|
55
|
+
interop,
|
|
56
|
+
ensure
|
|
57
|
+
};
|
|
@@ -2,11 +2,23 @@ import {
|
|
|
2
2
|
GLOB_JSX
|
|
3
3
|
} from "./chunk-R4NSLRAE.mjs";
|
|
4
4
|
import {
|
|
5
|
+
ensure,
|
|
5
6
|
interop
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TQ476NL2.mjs";
|
|
7
8
|
|
|
8
9
|
// src/configs/react.ts
|
|
9
10
|
async function react(options) {
|
|
11
|
+
const {
|
|
12
|
+
a11y = false,
|
|
13
|
+
overrides = {},
|
|
14
|
+
typescript = true
|
|
15
|
+
} = options;
|
|
16
|
+
await ensure([
|
|
17
|
+
"eslint-plugin-react",
|
|
18
|
+
"eslint-plugin-react-hooks",
|
|
19
|
+
"eslint-plugin-react-refresh",
|
|
20
|
+
...options.a11y ? ["eslint-plugin-jsx-a11y"] : []
|
|
21
|
+
]);
|
|
10
22
|
const [
|
|
11
23
|
pluginReact,
|
|
12
24
|
pluginReactHooks,
|
|
@@ -18,11 +30,6 @@ async function react(options) {
|
|
|
18
30
|
interop(import("eslint-plugin-react-refresh")),
|
|
19
31
|
...options.a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
|
|
20
32
|
]);
|
|
21
|
-
const {
|
|
22
|
-
a11y = false,
|
|
23
|
-
overrides = {},
|
|
24
|
-
typescript = true
|
|
25
|
-
} = options;
|
|
26
33
|
return [
|
|
27
34
|
{
|
|
28
35
|
name: "luxass:react:setup",
|
package/dist/configs/astro.cjs
CHANGED
|
@@ -67,6 +67,8 @@ var GLOB_NEXTJS_ROUTES = [
|
|
|
67
67
|
];
|
|
68
68
|
|
|
69
69
|
// src/utils.ts
|
|
70
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
71
|
+
var import_local_pkg = require("local-pkg");
|
|
70
72
|
async function interop(m) {
|
|
71
73
|
const resolved = await m;
|
|
72
74
|
return resolved.default || resolved;
|
|
@@ -74,6 +76,16 @@ async function interop(m) {
|
|
|
74
76
|
|
|
75
77
|
// src/configs/astro.ts
|
|
76
78
|
async function astro(options) {
|
|
79
|
+
const {
|
|
80
|
+
a11y = false,
|
|
81
|
+
overrides = {}
|
|
82
|
+
// typescript = true,
|
|
83
|
+
} = options;
|
|
84
|
+
await interop([
|
|
85
|
+
"eslint-plugin-astro",
|
|
86
|
+
"astro-eslint-parser",
|
|
87
|
+
...options.a11y ? ["eslint-plugin-jsx-a11y"] : []
|
|
88
|
+
]);
|
|
77
89
|
const [
|
|
78
90
|
pluginAstro,
|
|
79
91
|
parserAstro,
|
|
@@ -83,11 +95,6 @@ async function astro(options) {
|
|
|
83
95
|
interop(import("astro-eslint-parser")),
|
|
84
96
|
...options.a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
|
|
85
97
|
]);
|
|
86
|
-
const {
|
|
87
|
-
a11y = false,
|
|
88
|
-
overrides = {}
|
|
89
|
-
// typescript = true,
|
|
90
|
-
} = options;
|
|
91
98
|
return [
|
|
92
99
|
{
|
|
93
100
|
name: "luxass:astro:setup",
|
package/dist/configs/astro.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ConfigurationOptions, O as OverrideOptions, R as ReactOptions, F as FlatConfigItem } from '../types-
|
|
1
|
+
import { C as ConfigurationOptions, O as OverrideOptions, R as ReactOptions, F as FlatConfigItem } from '../types-h9izbkUX.cjs';
|
|
2
2
|
import 'eslint-config-flat-gitignore';
|
|
3
3
|
import '@typescript-eslint/parser';
|
|
4
4
|
import '@antfu/eslint-define-config';
|
package/dist/configs/astro.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ConfigurationOptions, O as OverrideOptions, R as ReactOptions, F as FlatConfigItem } from '../types-
|
|
1
|
+
import { C as ConfigurationOptions, O as OverrideOptions, R as ReactOptions, F as FlatConfigItem } from '../types-h9izbkUX.js';
|
|
2
2
|
import 'eslint-config-flat-gitignore';
|
|
3
3
|
import '@typescript-eslint/parser';
|
|
4
4
|
import '@antfu/eslint-define-config';
|
package/dist/configs/astro.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-h9izbkUX.cjs';
|
|
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-h9izbkUX.js';
|
|
2
2
|
import 'eslint-config-flat-gitignore';
|
|
3
3
|
import '@typescript-eslint/parser';
|
|
4
4
|
import '@antfu/eslint-define-config';
|
package/dist/configs/index.cjs
CHANGED
|
@@ -449,6 +449,8 @@ async function javascript(options = {}) {
|
|
|
449
449
|
}
|
|
450
450
|
|
|
451
451
|
// src/utils.ts
|
|
452
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
453
|
+
var import_local_pkg = require("local-pkg");
|
|
452
454
|
function renameRules(rules, from, to) {
|
|
453
455
|
return Object.fromEntries(
|
|
454
456
|
Object.entries(rules).map(([key, value]) => {
|
|
@@ -466,6 +468,31 @@ async function interop(m) {
|
|
|
466
468
|
const resolved = await m;
|
|
467
469
|
return resolved.default || resolved;
|
|
468
470
|
}
|
|
471
|
+
async function ensure(packages) {
|
|
472
|
+
if (import_node_process.default.env.CI || import_node_process.default.stdout.isTTY === false) {
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
;
|
|
476
|
+
const nonExistingPackages = packages.filter((i) => !(0, import_local_pkg.isPackageExists)(i));
|
|
477
|
+
if (nonExistingPackages.length === 0) {
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
;
|
|
481
|
+
const { default: prompts } = await import("prompts");
|
|
482
|
+
const { result } = await prompts([
|
|
483
|
+
{
|
|
484
|
+
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`,
|
|
485
|
+
name: "result",
|
|
486
|
+
type: "confirm"
|
|
487
|
+
}
|
|
488
|
+
]);
|
|
489
|
+
if (result) {
|
|
490
|
+
await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, {
|
|
491
|
+
dev: true
|
|
492
|
+
}));
|
|
493
|
+
}
|
|
494
|
+
;
|
|
495
|
+
}
|
|
469
496
|
|
|
470
497
|
// src/configs/jsdoc.ts
|
|
471
498
|
async function jsdoc(options = {}) {
|
|
@@ -920,7 +947,7 @@ async function stylistic(options = {}) {
|
|
|
920
947
|
}
|
|
921
948
|
|
|
922
949
|
// src/configs/typescript.ts
|
|
923
|
-
var
|
|
950
|
+
var import_node_process2 = __toESM(require("process"), 1);
|
|
924
951
|
async function typescript(options) {
|
|
925
952
|
const {
|
|
926
953
|
componentExts = [],
|
|
@@ -974,7 +1001,7 @@ async function typescript(options) {
|
|
|
974
1001
|
sourceType: "module",
|
|
975
1002
|
...tsconfigPath ? {
|
|
976
1003
|
project: tsconfigPath,
|
|
977
|
-
tsconfigRootDir:
|
|
1004
|
+
tsconfigRootDir: import_node_process2.default.cwd()
|
|
978
1005
|
} : {},
|
|
979
1006
|
...parserOptions
|
|
980
1007
|
}
|
|
@@ -1412,16 +1439,27 @@ async function perfectionist(options = {}) {
|
|
|
1412
1439
|
}
|
|
1413
1440
|
|
|
1414
1441
|
// src/configs/unocss.ts
|
|
1415
|
-
async function unocss() {
|
|
1442
|
+
async function unocss(options) {
|
|
1416
1443
|
const pluginUnoCSS = await interop(import("@unocss/eslint-plugin"));
|
|
1444
|
+
const {
|
|
1445
|
+
attributify = false,
|
|
1446
|
+
overrides = {}
|
|
1447
|
+
} = options;
|
|
1417
1448
|
return [
|
|
1418
1449
|
{
|
|
1450
|
+
files: [
|
|
1451
|
+
GLOB_SRC
|
|
1452
|
+
],
|
|
1419
1453
|
name: "luxass:unocss",
|
|
1420
1454
|
plugins: {
|
|
1421
1455
|
"@unocss": pluginUnoCSS
|
|
1422
1456
|
},
|
|
1423
1457
|
rules: {
|
|
1424
|
-
|
|
1458
|
+
"unocss/order": "error",
|
|
1459
|
+
...attributify && { "unocss/attributify": "error" },
|
|
1460
|
+
"unocss/blocklist": "error",
|
|
1461
|
+
// overrides
|
|
1462
|
+
...overrides
|
|
1425
1463
|
}
|
|
1426
1464
|
}
|
|
1427
1465
|
];
|
|
@@ -1431,14 +1469,18 @@ async function unocss() {
|
|
|
1431
1469
|
var DEFAULT_TAILWIND_CALLEES = ["classnames", "clsx", "cx", "cn"];
|
|
1432
1470
|
var DEFAULT_CLASS_REGEX = "^class(Name)?$";
|
|
1433
1471
|
async function tailwindcss(options = {}) {
|
|
1434
|
-
const pluginTailwindCSS = await interop(import("eslint-plugin-tailwindcss"));
|
|
1435
1472
|
const {
|
|
1436
1473
|
callees = DEFAULT_TAILWIND_CALLEES,
|
|
1437
1474
|
classRegex = DEFAULT_CLASS_REGEX,
|
|
1438
1475
|
config = void 0,
|
|
1439
1476
|
nextjs: nextjs2,
|
|
1477
|
+
overrides,
|
|
1440
1478
|
removeDuplicates = true
|
|
1441
1479
|
} = options;
|
|
1480
|
+
await ensure([
|
|
1481
|
+
"eslint-plugin-tailwindcss"
|
|
1482
|
+
]);
|
|
1483
|
+
const pluginTailwindCSS = await interop(import("eslint-plugin-tailwindcss"));
|
|
1442
1484
|
const tailwindCSSCallee = callees ?? DEFAULT_TAILWIND_CALLEES;
|
|
1443
1485
|
return [
|
|
1444
1486
|
{
|
|
@@ -1457,7 +1499,9 @@ async function tailwindcss(options = {}) {
|
|
|
1457
1499
|
"tailwindcss/migration-from-tailwind-2": ["warn"],
|
|
1458
1500
|
"tailwindcss/no-arbitrary-value": ["off"],
|
|
1459
1501
|
"tailwindcss/no-contradicting-classname": ["error"],
|
|
1460
|
-
"tailwindcss/no-custom-classname": ["warn"]
|
|
1502
|
+
"tailwindcss/no-custom-classname": ["warn"],
|
|
1503
|
+
// overrides
|
|
1504
|
+
...overrides
|
|
1461
1505
|
},
|
|
1462
1506
|
settings: {
|
|
1463
1507
|
tailwindcss: {
|
|
@@ -1481,8 +1525,11 @@ async function tailwindcss(options = {}) {
|
|
|
1481
1525
|
|
|
1482
1526
|
// src/configs/nextjs.ts
|
|
1483
1527
|
async function nextjs(options = {}) {
|
|
1484
|
-
const pluginNextjs = await interop(import("@next/eslint-plugin-next"));
|
|
1485
1528
|
const { overrides, rootDir } = options;
|
|
1529
|
+
await ensure([
|
|
1530
|
+
"@next/eslint-plugin-next"
|
|
1531
|
+
]);
|
|
1532
|
+
const pluginNextjs = await interop(import("@next/eslint-plugin-next"));
|
|
1486
1533
|
return [
|
|
1487
1534
|
{
|
|
1488
1535
|
name: "luxass:nextjs:setup",
|
|
@@ -1534,7 +1581,8 @@ async function nextjs(options = {}) {
|
|
|
1534
1581
|
files: GLOB_NEXTJS_ROUTES,
|
|
1535
1582
|
name: "luxass:nextjs:default-export-override",
|
|
1536
1583
|
rules: {
|
|
1537
|
-
"import/prefer-default-export": "error"
|
|
1584
|
+
"import/prefer-default-export": "error",
|
|
1585
|
+
"react-refresh/only-export-components": "off"
|
|
1538
1586
|
}
|
|
1539
1587
|
},
|
|
1540
1588
|
{
|
|
@@ -1552,6 +1600,17 @@ async function nextjs(options = {}) {
|
|
|
1552
1600
|
|
|
1553
1601
|
// src/configs/react.ts
|
|
1554
1602
|
async function react(options) {
|
|
1603
|
+
const {
|
|
1604
|
+
a11y = false,
|
|
1605
|
+
overrides = {},
|
|
1606
|
+
typescript: typescript2 = true
|
|
1607
|
+
} = options;
|
|
1608
|
+
await ensure([
|
|
1609
|
+
"eslint-plugin-react",
|
|
1610
|
+
"eslint-plugin-react-hooks",
|
|
1611
|
+
"eslint-plugin-react-refresh",
|
|
1612
|
+
...options.a11y ? ["eslint-plugin-jsx-a11y"] : []
|
|
1613
|
+
]);
|
|
1555
1614
|
const [
|
|
1556
1615
|
pluginReact,
|
|
1557
1616
|
pluginReactHooks,
|
|
@@ -1563,11 +1622,6 @@ async function react(options) {
|
|
|
1563
1622
|
interop(import("eslint-plugin-react-refresh")),
|
|
1564
1623
|
...options.a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
|
|
1565
1624
|
]);
|
|
1566
|
-
const {
|
|
1567
|
-
a11y = false,
|
|
1568
|
-
overrides = {},
|
|
1569
|
-
typescript: typescript2 = true
|
|
1570
|
-
} = options;
|
|
1571
1625
|
return [
|
|
1572
1626
|
{
|
|
1573
1627
|
name: "luxass:react:setup",
|
|
@@ -1819,6 +1873,16 @@ async function react(options) {
|
|
|
1819
1873
|
|
|
1820
1874
|
// src/configs/astro.ts
|
|
1821
1875
|
async function astro(options) {
|
|
1876
|
+
const {
|
|
1877
|
+
a11y = false,
|
|
1878
|
+
overrides = {}
|
|
1879
|
+
// typescript = true,
|
|
1880
|
+
} = options;
|
|
1881
|
+
await interop([
|
|
1882
|
+
"eslint-plugin-astro",
|
|
1883
|
+
"astro-eslint-parser",
|
|
1884
|
+
...options.a11y ? ["eslint-plugin-jsx-a11y"] : []
|
|
1885
|
+
]);
|
|
1822
1886
|
const [
|
|
1823
1887
|
pluginAstro,
|
|
1824
1888
|
parserAstro,
|
|
@@ -1828,11 +1892,6 @@ async function astro(options) {
|
|
|
1828
1892
|
interop(import("astro-eslint-parser")),
|
|
1829
1893
|
...options.a11y ? [interop(import("eslint-plugin-jsx-a11y"))] : []
|
|
1830
1894
|
]);
|
|
1831
|
-
const {
|
|
1832
|
-
a11y = false,
|
|
1833
|
-
overrides = {}
|
|
1834
|
-
// typescript = true,
|
|
1835
|
-
} = options;
|
|
1836
1895
|
return [
|
|
1837
1896
|
{
|
|
1838
1897
|
name: "luxass:astro:setup",
|
package/dist/configs/index.d.cts
CHANGED
|
@@ -19,7 +19,7 @@ export { tailwindcss } from './tailwindcss.cjs';
|
|
|
19
19
|
export { nextjs } from './nextjs.cjs';
|
|
20
20
|
export { react } from './react.cjs';
|
|
21
21
|
export { astro } from './astro.cjs';
|
|
22
|
-
import '../types-
|
|
22
|
+
import '../types-h9izbkUX.cjs';
|
|
23
23
|
import 'eslint-config-flat-gitignore';
|
|
24
24
|
import '@typescript-eslint/parser';
|
|
25
25
|
import '@antfu/eslint-define-config';
|
package/dist/configs/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export { tailwindcss } from './tailwindcss.js';
|
|
|
19
19
|
export { nextjs } from './nextjs.js';
|
|
20
20
|
export { react } from './react.js';
|
|
21
21
|
export { astro } from './astro.js';
|
|
22
|
-
import '../types-
|
|
22
|
+
import '../types-h9izbkUX.js';
|
|
23
23
|
import 'eslint-config-flat-gitignore';
|
|
24
24
|
import '@typescript-eslint/parser';
|
|
25
25
|
import '@antfu/eslint-define-config';
|