@luxass/eslint-config 4.5.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +119 -321
- package/dist/index.d.cts +25 -704
- package/dist/index.d.ts +25 -704
- package/dist/index.js +118 -319
- package/package.json +14 -30
package/dist/index.cjs
CHANGED
|
@@ -71,6 +71,7 @@ __export(src_exports, {
|
|
|
71
71
|
javascript: () => javascript,
|
|
72
72
|
jsdoc: () => jsdoc,
|
|
73
73
|
jsonc: () => jsonc,
|
|
74
|
+
jsx: () => jsx,
|
|
74
75
|
luxass: () => luxass,
|
|
75
76
|
markdown: () => markdown,
|
|
76
77
|
node: () => node,
|
|
@@ -79,11 +80,9 @@ __export(src_exports, {
|
|
|
79
80
|
regexp: () => regexp,
|
|
80
81
|
renameRules: () => renameRules,
|
|
81
82
|
resolveSubOptions: () => resolveSubOptions,
|
|
82
|
-
solid: () => solid,
|
|
83
83
|
sortPackageJson: () => sortPackageJson,
|
|
84
84
|
sortTsconfig: () => sortTsconfig,
|
|
85
85
|
stylistic: () => stylistic,
|
|
86
|
-
svelte: () => svelte,
|
|
87
86
|
tailwindcss: () => tailwindcss,
|
|
88
87
|
test: () => test,
|
|
89
88
|
toArray: () => toArray,
|
|
@@ -522,172 +521,6 @@ function sortTsconfig() {
|
|
|
522
521
|
];
|
|
523
522
|
}
|
|
524
523
|
|
|
525
|
-
// src/utils.ts
|
|
526
|
-
var import_node_process = __toESM(require("process"), 1);
|
|
527
|
-
var import_local_pkg = require("local-pkg");
|
|
528
|
-
var parserPlain = {
|
|
529
|
-
meta: {
|
|
530
|
-
name: "parser-plain"
|
|
531
|
-
},
|
|
532
|
-
parseForESLint: (code) => ({
|
|
533
|
-
ast: {
|
|
534
|
-
body: [],
|
|
535
|
-
comments: [],
|
|
536
|
-
loc: { end: code.length, start: 0 },
|
|
537
|
-
range: [0, code.length],
|
|
538
|
-
tokens: [],
|
|
539
|
-
type: "Program"
|
|
540
|
-
},
|
|
541
|
-
scopeManager: null,
|
|
542
|
-
services: { isPlain: true },
|
|
543
|
-
visitorKeys: {
|
|
544
|
-
Program: []
|
|
545
|
-
}
|
|
546
|
-
})
|
|
547
|
-
};
|
|
548
|
-
async function combine(...configs2) {
|
|
549
|
-
const resolved = await Promise.all(configs2);
|
|
550
|
-
return resolved.flat();
|
|
551
|
-
}
|
|
552
|
-
function renameRules(rules, from, to) {
|
|
553
|
-
return Object.fromEntries(
|
|
554
|
-
Object.entries(rules).map(([key, value]) => {
|
|
555
|
-
if (key.startsWith(from)) {
|
|
556
|
-
return [to + key.slice(from.length), value];
|
|
557
|
-
}
|
|
558
|
-
return [key, value];
|
|
559
|
-
})
|
|
560
|
-
);
|
|
561
|
-
}
|
|
562
|
-
function toArray(value) {
|
|
563
|
-
return Array.isArray(value) ? value : [value];
|
|
564
|
-
}
|
|
565
|
-
async function interop(m) {
|
|
566
|
-
const resolved = await m;
|
|
567
|
-
return resolved.default || resolved;
|
|
568
|
-
}
|
|
569
|
-
async function ensure(packages) {
|
|
570
|
-
if (import_node_process.default.env.CI || import_node_process.default.stdout.isTTY === false) {
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
|
-
;
|
|
574
|
-
const nonExistingPackages = packages.filter((i) => i && !(0, import_local_pkg.isPackageExists)(i));
|
|
575
|
-
if (nonExistingPackages.length === 0) {
|
|
576
|
-
return;
|
|
577
|
-
}
|
|
578
|
-
const p = await import("@clack/prompts");
|
|
579
|
-
const result = await p.confirm({
|
|
580
|
-
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
|
|
581
|
-
});
|
|
582
|
-
if (result) {
|
|
583
|
-
await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
function resolveSubOptions(options, key) {
|
|
587
|
-
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
588
|
-
}
|
|
589
|
-
function getOverrides(options, key) {
|
|
590
|
-
const sub = resolveSubOptions(options, key);
|
|
591
|
-
return {
|
|
592
|
-
..."overrides" in sub ? sub.overrides : {}
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
// src/configs/svelte.ts
|
|
597
|
-
async function svelte(options = {}) {
|
|
598
|
-
const {
|
|
599
|
-
files = [GLOB_SVELTE],
|
|
600
|
-
overrides = {},
|
|
601
|
-
stylistic: stylistic2 = true
|
|
602
|
-
} = options;
|
|
603
|
-
const {
|
|
604
|
-
indent = 2,
|
|
605
|
-
quotes = "single"
|
|
606
|
-
} = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
607
|
-
await ensure([
|
|
608
|
-
"eslint-plugin-svelte"
|
|
609
|
-
]);
|
|
610
|
-
const [
|
|
611
|
-
pluginSvelte,
|
|
612
|
-
parserSvelte
|
|
613
|
-
] = await Promise.all([
|
|
614
|
-
interop(import("eslint-plugin-svelte")),
|
|
615
|
-
interop(import("svelte-eslint-parser"))
|
|
616
|
-
]);
|
|
617
|
-
return [
|
|
618
|
-
{
|
|
619
|
-
name: "antfu/svelte/setup",
|
|
620
|
-
plugins: {
|
|
621
|
-
svelte: pluginSvelte
|
|
622
|
-
}
|
|
623
|
-
},
|
|
624
|
-
{
|
|
625
|
-
files,
|
|
626
|
-
languageOptions: {
|
|
627
|
-
parser: parserSvelte,
|
|
628
|
-
parserOptions: {
|
|
629
|
-
extraFileExtensions: [".svelte"],
|
|
630
|
-
parser: options.typescript ? await interop(import("@typescript-eslint/parser")) : null
|
|
631
|
-
}
|
|
632
|
-
},
|
|
633
|
-
name: "antfu/svelte/rules",
|
|
634
|
-
processor: pluginSvelte.processors[".svelte"],
|
|
635
|
-
rules: {
|
|
636
|
-
"import/no-mutable-exports": "off",
|
|
637
|
-
"no-undef": "off",
|
|
638
|
-
// incompatible with most recent (attribute-form) generic types RFC
|
|
639
|
-
"no-unused-vars": ["error", {
|
|
640
|
-
args: "none",
|
|
641
|
-
caughtErrors: "none",
|
|
642
|
-
ignoreRestSiblings: true,
|
|
643
|
-
vars: "all",
|
|
644
|
-
varsIgnorePattern: "^(\\$\\$Props$|\\$\\$Events$|\\$\\$Slots$)"
|
|
645
|
-
}],
|
|
646
|
-
"svelte/comment-directive": "error",
|
|
647
|
-
"svelte/no-at-debug-tags": "warn",
|
|
648
|
-
"svelte/no-at-html-tags": "error",
|
|
649
|
-
"svelte/no-dupe-else-if-blocks": "error",
|
|
650
|
-
"svelte/no-dupe-style-properties": "error",
|
|
651
|
-
"svelte/no-dupe-use-directives": "error",
|
|
652
|
-
"svelte/no-dynamic-slot-name": "error",
|
|
653
|
-
"svelte/no-export-load-in-svelte-module-in-kit-pages": "error",
|
|
654
|
-
"svelte/no-inner-declarations": "error",
|
|
655
|
-
"svelte/no-not-function-handler": "error",
|
|
656
|
-
"svelte/no-object-in-text-mustaches": "error",
|
|
657
|
-
"svelte/no-reactive-functions": "error",
|
|
658
|
-
"svelte/no-reactive-literals": "error",
|
|
659
|
-
"svelte/no-shorthand-style-property-overrides": "error",
|
|
660
|
-
"svelte/no-unknown-style-directive-property": "error",
|
|
661
|
-
"svelte/no-unused-svelte-ignore": "error",
|
|
662
|
-
"svelte/no-useless-mustaches": "error",
|
|
663
|
-
"svelte/require-store-callbacks-use-set-param": "error",
|
|
664
|
-
"svelte/system": "error",
|
|
665
|
-
"svelte/valid-compile": "error",
|
|
666
|
-
"svelte/valid-each-key": "error",
|
|
667
|
-
"unused-imports/no-unused-vars": [
|
|
668
|
-
"error",
|
|
669
|
-
{ args: "after-used", argsIgnorePattern: "^_", vars: "all", varsIgnorePattern: "^(_|\\$\\$Props$|\\$\\$Events$|\\$\\$Slots$)" }
|
|
670
|
-
],
|
|
671
|
-
...stylistic2 ? {
|
|
672
|
-
"style/indent": "off",
|
|
673
|
-
// superseded by svelte/indent
|
|
674
|
-
"style/no-trailing-spaces": "off",
|
|
675
|
-
// superseded by svelte/no-trailing-spaces
|
|
676
|
-
"svelte/derived-has-same-inputs-outputs": "error",
|
|
677
|
-
"svelte/html-closing-bracket-spacing": "error",
|
|
678
|
-
"svelte/html-quotes": ["error", { prefer: quotes }],
|
|
679
|
-
"svelte/indent": ["error", { alignAttributesVertically: true, indent }],
|
|
680
|
-
"svelte/mustache-spacing": "error",
|
|
681
|
-
"svelte/no-spaces-around-equal-signs-in-attribute": "error",
|
|
682
|
-
"svelte/no-trailing-spaces": "error",
|
|
683
|
-
"svelte/spaced-html-comment": "error"
|
|
684
|
-
} : {},
|
|
685
|
-
...overrides
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
];
|
|
689
|
-
}
|
|
690
|
-
|
|
691
524
|
// src/configs/imports.ts
|
|
692
525
|
var import_eslint_plugin_import_x = __toESM(require("eslint-plugin-import-x"), 1);
|
|
693
526
|
var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
|
|
@@ -987,6 +820,77 @@ async function javascript(options = {}) {
|
|
|
987
820
|
];
|
|
988
821
|
}
|
|
989
822
|
|
|
823
|
+
// src/utils.ts
|
|
824
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
825
|
+
var import_local_pkg = require("local-pkg");
|
|
826
|
+
var parserPlain = {
|
|
827
|
+
meta: {
|
|
828
|
+
name: "parser-plain"
|
|
829
|
+
},
|
|
830
|
+
parseForESLint: (code) => ({
|
|
831
|
+
ast: {
|
|
832
|
+
body: [],
|
|
833
|
+
comments: [],
|
|
834
|
+
loc: { end: code.length, start: 0 },
|
|
835
|
+
range: [0, code.length],
|
|
836
|
+
tokens: [],
|
|
837
|
+
type: "Program"
|
|
838
|
+
},
|
|
839
|
+
scopeManager: null,
|
|
840
|
+
services: { isPlain: true },
|
|
841
|
+
visitorKeys: {
|
|
842
|
+
Program: []
|
|
843
|
+
}
|
|
844
|
+
})
|
|
845
|
+
};
|
|
846
|
+
async function combine(...configs2) {
|
|
847
|
+
const resolved = await Promise.all(configs2);
|
|
848
|
+
return resolved.flat();
|
|
849
|
+
}
|
|
850
|
+
function renameRules(rules, from, to) {
|
|
851
|
+
return Object.fromEntries(
|
|
852
|
+
Object.entries(rules).map(([key, value]) => {
|
|
853
|
+
if (key.startsWith(from)) {
|
|
854
|
+
return [to + key.slice(from.length), value];
|
|
855
|
+
}
|
|
856
|
+
return [key, value];
|
|
857
|
+
})
|
|
858
|
+
);
|
|
859
|
+
}
|
|
860
|
+
function toArray(value) {
|
|
861
|
+
return Array.isArray(value) ? value : [value];
|
|
862
|
+
}
|
|
863
|
+
async function interop(m) {
|
|
864
|
+
const resolved = await m;
|
|
865
|
+
return resolved.default || resolved;
|
|
866
|
+
}
|
|
867
|
+
async function ensure(packages) {
|
|
868
|
+
if (import_node_process.default.env.CI || import_node_process.default.stdout.isTTY === false) {
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
871
|
+
;
|
|
872
|
+
const nonExistingPackages = packages.filter((i) => i && !(0, import_local_pkg.isPackageExists)(i));
|
|
873
|
+
if (nonExistingPackages.length === 0) {
|
|
874
|
+
return;
|
|
875
|
+
}
|
|
876
|
+
const p = await import("@clack/prompts");
|
|
877
|
+
const result = await p.confirm({
|
|
878
|
+
message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`
|
|
879
|
+
});
|
|
880
|
+
if (result) {
|
|
881
|
+
await import("@antfu/install-pkg").then((i) => i.installPackage(nonExistingPackages, { dev: true }));
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
function resolveSubOptions(options, key) {
|
|
885
|
+
return typeof options[key] === "boolean" ? {} : options[key] || {};
|
|
886
|
+
}
|
|
887
|
+
function getOverrides(options, key) {
|
|
888
|
+
const sub = resolveSubOptions(options, key);
|
|
889
|
+
return {
|
|
890
|
+
..."overrides" in sub ? sub.overrides : {}
|
|
891
|
+
};
|
|
892
|
+
}
|
|
893
|
+
|
|
990
894
|
// src/configs/jsdoc.ts
|
|
991
895
|
async function jsdoc(options = {}) {
|
|
992
896
|
const {
|
|
@@ -1208,7 +1112,7 @@ var StylisticConfigDefaults = {
|
|
|
1208
1112
|
async function stylistic(options = {}) {
|
|
1209
1113
|
const {
|
|
1210
1114
|
indent,
|
|
1211
|
-
jsx,
|
|
1115
|
+
jsx: jsx2,
|
|
1212
1116
|
overrides = {},
|
|
1213
1117
|
quotes,
|
|
1214
1118
|
semi
|
|
@@ -1220,7 +1124,7 @@ async function stylistic(options = {}) {
|
|
|
1220
1124
|
const config = pluginStylistic.configs.customize({
|
|
1221
1125
|
flat: true,
|
|
1222
1126
|
indent,
|
|
1223
|
-
jsx,
|
|
1127
|
+
jsx: jsx2,
|
|
1224
1128
|
pluginName: "style",
|
|
1225
1129
|
quotes,
|
|
1226
1130
|
semi
|
|
@@ -1950,7 +1854,6 @@ async function astro(options = {}) {
|
|
|
1950
1854
|
const {
|
|
1951
1855
|
files = [GLOB_ASTRO],
|
|
1952
1856
|
overrides = {},
|
|
1953
|
-
typescript: typescript2 = true,
|
|
1954
1857
|
stylistic: stylistic2 = true
|
|
1955
1858
|
} = options;
|
|
1956
1859
|
await ensure([
|
|
@@ -1977,63 +1880,35 @@ async function astro(options = {}) {
|
|
|
1977
1880
|
name: "luxass/astro/rules",
|
|
1978
1881
|
files,
|
|
1979
1882
|
languageOptions: {
|
|
1883
|
+
globals: pluginAstro.environments.astro.globals,
|
|
1980
1884
|
parser: parserAstro,
|
|
1981
1885
|
parserOptions: {
|
|
1982
1886
|
extraFileExtensions: [".astro"],
|
|
1983
|
-
parser:
|
|
1984
|
-
|
|
1985
|
-
|
|
1887
|
+
parser: parserTs
|
|
1888
|
+
},
|
|
1889
|
+
sourceType: "module"
|
|
1986
1890
|
},
|
|
1891
|
+
processor: "astro/client-side-ts",
|
|
1987
1892
|
rules: {
|
|
1988
|
-
|
|
1989
|
-
// https://ota-meshi.github.io/eslint-plugin-astro/rules/no-conflict-set-directives/
|
|
1893
|
+
"astro/missing-client-only-directive-value": "error",
|
|
1990
1894
|
"astro/no-conflict-set-directives": "error",
|
|
1991
|
-
|
|
1992
|
-
|
|
1895
|
+
"astro/no-deprecated-astro-canonicalurl": "error",
|
|
1896
|
+
"astro/no-deprecated-astro-fetchcontent": "error",
|
|
1897
|
+
"astro/no-deprecated-astro-resolve": "error",
|
|
1898
|
+
"astro/no-deprecated-getentrybyslug": "error",
|
|
1993
1899
|
"astro/no-set-html-directive": "off",
|
|
1900
|
+
"astro/no-unused-define-vars-in-style": "error",
|
|
1901
|
+
"astro/semi": "off",
|
|
1902
|
+
"astro/valid-compile": "error",
|
|
1994
1903
|
...stylistic2 ? {
|
|
1995
1904
|
"style/indent": "off",
|
|
1996
|
-
"style/jsx-indent": "off",
|
|
1997
1905
|
"style/jsx-closing-tag-location": "off",
|
|
1906
|
+
"style/jsx-indent": "off",
|
|
1998
1907
|
"style/jsx-one-expression-per-line": "off",
|
|
1999
1908
|
"style/no-multiple-empty-lines": "off"
|
|
2000
1909
|
} : {},
|
|
2001
1910
|
...overrides
|
|
2002
1911
|
}
|
|
2003
|
-
},
|
|
2004
|
-
{
|
|
2005
|
-
name: "luxass/astro/scripts-js",
|
|
2006
|
-
files: [
|
|
2007
|
-
"**/*.astro/*.js",
|
|
2008
|
-
"*.astro/*.js"
|
|
2009
|
-
],
|
|
2010
|
-
languageOptions: {
|
|
2011
|
-
globals: {
|
|
2012
|
-
browser: true,
|
|
2013
|
-
es2020: true
|
|
2014
|
-
},
|
|
2015
|
-
parserOptions: {
|
|
2016
|
-
sourceType: "module"
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
},
|
|
2020
|
-
{
|
|
2021
|
-
name: "luxass/astro/scripts-ts",
|
|
2022
|
-
files: [
|
|
2023
|
-
"**/*.astro/*.ts",
|
|
2024
|
-
"*.astro/*.ts"
|
|
2025
|
-
],
|
|
2026
|
-
languageOptions: {
|
|
2027
|
-
globals: {
|
|
2028
|
-
browser: true,
|
|
2029
|
-
es2020: true
|
|
2030
|
-
},
|
|
2031
|
-
parser: typescript2 ? parserTs : null,
|
|
2032
|
-
parserOptions: {
|
|
2033
|
-
project: null,
|
|
2034
|
-
sourceType: "module"
|
|
2035
|
-
}
|
|
2036
|
-
}
|
|
2037
1912
|
}
|
|
2038
1913
|
];
|
|
2039
1914
|
}
|
|
@@ -2337,83 +2212,6 @@ async function toml(options = {}) {
|
|
|
2337
2212
|
];
|
|
2338
2213
|
}
|
|
2339
2214
|
|
|
2340
|
-
// src/configs/solid.ts
|
|
2341
|
-
async function solid(options = {}) {
|
|
2342
|
-
const {
|
|
2343
|
-
overrides = {},
|
|
2344
|
-
typescript: typescript2 = true,
|
|
2345
|
-
files = [GLOB_JSX, GLOB_TSX]
|
|
2346
|
-
} = options;
|
|
2347
|
-
await ensure([
|
|
2348
|
-
"eslint-plugin-solid"
|
|
2349
|
-
]);
|
|
2350
|
-
const tsconfigPath = options?.tsconfigPath ? toArray(options.tsconfigPath) : void 0;
|
|
2351
|
-
const isTypeAware = !!tsconfigPath;
|
|
2352
|
-
const [
|
|
2353
|
-
pluginSolid,
|
|
2354
|
-
parserTs
|
|
2355
|
-
] = await Promise.all([
|
|
2356
|
-
interop(import("eslint-plugin-solid")),
|
|
2357
|
-
interop(import("@typescript-eslint/parser"))
|
|
2358
|
-
]);
|
|
2359
|
-
return [
|
|
2360
|
-
{
|
|
2361
|
-
name: "luxass/solid/setup",
|
|
2362
|
-
plugins: {
|
|
2363
|
-
solid: pluginSolid
|
|
2364
|
-
}
|
|
2365
|
-
},
|
|
2366
|
-
{
|
|
2367
|
-
name: "luxass/solid/rules",
|
|
2368
|
-
files,
|
|
2369
|
-
languageOptions: {
|
|
2370
|
-
parser: parserTs,
|
|
2371
|
-
parserOptions: {
|
|
2372
|
-
ecmaFeatures: {
|
|
2373
|
-
jsx: true
|
|
2374
|
-
},
|
|
2375
|
-
...isTypeAware ? { project: tsconfigPath } : {}
|
|
2376
|
-
},
|
|
2377
|
-
sourceType: "module"
|
|
2378
|
-
},
|
|
2379
|
-
rules: {
|
|
2380
|
-
// reactivity
|
|
2381
|
-
"solid/components-return-once": "warn",
|
|
2382
|
-
"solid/event-handlers": ["error", {
|
|
2383
|
-
// if true, don't warn on ambiguously named event handlers like `onclick` or `onchange`
|
|
2384
|
-
ignoreCase: false,
|
|
2385
|
-
// if true, warn when spreading event handlers onto JSX. Enable for Solid < v1.6.
|
|
2386
|
-
warnOnSpread: false
|
|
2387
|
-
}],
|
|
2388
|
-
// these rules are mostly style suggestions
|
|
2389
|
-
"solid/imports": "error",
|
|
2390
|
-
// identifier usage is important
|
|
2391
|
-
"solid/jsx-no-duplicate-props": "error",
|
|
2392
|
-
"solid/jsx-no-script-url": "error",
|
|
2393
|
-
"solid/jsx-no-undef": "error",
|
|
2394
|
-
"solid/jsx-uses-vars": "error",
|
|
2395
|
-
"solid/no-destructure": "error",
|
|
2396
|
-
// security problems
|
|
2397
|
-
"solid/no-innerhtml": ["error", { allowStatic: true }],
|
|
2398
|
-
"solid/no-react-deps": "error",
|
|
2399
|
-
"solid/no-react-specific-props": "error",
|
|
2400
|
-
"solid/no-unknown-namespaces": "error",
|
|
2401
|
-
"solid/prefer-for": "error",
|
|
2402
|
-
"solid/reactivity": "warn",
|
|
2403
|
-
"solid/self-closing-comp": "error",
|
|
2404
|
-
"solid/style-prop": ["error", { styleProps: ["style", "css"] }],
|
|
2405
|
-
...typescript2 ? {
|
|
2406
|
-
"solid/jsx-no-undef": ["error", { typescriptEnabled: true }],
|
|
2407
|
-
// namespaces taken care of by TS
|
|
2408
|
-
"solid/no-unknown-namespaces": "off"
|
|
2409
|
-
} : {},
|
|
2410
|
-
// overrides
|
|
2411
|
-
...overrides
|
|
2412
|
-
}
|
|
2413
|
-
}
|
|
2414
|
-
];
|
|
2415
|
-
}
|
|
2416
|
-
|
|
2417
2215
|
// src/configs/regexp.ts
|
|
2418
2216
|
var import_eslint_plugin_regexp = require("eslint-plugin-regexp");
|
|
2419
2217
|
async function regexp(options = {}) {
|
|
@@ -2440,6 +2238,23 @@ async function regexp(options = {}) {
|
|
|
2440
2238
|
];
|
|
2441
2239
|
}
|
|
2442
2240
|
|
|
2241
|
+
// src/configs/jsx.ts
|
|
2242
|
+
async function jsx() {
|
|
2243
|
+
return [
|
|
2244
|
+
{
|
|
2245
|
+
name: "luxass/jsx/setup",
|
|
2246
|
+
files: [GLOB_JSX, GLOB_TSX],
|
|
2247
|
+
languageOptions: {
|
|
2248
|
+
parserOptions: {
|
|
2249
|
+
ecmaFeatures: {
|
|
2250
|
+
jsx: true
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
];
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2443
2258
|
// src/factory.ts
|
|
2444
2259
|
var FLAT_CONFIG_PROPS = [
|
|
2445
2260
|
"name",
|
|
@@ -2474,21 +2289,20 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2474
2289
|
const {
|
|
2475
2290
|
astro: enableAstro = false,
|
|
2476
2291
|
autoRenamePlugins = true,
|
|
2477
|
-
editor = !!((import_node_process3.default.env.VSCODE_PID || import_node_process3.default.env.JETBRAINS_IDE || import_node_process3.default.env.VIM) && !import_node_process3.default.env.CI),
|
|
2478
2292
|
exts = [],
|
|
2479
2293
|
gitignore: enableGitignore = true,
|
|
2294
|
+
editor = !!((import_node_process3.default.env.VSCODE_PID || import_node_process3.default.env.JETBRAINS_IDE || import_node_process3.default.env.VIM) && !import_node_process3.default.env.CI),
|
|
2295
|
+
jsx: enableJsx = true,
|
|
2480
2296
|
react: enableReact = false,
|
|
2481
|
-
|
|
2482
|
-
svelte: enableSvelte = false,
|
|
2483
|
-
solid: enableSolid = false,
|
|
2297
|
+
regexp: enableRegexp = true,
|
|
2484
2298
|
typescript: enableTypeScript = (0, import_local_pkg4.isPackageExists)("typescript"),
|
|
2485
2299
|
unocss: enableUnoCSS = false,
|
|
2486
|
-
|
|
2300
|
+
tailwindcss: enableTailwindCSS = false,
|
|
2487
2301
|
vue: enableVue = VuePackages.some((i) => (0, import_local_pkg4.isPackageExists)(i))
|
|
2488
2302
|
} = options;
|
|
2489
2303
|
const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
|
|
2490
2304
|
if (stylisticOptions && !("jsx" in stylisticOptions)) {
|
|
2491
|
-
stylisticOptions.jsx =
|
|
2305
|
+
stylisticOptions.jsx = enableJsx;
|
|
2492
2306
|
}
|
|
2493
2307
|
const configs2 = [];
|
|
2494
2308
|
if (enableGitignore) {
|
|
@@ -2500,6 +2314,8 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2500
2314
|
}
|
|
2501
2315
|
}
|
|
2502
2316
|
}
|
|
2317
|
+
const typescriptOptions = resolveSubOptions(options, "typescript");
|
|
2318
|
+
const tsconfigPath = "tsconfigPath" in typescriptOptions ? typescriptOptions.tsconfigPath : void 0;
|
|
2503
2319
|
configs2.push(
|
|
2504
2320
|
ignores(),
|
|
2505
2321
|
javascript({
|
|
@@ -2519,9 +2335,12 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2519
2335
|
if (enableVue) {
|
|
2520
2336
|
exts.push("vue");
|
|
2521
2337
|
}
|
|
2338
|
+
if (enableJsx) {
|
|
2339
|
+
configs2.push(jsx());
|
|
2340
|
+
}
|
|
2522
2341
|
if (enableTypeScript) {
|
|
2523
2342
|
configs2.push(typescript({
|
|
2524
|
-
...
|
|
2343
|
+
...typescriptOptions,
|
|
2525
2344
|
exts,
|
|
2526
2345
|
overrides: getOverrides(options, "typescript")
|
|
2527
2346
|
}));
|
|
@@ -2548,28 +2367,9 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2548
2367
|
configs2.push(react({
|
|
2549
2368
|
...resolveSubOptions(options, "react"),
|
|
2550
2369
|
overrides: getOverrides(options, "react"),
|
|
2551
|
-
tsconfigPath
|
|
2370
|
+
tsconfigPath
|
|
2552
2371
|
}));
|
|
2553
2372
|
}
|
|
2554
|
-
if (enableSolid) {
|
|
2555
|
-
configs2.push(
|
|
2556
|
-
solid({
|
|
2557
|
-
...resolveSubOptions(options, "solid"),
|
|
2558
|
-
overrides: getOverrides(options, "solid"),
|
|
2559
|
-
typescript: !!enableTypeScript
|
|
2560
|
-
})
|
|
2561
|
-
);
|
|
2562
|
-
}
|
|
2563
|
-
if (enableSvelte) {
|
|
2564
|
-
configs2.push(
|
|
2565
|
-
svelte({
|
|
2566
|
-
...resolveSubOptions(options, "svelte"),
|
|
2567
|
-
overrides: getOverrides(options, "svelte"),
|
|
2568
|
-
stylistic: stylisticOptions,
|
|
2569
|
-
typescript: !!enableTypeScript
|
|
2570
|
-
})
|
|
2571
|
-
);
|
|
2572
|
-
}
|
|
2573
2373
|
if (enableVue) {
|
|
2574
2374
|
configs2.push(
|
|
2575
2375
|
vue({
|
|
@@ -2584,8 +2384,7 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2584
2384
|
configs2.push(
|
|
2585
2385
|
astro({
|
|
2586
2386
|
...resolveSubOptions(options, "astro"),
|
|
2587
|
-
overrides: getOverrides(options, "astro")
|
|
2588
|
-
typescript: !!enableTypeScript
|
|
2387
|
+
overrides: getOverrides(options, "astro")
|
|
2589
2388
|
})
|
|
2590
2389
|
);
|
|
2591
2390
|
}
|
|
@@ -2701,6 +2500,7 @@ var src_default = luxass;
|
|
|
2701
2500
|
javascript,
|
|
2702
2501
|
jsdoc,
|
|
2703
2502
|
jsonc,
|
|
2503
|
+
jsx,
|
|
2704
2504
|
luxass,
|
|
2705
2505
|
markdown,
|
|
2706
2506
|
node,
|
|
@@ -2709,11 +2509,9 @@ var src_default = luxass;
|
|
|
2709
2509
|
regexp,
|
|
2710
2510
|
renameRules,
|
|
2711
2511
|
resolveSubOptions,
|
|
2712
|
-
solid,
|
|
2713
2512
|
sortPackageJson,
|
|
2714
2513
|
sortTsconfig,
|
|
2715
2514
|
stylistic,
|
|
2716
|
-
svelte,
|
|
2717
2515
|
tailwindcss,
|
|
2718
2516
|
test,
|
|
2719
2517
|
toArray,
|