@luxass/eslint-config 4.14.0 → 4.16.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 +118 -95
- package/dist/index.d.cts +2352 -585
- package/dist/index.d.ts +2352 -585
- package/dist/index.js +114 -91
- package/package.json +61 -56
package/dist/index.cjs
CHANGED
|
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
GLOB_ASTRO: () => GLOB_ASTRO,
|
|
34
34
|
GLOB_ASTRO_TS: () => GLOB_ASTRO_TS,
|
|
35
35
|
GLOB_CSS: () => GLOB_CSS,
|
|
@@ -62,7 +62,7 @@ __export(src_exports, {
|
|
|
62
62
|
astro: () => astro,
|
|
63
63
|
combine: () => combine,
|
|
64
64
|
comments: () => comments,
|
|
65
|
-
default: () =>
|
|
65
|
+
default: () => index_default,
|
|
66
66
|
disables: () => disables,
|
|
67
67
|
ensure: () => ensure,
|
|
68
68
|
formatters: () => formatters,
|
|
@@ -100,9 +100,9 @@ __export(src_exports, {
|
|
|
100
100
|
vue: () => vue,
|
|
101
101
|
yaml: () => yaml
|
|
102
102
|
});
|
|
103
|
-
module.exports = __toCommonJS(
|
|
103
|
+
module.exports = __toCommonJS(index_exports);
|
|
104
104
|
|
|
105
|
-
// node_modules/.pnpm/tsup@8.
|
|
105
|
+
// node_modules/.pnpm/tsup@8.4.0_jiti@2.4.2_postcss@8.5.3_tsx@4.19.3_typescript@5.8.2_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
|
|
106
106
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
107
107
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
108
108
|
|
|
@@ -332,7 +332,6 @@ async function astro(options = {}) {
|
|
|
332
332
|
}
|
|
333
333
|
},
|
|
334
334
|
{
|
|
335
|
-
name: "luxass/astro/rules",
|
|
336
335
|
files,
|
|
337
336
|
languageOptions: {
|
|
338
337
|
globals: pluginAstro.environments.astro.globals,
|
|
@@ -343,8 +342,12 @@ async function astro(options = {}) {
|
|
|
343
342
|
},
|
|
344
343
|
sourceType: "module"
|
|
345
344
|
},
|
|
345
|
+
name: "luxass/astro/rules",
|
|
346
346
|
processor: "astro/client-side-ts",
|
|
347
347
|
rules: {
|
|
348
|
+
// Astro uses top level await for e.g. data fetching
|
|
349
|
+
// https://docs.astro.build/en/guides/data-fetching/#fetch-in-astro
|
|
350
|
+
"antfu/no-top-level-await": "off",
|
|
348
351
|
// use recommended rules
|
|
349
352
|
"astro/missing-client-only-directive-value": "error",
|
|
350
353
|
"astro/no-conflict-set-directives": "error",
|
|
@@ -437,8 +440,8 @@ async function disables() {
|
|
|
437
440
|
}
|
|
438
441
|
},
|
|
439
442
|
{
|
|
440
|
-
name: "luxass/disables/github-actions",
|
|
441
443
|
files: ["**/.github/workflows/*.{yml,yaml}"],
|
|
444
|
+
name: "luxass/disables/github-actions",
|
|
442
445
|
rules: {
|
|
443
446
|
// GitHub Actions supports empty values to enable features
|
|
444
447
|
"yaml/no-empty-mapping-value": "off"
|
|
@@ -477,7 +480,6 @@ async function stylistic(options = {}) {
|
|
|
477
480
|
};
|
|
478
481
|
const pluginStylistic = await interop(import("@stylistic/eslint-plugin"));
|
|
479
482
|
const config = pluginStylistic.configs.customize({
|
|
480
|
-
flat: true,
|
|
481
483
|
indent,
|
|
482
484
|
jsx: jsx2,
|
|
483
485
|
pluginName: "style",
|
|
@@ -499,6 +501,8 @@ async function stylistic(options = {}) {
|
|
|
499
501
|
"curly": ["error", "multi-line", "consistent"],
|
|
500
502
|
"style/arrow-parens": ["error", "always", { requireForBlockBody: true }],
|
|
501
503
|
"style/brace-style": ["error", "1tbs", { allowSingleLine: true }],
|
|
504
|
+
"style/generator-star-spacing": ["error", { after: true, before: false }],
|
|
505
|
+
"style/yield-star-spacing": ["error", { after: true, before: false }],
|
|
502
506
|
...overrides
|
|
503
507
|
}
|
|
504
508
|
}
|
|
@@ -570,11 +574,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
570
574
|
if (options.css) {
|
|
571
575
|
configs2.push(
|
|
572
576
|
{
|
|
573
|
-
name: "luxass/formatter/css",
|
|
574
577
|
files: [GLOB_CSS, GLOB_POSTCSS],
|
|
575
578
|
languageOptions: {
|
|
576
579
|
parser: parserPlain
|
|
577
580
|
},
|
|
581
|
+
name: "luxass/formatter/css",
|
|
578
582
|
rules: {
|
|
579
583
|
"format/prettier": [
|
|
580
584
|
"error",
|
|
@@ -585,11 +589,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
585
589
|
}
|
|
586
590
|
},
|
|
587
591
|
{
|
|
588
|
-
name: "luxass/formatter/scss",
|
|
589
592
|
files: [GLOB_SCSS],
|
|
590
593
|
languageOptions: {
|
|
591
594
|
parser: parserPlain
|
|
592
595
|
},
|
|
596
|
+
name: "luxass/formatter/scss",
|
|
593
597
|
rules: {
|
|
594
598
|
"format/prettier": [
|
|
595
599
|
"error",
|
|
@@ -600,11 +604,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
600
604
|
}
|
|
601
605
|
},
|
|
602
606
|
{
|
|
603
|
-
name: "luxass/formatter/less",
|
|
604
607
|
files: [GLOB_LESS],
|
|
605
608
|
languageOptions: {
|
|
606
609
|
parser: parserPlain
|
|
607
610
|
},
|
|
611
|
+
name: "luxass/formatter/less",
|
|
608
612
|
rules: {
|
|
609
613
|
"format/prettier": [
|
|
610
614
|
"error",
|
|
@@ -618,11 +622,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
618
622
|
}
|
|
619
623
|
if (options.html) {
|
|
620
624
|
configs2.push({
|
|
621
|
-
name: "luxass/formatter/html",
|
|
622
625
|
files: [GLOB_HTML],
|
|
623
626
|
languageOptions: {
|
|
624
627
|
parser: parserPlain
|
|
625
628
|
},
|
|
629
|
+
name: "luxass/formatter/html",
|
|
626
630
|
rules: {
|
|
627
631
|
"format/prettier": [
|
|
628
632
|
"error",
|
|
@@ -634,17 +638,17 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
634
638
|
});
|
|
635
639
|
}
|
|
636
640
|
if (options.markdown) {
|
|
637
|
-
const
|
|
641
|
+
const formatter = options.markdown === true ? "prettier" : options.markdown;
|
|
638
642
|
configs2.push({
|
|
639
|
-
name: "luxass/formatter/markdown",
|
|
640
643
|
files: [GLOB_MARKDOWN],
|
|
641
644
|
languageOptions: {
|
|
642
645
|
parser: parserPlain
|
|
643
646
|
},
|
|
647
|
+
name: "luxass/formatter/markdown",
|
|
644
648
|
rules: {
|
|
645
|
-
[`format/${
|
|
649
|
+
[`format/${formatter}`]: [
|
|
646
650
|
"error",
|
|
647
|
-
|
|
651
|
+
formatter === "prettier" ? mergePrettierOptions(prettierOptions, {
|
|
648
652
|
embeddedLanguageFormatting: "off",
|
|
649
653
|
parser: "markdown"
|
|
650
654
|
}) : {
|
|
@@ -657,11 +661,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
657
661
|
}
|
|
658
662
|
if (options.astro) {
|
|
659
663
|
configs2.push({
|
|
660
|
-
name: "luxass/formatter/astro",
|
|
661
664
|
files: [GLOB_ASTRO],
|
|
662
665
|
languageOptions: {
|
|
663
666
|
parser: parserPlain
|
|
664
667
|
},
|
|
668
|
+
name: "luxass/formatter/astro",
|
|
665
669
|
rules: {
|
|
666
670
|
"format/prettier": [
|
|
667
671
|
"error",
|
|
@@ -677,11 +681,11 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
677
681
|
}
|
|
678
682
|
if (options.graphql) {
|
|
679
683
|
configs2.push({
|
|
680
|
-
name: "luxass/formatter/graphql",
|
|
681
684
|
files: [GLOB_GRAPHQL],
|
|
682
685
|
languageOptions: {
|
|
683
686
|
parser: parserPlain
|
|
684
687
|
},
|
|
688
|
+
name: "luxass/formatter/graphql",
|
|
685
689
|
rules: {
|
|
686
690
|
"format/prettier": [
|
|
687
691
|
"error",
|
|
@@ -726,6 +730,7 @@ async function imports(options = {}) {
|
|
|
726
730
|
"antfu/import-dedupe": "error",
|
|
727
731
|
"antfu/no-import-dist": "error",
|
|
728
732
|
"antfu/no-import-node-modules-by-path": "error",
|
|
733
|
+
"import/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
729
734
|
"import/first": "error",
|
|
730
735
|
"import/no-duplicates": "error",
|
|
731
736
|
"import/no-mutable-exports": "error",
|
|
@@ -751,7 +756,6 @@ async function javascript(options = {}) {
|
|
|
751
756
|
} = options;
|
|
752
757
|
return [
|
|
753
758
|
{
|
|
754
|
-
name: "luxass/javascript/setup",
|
|
755
759
|
languageOptions: {
|
|
756
760
|
ecmaVersion: 2022,
|
|
757
761
|
globals: {
|
|
@@ -773,7 +777,8 @@ async function javascript(options = {}) {
|
|
|
773
777
|
},
|
|
774
778
|
linterOptions: {
|
|
775
779
|
reportUnusedDisableDirectives: true
|
|
776
|
-
}
|
|
780
|
+
},
|
|
781
|
+
name: "luxass/javascript/setup"
|
|
777
782
|
},
|
|
778
783
|
{
|
|
779
784
|
name: "luxass/javascript/rules",
|
|
@@ -849,8 +854,8 @@ async function javascript(options = {}) {
|
|
|
849
854
|
"no-regex-spaces": "error",
|
|
850
855
|
"no-restricted-globals": [
|
|
851
856
|
"error",
|
|
852
|
-
{
|
|
853
|
-
{
|
|
857
|
+
{ message: "Use `globalThis` instead.", name: "global" },
|
|
858
|
+
{ message: "Use `globalThis` instead.", name: "self" }
|
|
854
859
|
],
|
|
855
860
|
"no-restricted-properties": [
|
|
856
861
|
"error",
|
|
@@ -982,12 +987,12 @@ async function javascript(options = {}) {
|
|
|
982
987
|
}
|
|
983
988
|
},
|
|
984
989
|
{
|
|
985
|
-
name: "luxass/disables/cli",
|
|
986
990
|
files: [
|
|
987
991
|
`scripts/${GLOB_SRC}`,
|
|
988
992
|
`cli.${GLOB_SRC_EXT}`,
|
|
989
993
|
`**/playground.${GLOB_SRC_EXT}`
|
|
990
994
|
],
|
|
995
|
+
name: "luxass/disables/cli",
|
|
991
996
|
rules: {
|
|
992
997
|
"no-console": "off"
|
|
993
998
|
}
|
|
@@ -1058,11 +1063,11 @@ async function jsonc(options = {}) {
|
|
|
1058
1063
|
}
|
|
1059
1064
|
},
|
|
1060
1065
|
{
|
|
1061
|
-
name: "luxass/jsonc/rules",
|
|
1062
1066
|
files,
|
|
1063
1067
|
languageOptions: {
|
|
1064
1068
|
parser: parserJsonc
|
|
1065
1069
|
},
|
|
1070
|
+
name: "luxass/jsonc/rules",
|
|
1066
1071
|
rules: {
|
|
1067
1072
|
"jsonc/no-bigint-literals": "error",
|
|
1068
1073
|
"jsonc/no-binary-expression": "error",
|
|
@@ -1121,7 +1126,6 @@ async function jsonc(options = {}) {
|
|
|
1121
1126
|
async function jsx() {
|
|
1122
1127
|
return [
|
|
1123
1128
|
{
|
|
1124
|
-
name: "luxass/jsx/setup",
|
|
1125
1129
|
files: [GLOB_JSX, GLOB_TSX],
|
|
1126
1130
|
languageOptions: {
|
|
1127
1131
|
parserOptions: {
|
|
@@ -1129,7 +1133,8 @@ async function jsx() {
|
|
|
1129
1133
|
jsx: true
|
|
1130
1134
|
}
|
|
1131
1135
|
}
|
|
1132
|
-
}
|
|
1136
|
+
},
|
|
1137
|
+
name: "luxass/jsx/setup"
|
|
1133
1138
|
}
|
|
1134
1139
|
];
|
|
1135
1140
|
}
|
|
@@ -1151,9 +1156,9 @@ async function markdown(options = {}) {
|
|
|
1151
1156
|
}
|
|
1152
1157
|
},
|
|
1153
1158
|
{
|
|
1154
|
-
name: "luxass/markdown/processor",
|
|
1155
1159
|
files,
|
|
1156
1160
|
ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
|
|
1161
|
+
name: "luxass/markdown/processor",
|
|
1157
1162
|
// `eslint-plugin-markdown` only creates virtual files for code blocks,
|
|
1158
1163
|
// but not the markdown file itself. We use `eslint-merge-processors` to
|
|
1159
1164
|
// add a pass-through processor for the markdown file itself.
|
|
@@ -1163,14 +1168,13 @@ async function markdown(options = {}) {
|
|
|
1163
1168
|
])
|
|
1164
1169
|
},
|
|
1165
1170
|
{
|
|
1166
|
-
name: "luxass/markdown/parser",
|
|
1167
1171
|
files,
|
|
1168
1172
|
languageOptions: {
|
|
1169
1173
|
parser: parserPlain
|
|
1170
|
-
}
|
|
1174
|
+
},
|
|
1175
|
+
name: "luxass/markdown/parser"
|
|
1171
1176
|
},
|
|
1172
1177
|
{
|
|
1173
|
-
name: "luxass/markdown/disables",
|
|
1174
1178
|
files: [
|
|
1175
1179
|
GLOB_MARKDOWN_CODE,
|
|
1176
1180
|
...exts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
|
|
@@ -1182,6 +1186,7 @@ async function markdown(options = {}) {
|
|
|
1182
1186
|
}
|
|
1183
1187
|
}
|
|
1184
1188
|
},
|
|
1189
|
+
name: "luxass/markdown/disables",
|
|
1185
1190
|
rules: {
|
|
1186
1191
|
"antfu/no-top-level-await": "off",
|
|
1187
1192
|
"import/newline-after-import": "off",
|
|
@@ -1252,10 +1257,10 @@ async function perfectionist() {
|
|
|
1252
1257
|
"perfectionist/sort-imports": ["error", {
|
|
1253
1258
|
groups: [
|
|
1254
1259
|
"type",
|
|
1255
|
-
["parent-type", "sibling-type", "index-type"],
|
|
1260
|
+
["parent-type", "sibling-type", "index-type", "internal-type"],
|
|
1256
1261
|
"builtin",
|
|
1257
1262
|
"external",
|
|
1258
|
-
|
|
1263
|
+
"internal",
|
|
1259
1264
|
["parent", "sibling", "index"],
|
|
1260
1265
|
"side-effect",
|
|
1261
1266
|
"object",
|
|
@@ -1283,18 +1288,24 @@ var RemixPackages = [
|
|
|
1283
1288
|
"@remix-run/serve",
|
|
1284
1289
|
"@remix-run/dev"
|
|
1285
1290
|
];
|
|
1291
|
+
var ReactRouterPackages = [
|
|
1292
|
+
"@react-router/node",
|
|
1293
|
+
"@react-router/react",
|
|
1294
|
+
"@react-router/serve",
|
|
1295
|
+
"@react-router/dev"
|
|
1296
|
+
];
|
|
1286
1297
|
var NextJsPackages = [
|
|
1287
1298
|
"next"
|
|
1288
1299
|
];
|
|
1289
1300
|
async function react(options = {}) {
|
|
1290
1301
|
const {
|
|
1291
1302
|
files = [GLOB_JS, GLOB_JSX, GLOB_TS, GLOB_TSX],
|
|
1292
|
-
overrides = {},
|
|
1293
1303
|
filesTypeAware = [GLOB_TS, GLOB_TSX],
|
|
1294
1304
|
ignoresTypeAware = [
|
|
1295
1305
|
`${GLOB_MARKDOWN}/**`,
|
|
1296
1306
|
GLOB_ASTRO_TS
|
|
1297
1307
|
],
|
|
1308
|
+
overrides = {},
|
|
1298
1309
|
tsconfigPath
|
|
1299
1310
|
} = options;
|
|
1300
1311
|
await ensure([
|
|
@@ -1317,6 +1328,7 @@ async function react(options = {}) {
|
|
|
1317
1328
|
]);
|
|
1318
1329
|
const isAllowConstantExport = ReactRefreshAllowConstantExportPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i));
|
|
1319
1330
|
const isUsingRemix = RemixPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i));
|
|
1331
|
+
const isUsingReactRouter = ReactRouterPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i));
|
|
1320
1332
|
const isUsingNext = NextJsPackages.some((i) => (0, import_local_pkg2.isPackageExists)(i));
|
|
1321
1333
|
const plugins = pluginReact.configs.all.plugins;
|
|
1322
1334
|
return [
|
|
@@ -1328,11 +1340,11 @@ async function react(options = {}) {
|
|
|
1328
1340
|
"react-hooks": pluginReactHooks,
|
|
1329
1341
|
"react-hooks-extra": plugins["@eslint-react/hooks-extra"],
|
|
1330
1342
|
"react-naming-convention": plugins["@eslint-react/naming-convention"],
|
|
1331
|
-
"react-refresh": pluginReactRefresh
|
|
1343
|
+
"react-refresh": pluginReactRefresh,
|
|
1344
|
+
"react-web-api": plugins["@eslint-react/web-api"]
|
|
1332
1345
|
}
|
|
1333
1346
|
},
|
|
1334
1347
|
{
|
|
1335
|
-
name: "luxass/react/rules",
|
|
1336
1348
|
files,
|
|
1337
1349
|
languageOptions: {
|
|
1338
1350
|
parserOptions: {
|
|
@@ -1342,6 +1354,7 @@ async function react(options = {}) {
|
|
|
1342
1354
|
},
|
|
1343
1355
|
sourceType: "module"
|
|
1344
1356
|
},
|
|
1357
|
+
name: "luxass/react/rules",
|
|
1345
1358
|
rules: {
|
|
1346
1359
|
// recommended rules from @eslint-react/dom
|
|
1347
1360
|
"react-dom/no-children-in-void-dom-elements": "warn",
|
|
@@ -1380,7 +1393,7 @@ async function react(options = {}) {
|
|
|
1380
1393
|
"viewport",
|
|
1381
1394
|
"generateViewport"
|
|
1382
1395
|
] : [],
|
|
1383
|
-
...isUsingRemix ? [
|
|
1396
|
+
...isUsingRemix || isUsingReactRouter ? [
|
|
1384
1397
|
"meta",
|
|
1385
1398
|
"links",
|
|
1386
1399
|
"headers",
|
|
@@ -1390,27 +1403,37 @@ async function react(options = {}) {
|
|
|
1390
1403
|
]
|
|
1391
1404
|
}
|
|
1392
1405
|
],
|
|
1406
|
+
// recommended rules from @eslint-react/web-api
|
|
1407
|
+
"react-web-api/no-leaked-event-listener": "warn",
|
|
1408
|
+
"react-web-api/no-leaked-interval": "warn",
|
|
1409
|
+
"react-web-api/no-leaked-resize-observer": "warn",
|
|
1410
|
+
"react-web-api/no-leaked-timeout": "warn",
|
|
1393
1411
|
// recommended rules from @eslint-react
|
|
1394
1412
|
"react/ensure-forward-ref-using-ref": "warn",
|
|
1413
|
+
"react/jsx-no-duplicate-props": "warn",
|
|
1414
|
+
"react/jsx-uses-vars": "warn",
|
|
1395
1415
|
"react/no-access-state-in-setstate": "error",
|
|
1396
1416
|
"react/no-array-index-key": "warn",
|
|
1397
1417
|
"react/no-children-count": "warn",
|
|
1398
1418
|
"react/no-children-for-each": "warn",
|
|
1399
1419
|
"react/no-children-map": "warn",
|
|
1400
1420
|
"react/no-children-only": "warn",
|
|
1401
|
-
"react/no-children-prop": "warn",
|
|
1402
1421
|
"react/no-children-to-array": "warn",
|
|
1403
1422
|
"react/no-clone-element": "warn",
|
|
1404
1423
|
"react/no-comment-textnodes": "warn",
|
|
1405
1424
|
"react/no-component-will-mount": "error",
|
|
1406
1425
|
"react/no-component-will-receive-props": "error",
|
|
1407
1426
|
"react/no-component-will-update": "error",
|
|
1427
|
+
"react/no-context-provider": "warn",
|
|
1408
1428
|
"react/no-create-ref": "error",
|
|
1429
|
+
"react/no-default-props": "error",
|
|
1409
1430
|
"react/no-direct-mutation-state": "error",
|
|
1410
1431
|
"react/no-duplicate-key": "error",
|
|
1411
|
-
"react/no-
|
|
1432
|
+
"react/no-forward-ref": "warn",
|
|
1433
|
+
"react/no-implicit-key": "warn",
|
|
1412
1434
|
"react/no-missing-key": "error",
|
|
1413
|
-
"react/no-nested-components": "
|
|
1435
|
+
"react/no-nested-components": "error",
|
|
1436
|
+
"react/no-prop-types": "error",
|
|
1414
1437
|
"react/no-redundant-should-component-update": "error",
|
|
1415
1438
|
"react/no-set-state-in-component-did-mount": "warn",
|
|
1416
1439
|
"react/no-set-state-in-component-did-update": "warn",
|
|
@@ -1419,11 +1442,10 @@ async function react(options = {}) {
|
|
|
1419
1442
|
"react/no-unsafe-component-will-mount": "warn",
|
|
1420
1443
|
"react/no-unsafe-component-will-receive-props": "warn",
|
|
1421
1444
|
"react/no-unsafe-component-will-update": "warn",
|
|
1422
|
-
"react/no-unstable-context-value": "
|
|
1423
|
-
"react/no-unstable-default-props": "
|
|
1445
|
+
"react/no-unstable-context-value": "warn",
|
|
1446
|
+
"react/no-unstable-default-props": "warn",
|
|
1424
1447
|
"react/no-unused-class-component-members": "warn",
|
|
1425
1448
|
"react/no-unused-state": "warn",
|
|
1426
|
-
"react/no-useless-fragment": "warn",
|
|
1427
1449
|
"react/prefer-destructuring-assignment": "warn",
|
|
1428
1450
|
"react/prefer-shorthand-boolean": "warn",
|
|
1429
1451
|
"react/prefer-shorthand-fragment": "warn",
|
|
@@ -1472,8 +1494,8 @@ async function regexp(options = {}) {
|
|
|
1472
1494
|
function sortPackageJson() {
|
|
1473
1495
|
return [
|
|
1474
1496
|
{
|
|
1475
|
-
name: "luxass/sort/package-json",
|
|
1476
1497
|
files: ["**/package.json"],
|
|
1498
|
+
name: "luxass/sort/package-json",
|
|
1477
1499
|
rules: {
|
|
1478
1500
|
"jsonc/sort-array-values": [
|
|
1479
1501
|
"error",
|
|
@@ -1573,8 +1595,8 @@ function sortPackageJson() {
|
|
|
1573
1595
|
function sortTsconfig() {
|
|
1574
1596
|
return [
|
|
1575
1597
|
{
|
|
1576
|
-
name: "luxass/sort/tsconfig",
|
|
1577
1598
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
1599
|
+
name: "luxass/sort/tsconfig",
|
|
1578
1600
|
rules: {
|
|
1579
1601
|
"jsonc/sort-keys": [
|
|
1580
1602
|
"error",
|
|
@@ -1700,8 +1722,8 @@ function sortTsconfig() {
|
|
|
1700
1722
|
// src/configs/tailwindcss.ts
|
|
1701
1723
|
async function tailwindcss(options = {}) {
|
|
1702
1724
|
const {
|
|
1703
|
-
|
|
1704
|
-
|
|
1725
|
+
configPath,
|
|
1726
|
+
overrides
|
|
1705
1727
|
} = options;
|
|
1706
1728
|
await ensure([
|
|
1707
1729
|
"eslint-plugin-tailwindcss"
|
|
@@ -1713,7 +1735,6 @@ async function tailwindcss(options = {}) {
|
|
|
1713
1735
|
]);
|
|
1714
1736
|
return [
|
|
1715
1737
|
{
|
|
1716
|
-
name: "luxass/tailwindcss",
|
|
1717
1738
|
languageOptions: {
|
|
1718
1739
|
parserOptions: {
|
|
1719
1740
|
ecmaFeatures: {
|
|
@@ -1721,13 +1742,7 @@ async function tailwindcss(options = {}) {
|
|
|
1721
1742
|
}
|
|
1722
1743
|
}
|
|
1723
1744
|
},
|
|
1724
|
-
|
|
1725
|
-
...configPath != null ? {
|
|
1726
|
-
tailwindcss: {
|
|
1727
|
-
config: configPath
|
|
1728
|
-
}
|
|
1729
|
-
} : {}
|
|
1730
|
-
},
|
|
1745
|
+
name: "luxass/tailwindcss",
|
|
1731
1746
|
plugins: {
|
|
1732
1747
|
tailwindcss: pluginTailwindCSS
|
|
1733
1748
|
},
|
|
@@ -1747,6 +1762,13 @@ async function tailwindcss(options = {}) {
|
|
|
1747
1762
|
// https://github.com/francoismassart/eslint-plugin-tailwindcss/blob/master/docs/rules/no-custom-classname.md
|
|
1748
1763
|
"tailwindcss/no-custom-classname": "warn",
|
|
1749
1764
|
...overrides
|
|
1765
|
+
},
|
|
1766
|
+
settings: {
|
|
1767
|
+
...configPath != null ? {
|
|
1768
|
+
tailwindcss: {
|
|
1769
|
+
config: configPath
|
|
1770
|
+
}
|
|
1771
|
+
} : {}
|
|
1750
1772
|
}
|
|
1751
1773
|
}
|
|
1752
1774
|
];
|
|
@@ -1756,8 +1778,8 @@ async function tailwindcss(options = {}) {
|
|
|
1756
1778
|
var _pluginTest;
|
|
1757
1779
|
async function test(options = {}) {
|
|
1758
1780
|
const {
|
|
1759
|
-
isInEditor = false,
|
|
1760
1781
|
files = GLOB_TESTS,
|
|
1782
|
+
isInEditor = false,
|
|
1761
1783
|
overrides = {}
|
|
1762
1784
|
} = options;
|
|
1763
1785
|
const [
|
|
@@ -1774,16 +1796,16 @@ async function test(options = {}) {
|
|
|
1774
1796
|
}
|
|
1775
1797
|
},
|
|
1776
1798
|
{
|
|
1777
|
-
name: "luxass/test/rules",
|
|
1778
1799
|
files,
|
|
1800
|
+
name: "luxass/test/rules",
|
|
1779
1801
|
rules: {
|
|
1780
1802
|
"test/consistent-test-it": [
|
|
1781
1803
|
"error",
|
|
1782
1804
|
{ fn: "it", withinDescribe: "it" }
|
|
1783
1805
|
],
|
|
1806
|
+
"test/no-focused-tests": isInEditor ? "off" : ["error", { fixable: true }],
|
|
1784
1807
|
"test/no-identical-title": "error",
|
|
1785
1808
|
"test/no-import-node-test": "error",
|
|
1786
|
-
"test/no-focused-tests": isInEditor ? "off" : ["error", { fixable: true }],
|
|
1787
1809
|
"test/prefer-hooks-in-order": "error",
|
|
1788
1810
|
"test/prefer-lowercase-title": "error",
|
|
1789
1811
|
// Disables
|
|
@@ -1824,11 +1846,11 @@ async function toml(options = {}) {
|
|
|
1824
1846
|
}
|
|
1825
1847
|
},
|
|
1826
1848
|
{
|
|
1827
|
-
name: "luxass/toml/rules",
|
|
1828
1849
|
files,
|
|
1829
1850
|
languageOptions: {
|
|
1830
1851
|
parser: parserToml
|
|
1831
1852
|
},
|
|
1853
|
+
name: "luxass/toml/rules",
|
|
1832
1854
|
rules: {
|
|
1833
1855
|
"style/spaced-comment": "off",
|
|
1834
1856
|
"toml/comma-style": "error",
|
|
@@ -1865,8 +1887,8 @@ async function typescript(options = {}) {
|
|
|
1865
1887
|
const {
|
|
1866
1888
|
exts = [],
|
|
1867
1889
|
overrides = {},
|
|
1868
|
-
parserOptions = {},
|
|
1869
1890
|
overridesTypeAware = {},
|
|
1891
|
+
parserOptions = {},
|
|
1870
1892
|
type = "app"
|
|
1871
1893
|
} = options ?? {};
|
|
1872
1894
|
const files = options.files ?? [
|
|
@@ -1915,7 +1937,6 @@ async function typescript(options = {}) {
|
|
|
1915
1937
|
return {
|
|
1916
1938
|
files: files2,
|
|
1917
1939
|
...ignores2 ? { ignores: ignores2 } : {},
|
|
1918
|
-
name: `luxass/typescript/${typeAware ? "type-aware-parser" : "parser"}`,
|
|
1919
1940
|
languageOptions: {
|
|
1920
1941
|
parser: parserTs,
|
|
1921
1942
|
parserOptions: {
|
|
@@ -1930,7 +1951,8 @@ async function typescript(options = {}) {
|
|
|
1930
1951
|
} : {},
|
|
1931
1952
|
...parserOptions
|
|
1932
1953
|
}
|
|
1933
|
-
}
|
|
1954
|
+
},
|
|
1955
|
+
name: `luxass/typescript/${typeAware ? "type-aware-parser" : "parser"}`
|
|
1934
1956
|
};
|
|
1935
1957
|
}
|
|
1936
1958
|
return [
|
|
@@ -1947,8 +1969,8 @@ async function typescript(options = {}) {
|
|
|
1947
1969
|
makeParser(false, files, filesTypeAware)
|
|
1948
1970
|
] : [makeParser(false, files)],
|
|
1949
1971
|
{
|
|
1950
|
-
name: "luxass/typescript/rules",
|
|
1951
1972
|
files,
|
|
1973
|
+
name: "luxass/typescript/rules",
|
|
1952
1974
|
rules: {
|
|
1953
1975
|
...renameRules(
|
|
1954
1976
|
pluginTs.configs["eslint-recommended"].overrides[0].rules,
|
|
@@ -1971,14 +1993,18 @@ async function typescript(options = {}) {
|
|
|
1971
1993
|
"ts/ban-ts-comment": [
|
|
1972
1994
|
"error",
|
|
1973
1995
|
{
|
|
1974
|
-
"ts-
|
|
1975
|
-
"ts-
|
|
1996
|
+
"ts-expect-error": "allow-with-description",
|
|
1997
|
+
"ts-ignore": "allow-with-description"
|
|
1976
1998
|
}
|
|
1977
1999
|
],
|
|
1978
2000
|
"ts/consistent-type-definitions": ["error", "interface"],
|
|
1979
2001
|
"ts/consistent-type-imports": [
|
|
1980
2002
|
"error",
|
|
1981
|
-
{
|
|
2003
|
+
{
|
|
2004
|
+
disallowTypeAnnotations: false,
|
|
2005
|
+
fixStyle: "separate-type-imports",
|
|
2006
|
+
prefer: "type-imports"
|
|
2007
|
+
}
|
|
1982
2008
|
],
|
|
1983
2009
|
"ts/method-signature-style": ["error", "property"],
|
|
1984
2010
|
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
|
@@ -2032,9 +2058,6 @@ async function typescript(options = {}) {
|
|
|
2032
2058
|
// src/configs/unicorn.ts
|
|
2033
2059
|
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
2034
2060
|
async function unicorn(options = {}) {
|
|
2035
|
-
if (options.allRecommended && import_eslint_plugin_unicorn.default.configs == null) {
|
|
2036
|
-
throw new Error("The `allRecommended` option requires `eslint-plugin-unicorn` to be installed.");
|
|
2037
|
-
}
|
|
2038
2061
|
return [
|
|
2039
2062
|
{
|
|
2040
2063
|
name: "luxass/unicorn/rules",
|
|
@@ -2042,7 +2065,7 @@ async function unicorn(options = {}) {
|
|
|
2042
2065
|
unicorn: import_eslint_plugin_unicorn.default
|
|
2043
2066
|
},
|
|
2044
2067
|
rules: {
|
|
2045
|
-
...options.allRecommended ? import_eslint_plugin_unicorn.default.configs
|
|
2068
|
+
...options.allRecommended ? import_eslint_plugin_unicorn.default.configs.recommended.rules : {
|
|
2046
2069
|
// Pass error message when throwing errors
|
|
2047
2070
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md
|
|
2048
2071
|
"unicorn/error-message": "error",
|
|
@@ -2050,8 +2073,8 @@ async function unicorn(options = {}) {
|
|
|
2050
2073
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md
|
|
2051
2074
|
"unicorn/escape-case": "error",
|
|
2052
2075
|
// Array.isArray instead of instanceof
|
|
2053
|
-
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-
|
|
2054
|
-
"unicorn/no-instanceof-
|
|
2076
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-builtins.md
|
|
2077
|
+
"unicorn/no-instanceof-builtins": "error",
|
|
2055
2078
|
// Ban `new Array` as `Array` constructor's params are ambiguous
|
|
2056
2079
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-array.md
|
|
2057
2080
|
"unicorn/no-new-array": "error",
|
|
@@ -2092,9 +2115,9 @@ async function unicorn(options = {}) {
|
|
|
2092
2115
|
async function unocss(options = {}) {
|
|
2093
2116
|
const {
|
|
2094
2117
|
attributify = true,
|
|
2118
|
+
configPath,
|
|
2095
2119
|
overrides,
|
|
2096
|
-
strict = false
|
|
2097
|
-
configPath
|
|
2120
|
+
strict = false
|
|
2098
2121
|
} = options;
|
|
2099
2122
|
await ensure([
|
|
2100
2123
|
"@unocss/eslint-plugin"
|
|
@@ -2110,13 +2133,6 @@ async function unocss(options = {}) {
|
|
|
2110
2133
|
plugins: {
|
|
2111
2134
|
unocss: pluginUnoCSS
|
|
2112
2135
|
},
|
|
2113
|
-
settings: {
|
|
2114
|
-
...configPath != null ? {
|
|
2115
|
-
unocss: {
|
|
2116
|
-
configPath
|
|
2117
|
-
}
|
|
2118
|
-
} : {}
|
|
2119
|
-
},
|
|
2120
2136
|
rules: {
|
|
2121
2137
|
"unocss/order": "warn",
|
|
2122
2138
|
...attributify ? {
|
|
@@ -2126,6 +2142,13 @@ async function unocss(options = {}) {
|
|
|
2126
2142
|
"unocss/blocklist": "error"
|
|
2127
2143
|
} : {},
|
|
2128
2144
|
...overrides
|
|
2145
|
+
},
|
|
2146
|
+
settings: {
|
|
2147
|
+
...configPath != null ? {
|
|
2148
|
+
unocss: {
|
|
2149
|
+
configPath
|
|
2150
|
+
}
|
|
2151
|
+
} : {}
|
|
2129
2152
|
}
|
|
2130
2153
|
}
|
|
2131
2154
|
];
|
|
@@ -2154,7 +2177,6 @@ async function vue(options = {}) {
|
|
|
2154
2177
|
} = typeof stylistic2 === "boolean" ? {} : stylistic2;
|
|
2155
2178
|
return [
|
|
2156
2179
|
{
|
|
2157
|
-
name: "luxass/vue/setup",
|
|
2158
2180
|
// This allows Vue plugin to work with auto imports
|
|
2159
2181
|
// https://github.com/vuejs/eslint-plugin-vue/pull/2422
|
|
2160
2182
|
languageOptions: {
|
|
@@ -2175,12 +2197,12 @@ async function vue(options = {}) {
|
|
|
2175
2197
|
watchEffect: "readonly"
|
|
2176
2198
|
}
|
|
2177
2199
|
},
|
|
2200
|
+
name: "luxass/vue/setup",
|
|
2178
2201
|
plugins: {
|
|
2179
2202
|
vue: pluginVue
|
|
2180
2203
|
}
|
|
2181
2204
|
},
|
|
2182
2205
|
{
|
|
2183
|
-
name: "luxass/vue/rules",
|
|
2184
2206
|
files,
|
|
2185
2207
|
languageOptions: {
|
|
2186
2208
|
parser: parserVue,
|
|
@@ -2193,6 +2215,7 @@ async function vue(options = {}) {
|
|
|
2193
2215
|
sourceType: "module"
|
|
2194
2216
|
}
|
|
2195
2217
|
},
|
|
2218
|
+
name: "luxass/vue/rules",
|
|
2196
2219
|
processor: sfcBlocks === false ? pluginVue.processors[".vue"] : (0, import_eslint_merge_processors2.mergeProcessors)([
|
|
2197
2220
|
pluginVue.processors[".vue"],
|
|
2198
2221
|
processorVueBlocks({
|
|
@@ -2205,9 +2228,9 @@ async function vue(options = {}) {
|
|
|
2205
2228
|
]),
|
|
2206
2229
|
rules: {
|
|
2207
2230
|
...pluginVue.configs.base.rules,
|
|
2208
|
-
...pluginVue.configs["
|
|
2209
|
-
...pluginVue.configs["
|
|
2210
|
-
...pluginVue.configs["
|
|
2231
|
+
...pluginVue.configs["flat/essential"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
2232
|
+
...pluginVue.configs["flat/strongly-recommended"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
2233
|
+
...pluginVue.configs["flat/recommended"].map((c) => c.rules).reduce((acc, c) => ({ ...acc, ...c }), {}),
|
|
2211
2234
|
"antfu/no-top-level-await": "off",
|
|
2212
2235
|
"node/prefer-global/process": "off",
|
|
2213
2236
|
"ts/explicit-function-return-type": "off",
|
|
@@ -2346,11 +2369,11 @@ async function yaml(options = {}) {
|
|
|
2346
2369
|
}
|
|
2347
2370
|
},
|
|
2348
2371
|
{
|
|
2349
|
-
name: "luxass/yaml/rules",
|
|
2350
2372
|
files,
|
|
2351
2373
|
languageOptions: {
|
|
2352
2374
|
parser: parserYaml
|
|
2353
2375
|
},
|
|
2376
|
+
name: "luxass/yaml/rules",
|
|
2354
2377
|
rules: {
|
|
2355
2378
|
"style/spaced-comment": "off",
|
|
2356
2379
|
"yaml/block-mapping": "error",
|
|
@@ -2397,16 +2420,16 @@ var VuePackages = [
|
|
|
2397
2420
|
"@slidev/cli"
|
|
2398
2421
|
];
|
|
2399
2422
|
var defaultPluginRenaming = {
|
|
2423
|
+
"@eslint-react": "react",
|
|
2424
|
+
"@eslint-react/dom": "react-dom",
|
|
2425
|
+
"@eslint-react/hooks-extra": "react-hooks-extra",
|
|
2426
|
+
"@eslint-react/naming-convention": "react-naming-convention",
|
|
2400
2427
|
"@stylistic": "style",
|
|
2401
2428
|
"@typescript-eslint": "ts",
|
|
2402
2429
|
"import-x": "import",
|
|
2403
2430
|
"n": "node",
|
|
2404
2431
|
"vitest": "test",
|
|
2405
|
-
"yml": "yaml"
|
|
2406
|
-
"@eslint-react": "react",
|
|
2407
|
-
"@eslint-react/dom": "react-dom",
|
|
2408
|
-
"@eslint-react/hooks-extra": "react-hooks-extra",
|
|
2409
|
-
"@eslint-react/naming-convention": "react-naming-convention"
|
|
2432
|
+
"yml": "yaml"
|
|
2410
2433
|
};
|
|
2411
2434
|
function luxass(options = {}, ...userConfigs) {
|
|
2412
2435
|
const {
|
|
@@ -2417,12 +2440,12 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2417
2440
|
jsx: enableJsx = true,
|
|
2418
2441
|
react: enableReact = false,
|
|
2419
2442
|
regexp: enableRegexp = true,
|
|
2443
|
+
tailwindcss: enableTailwindCSS = false,
|
|
2444
|
+
type: projectType = "app",
|
|
2420
2445
|
typescript: enableTypeScript = (0, import_local_pkg3.isPackageExists)("typescript"),
|
|
2421
2446
|
unicorn: enableUnicorn = true,
|
|
2422
2447
|
unocss: enableUnoCSS = false,
|
|
2423
|
-
|
|
2424
|
-
vue: enableVue = VuePackages.some((i) => (0, import_local_pkg3.isPackageExists)(i)),
|
|
2425
|
-
type: projectType = "app"
|
|
2448
|
+
vue: enableVue = VuePackages.some((i) => (0, import_local_pkg3.isPackageExists)(i))
|
|
2426
2449
|
} = options;
|
|
2427
2450
|
let isInEditor = options.isInEditor;
|
|
2428
2451
|
if (isInEditor == null) {
|
|
@@ -2602,7 +2625,7 @@ function luxass(options = {}, ...userConfigs) {
|
|
|
2602
2625
|
}
|
|
2603
2626
|
|
|
2604
2627
|
// src/index.ts
|
|
2605
|
-
var
|
|
2628
|
+
var index_default = luxass;
|
|
2606
2629
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2607
2630
|
0 && (module.exports = {
|
|
2608
2631
|
GLOB_ASTRO,
|