@luxass/eslint-config 4.2.12 → 4.2.14
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 +105 -12
- package/dist/index.d.cts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +103 -12
- package/package.json +17 -6
package/dist/index.cjs
CHANGED
|
@@ -33,6 +33,7 @@ __export(src_exports, {
|
|
|
33
33
|
GLOB_ASTRO: () => GLOB_ASTRO,
|
|
34
34
|
GLOB_CSS: () => GLOB_CSS,
|
|
35
35
|
GLOB_EXCLUDE: () => GLOB_EXCLUDE,
|
|
36
|
+
GLOB_GRAPHQL: () => GLOB_GRAPHQL,
|
|
36
37
|
GLOB_HTML: () => GLOB_HTML,
|
|
37
38
|
GLOB_JS: () => GLOB_JS,
|
|
38
39
|
GLOB_JSON: () => GLOB_JSON,
|
|
@@ -59,6 +60,7 @@ __export(src_exports, {
|
|
|
59
60
|
astro: () => astro,
|
|
60
61
|
combine: () => combine,
|
|
61
62
|
comments: () => comments,
|
|
63
|
+
default: () => src_default,
|
|
62
64
|
ensure: () => ensure,
|
|
63
65
|
formatters: () => formatters,
|
|
64
66
|
getOverrides: () => getOverrides,
|
|
@@ -75,6 +77,7 @@ __export(src_exports, {
|
|
|
75
77
|
react: () => react,
|
|
76
78
|
renameRules: () => renameRules,
|
|
77
79
|
resolveSubOptions: () => resolveSubOptions,
|
|
80
|
+
solid: () => solid,
|
|
78
81
|
sortPackageJson: () => sortPackageJson,
|
|
79
82
|
sortTsconfig: () => sortTsconfig,
|
|
80
83
|
stylistic: () => stylistic,
|
|
@@ -195,6 +198,7 @@ var GLOB_YAML = "**/*.y?(a)ml";
|
|
|
195
198
|
var GLOB_TOML = "**/*.toml";
|
|
196
199
|
var GLOB_HTML = "**/*.htm?(l)";
|
|
197
200
|
var GLOB_ASTRO = "**/*.astro";
|
|
201
|
+
var GLOB_GRAPHQL = "**/*.{g,graph}ql";
|
|
198
202
|
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
199
203
|
var GLOB_TESTS = [
|
|
200
204
|
`**/__tests__/**/*.${GLOB_SRC_EXT}`,
|
|
@@ -866,7 +870,7 @@ function getOverrides(options, key) {
|
|
|
866
870
|
};
|
|
867
871
|
}
|
|
868
872
|
|
|
869
|
-
// src/configs/
|
|
873
|
+
// src/configs/jsdoc.ts
|
|
870
874
|
async function jsdoc(options = {}) {
|
|
871
875
|
const {
|
|
872
876
|
overrides,
|
|
@@ -904,7 +908,7 @@ async function jsdoc(options = {}) {
|
|
|
904
908
|
];
|
|
905
909
|
}
|
|
906
910
|
|
|
907
|
-
// src/configs/
|
|
911
|
+
// src/configs/json.ts
|
|
908
912
|
async function jsonc(options = {}) {
|
|
909
913
|
const {
|
|
910
914
|
files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
@@ -985,7 +989,7 @@ async function jsonc(options = {}) {
|
|
|
985
989
|
];
|
|
986
990
|
}
|
|
987
991
|
|
|
988
|
-
// src/configs/
|
|
992
|
+
// src/configs/markdown.ts
|
|
989
993
|
var parserPlain = __toESM(require("eslint-parser-plain"), 1);
|
|
990
994
|
var import_eslint_merge_processors = require("eslint-merge-processors");
|
|
991
995
|
async function markdown(options = {}) {
|
|
@@ -1333,7 +1337,7 @@ async function typescript(options = {}) {
|
|
|
1333
1337
|
];
|
|
1334
1338
|
}
|
|
1335
1339
|
|
|
1336
|
-
// src/configs/
|
|
1340
|
+
// src/configs/vue.ts
|
|
1337
1341
|
var import_eslint_merge_processors2 = require("eslint-merge-processors");
|
|
1338
1342
|
async function vue(options = {}) {
|
|
1339
1343
|
const {
|
|
@@ -1520,7 +1524,7 @@ async function vue(options = {}) {
|
|
|
1520
1524
|
];
|
|
1521
1525
|
}
|
|
1522
1526
|
|
|
1523
|
-
// src/configs/
|
|
1527
|
+
// src/configs/yaml.ts
|
|
1524
1528
|
async function yaml(options = {}) {
|
|
1525
1529
|
const {
|
|
1526
1530
|
files = [GLOB_YAML],
|
|
@@ -1633,7 +1637,7 @@ async function test(options = {}) {
|
|
|
1633
1637
|
];
|
|
1634
1638
|
}
|
|
1635
1639
|
|
|
1636
|
-
// src/configs/
|
|
1640
|
+
// src/configs/unocss.ts
|
|
1637
1641
|
async function unocss(options = {}) {
|
|
1638
1642
|
const {
|
|
1639
1643
|
attributify = true,
|
|
@@ -1670,7 +1674,7 @@ async function unocss(options = {}) {
|
|
|
1670
1674
|
];
|
|
1671
1675
|
}
|
|
1672
1676
|
|
|
1673
|
-
// src/configs/
|
|
1677
|
+
// src/configs/nextjs.ts
|
|
1674
1678
|
async function nextjs(options = {}) {
|
|
1675
1679
|
const {
|
|
1676
1680
|
files = [GLOB_SRC],
|
|
@@ -1753,7 +1757,7 @@ async function nextjs(options = {}) {
|
|
|
1753
1757
|
];
|
|
1754
1758
|
}
|
|
1755
1759
|
|
|
1756
|
-
// src/configs/
|
|
1760
|
+
// src/configs/react.ts
|
|
1757
1761
|
var import_local_pkg2 = require("local-pkg");
|
|
1758
1762
|
async function react(options = {}) {
|
|
1759
1763
|
const {
|
|
@@ -2032,7 +2036,7 @@ async function react(options = {}) {
|
|
|
2032
2036
|
];
|
|
2033
2037
|
}
|
|
2034
2038
|
|
|
2035
|
-
// src/configs/
|
|
2039
|
+
// src/configs/astro.ts
|
|
2036
2040
|
async function astro(options) {
|
|
2037
2041
|
const {
|
|
2038
2042
|
files = [GLOB_ASTRO],
|
|
@@ -2125,7 +2129,7 @@ async function astro(options) {
|
|
|
2125
2129
|
];
|
|
2126
2130
|
}
|
|
2127
2131
|
|
|
2128
|
-
// src/configs/
|
|
2132
|
+
// src/configs/tailwindcss.ts
|
|
2129
2133
|
async function tailwindcss(options = {}) {
|
|
2130
2134
|
const {
|
|
2131
2135
|
files = [GLOB_SRC],
|
|
@@ -2348,7 +2352,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
2348
2352
|
if (options.graphql) {
|
|
2349
2353
|
configs.push({
|
|
2350
2354
|
name: "luxass:formatter:graphql",
|
|
2351
|
-
files: [
|
|
2355
|
+
files: [GLOB_GRAPHQL],
|
|
2352
2356
|
languageOptions: {
|
|
2353
2357
|
parser: parserPlain2
|
|
2354
2358
|
},
|
|
@@ -2366,7 +2370,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
2366
2370
|
return configs;
|
|
2367
2371
|
}
|
|
2368
2372
|
|
|
2369
|
-
// src/configs/
|
|
2373
|
+
// src/configs/toml.ts
|
|
2370
2374
|
async function toml(options = {}) {
|
|
2371
2375
|
const {
|
|
2372
2376
|
files = [GLOB_TOML],
|
|
@@ -2425,6 +2429,80 @@ async function toml(options = {}) {
|
|
|
2425
2429
|
];
|
|
2426
2430
|
}
|
|
2427
2431
|
|
|
2432
|
+
// src/configs/solid.ts
|
|
2433
|
+
async function solid(options = {}) {
|
|
2434
|
+
const {
|
|
2435
|
+
overrides = {},
|
|
2436
|
+
typescript: typescript2 = true,
|
|
2437
|
+
files = [GLOB_JSX, GLOB_TSX]
|
|
2438
|
+
} = options;
|
|
2439
|
+
await ensure([
|
|
2440
|
+
"eslint-plugin-solid"
|
|
2441
|
+
]);
|
|
2442
|
+
const [
|
|
2443
|
+
pluginSolid
|
|
2444
|
+
] = await Promise.all([
|
|
2445
|
+
interop(import("eslint-plugin-solid"))
|
|
2446
|
+
]);
|
|
2447
|
+
return [
|
|
2448
|
+
{
|
|
2449
|
+
name: "luxass:solid:setup",
|
|
2450
|
+
plugins: {
|
|
2451
|
+
solid: pluginSolid
|
|
2452
|
+
}
|
|
2453
|
+
},
|
|
2454
|
+
{
|
|
2455
|
+
name: "luxass:solid:rules",
|
|
2456
|
+
files,
|
|
2457
|
+
languageOptions: {
|
|
2458
|
+
parserOptions: {
|
|
2459
|
+
ecmaFeatures: {
|
|
2460
|
+
jsx: true
|
|
2461
|
+
}
|
|
2462
|
+
},
|
|
2463
|
+
sourceType: "module"
|
|
2464
|
+
},
|
|
2465
|
+
rules: {
|
|
2466
|
+
// solid recommended rules
|
|
2467
|
+
// reactivity
|
|
2468
|
+
"solid/components-return-once": "warn",
|
|
2469
|
+
"solid/event-handlers": "warn",
|
|
2470
|
+
// these rules are mostly style suggestions
|
|
2471
|
+
"solid/imports": "warn",
|
|
2472
|
+
// identifier usage is important
|
|
2473
|
+
"solid/jsx-no-duplicate-props": "error",
|
|
2474
|
+
"solid/jsx-no-script-url": "error",
|
|
2475
|
+
"solid/jsx-no-undef": "error",
|
|
2476
|
+
"solid/jsx-uses-vars": "error",
|
|
2477
|
+
"solid/no-array-handlers": "off",
|
|
2478
|
+
"solid/no-destructure": "error",
|
|
2479
|
+
// security problems
|
|
2480
|
+
"solid/no-innerhtml": "error",
|
|
2481
|
+
// only necessary for resource-constrained environments
|
|
2482
|
+
"solid/no-proxy-apis": "off",
|
|
2483
|
+
"solid/no-react-deps": "warn",
|
|
2484
|
+
"solid/no-react-specific-props": "warn",
|
|
2485
|
+
"solid/no-unknown-namespaces": "error",
|
|
2486
|
+
// deprecated
|
|
2487
|
+
"solid/prefer-classlist": "off",
|
|
2488
|
+
"solid/prefer-for": "error",
|
|
2489
|
+
// handled by Solid compiler, opt-in style suggestion
|
|
2490
|
+
"solid/prefer-show": "off",
|
|
2491
|
+
"solid/reactivity": "warn",
|
|
2492
|
+
"solid/self-closing-comp": "warn",
|
|
2493
|
+
"solid/style-prop": "warn",
|
|
2494
|
+
...typescript2 ? {
|
|
2495
|
+
"solid/jsx-no-undef": ["error", { typescriptEnabled: true }],
|
|
2496
|
+
// namespaces taken care of by TS
|
|
2497
|
+
"solid/no-unknown-namespaces": "off"
|
|
2498
|
+
} : {},
|
|
2499
|
+
// overrides
|
|
2500
|
+
...overrides
|
|
2501
|
+
}
|
|
2502
|
+
}
|
|
2503
|
+
];
|
|
2504
|
+
}
|
|
2505
|
+
|
|
2428
2506
|
// src/factory.ts
|
|
2429
2507
|
var FLAT_CONFIG_PROPS = [
|
|
2430
2508
|
"name",
|
|
@@ -2452,6 +2530,7 @@ async function luxass(options = {}, ...userConfigs) {
|
|
|
2452
2530
|
nextjs: enableNextJS = false,
|
|
2453
2531
|
react: enableReact = false,
|
|
2454
2532
|
tailwindcss: enableTailwindCSS = false,
|
|
2533
|
+
solid: enableSolid = false,
|
|
2455
2534
|
typescript: enableTypeScript = (0, import_local_pkg4.isPackageExists)("typescript"),
|
|
2456
2535
|
unocss: enableUnoCSS = false,
|
|
2457
2536
|
vue: enableVue = VuePackages.some((i) => (0, import_local_pkg4.isPackageExists)(i))
|
|
@@ -2522,6 +2601,15 @@ async function luxass(options = {}, ...userConfigs) {
|
|
|
2522
2601
|
})
|
|
2523
2602
|
);
|
|
2524
2603
|
}
|
|
2604
|
+
if (enableSolid) {
|
|
2605
|
+
configs.push(
|
|
2606
|
+
solid({
|
|
2607
|
+
...resolveSubOptions(options, "solid"),
|
|
2608
|
+
overrides: getOverrides(options, "solid"),
|
|
2609
|
+
typescript: !!enableTypeScript
|
|
2610
|
+
})
|
|
2611
|
+
);
|
|
2612
|
+
}
|
|
2525
2613
|
if (enableVue) {
|
|
2526
2614
|
configs.push(
|
|
2527
2615
|
vue({
|
|
@@ -2604,11 +2692,15 @@ async function luxass(options = {}, ...userConfigs) {
|
|
|
2604
2692
|
);
|
|
2605
2693
|
return merged;
|
|
2606
2694
|
}
|
|
2695
|
+
|
|
2696
|
+
// src/index.ts
|
|
2697
|
+
var src_default = luxass;
|
|
2607
2698
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2608
2699
|
0 && (module.exports = {
|
|
2609
2700
|
GLOB_ASTRO,
|
|
2610
2701
|
GLOB_CSS,
|
|
2611
2702
|
GLOB_EXCLUDE,
|
|
2703
|
+
GLOB_GRAPHQL,
|
|
2612
2704
|
GLOB_HTML,
|
|
2613
2705
|
GLOB_JS,
|
|
2614
2706
|
GLOB_JSON,
|
|
@@ -2651,6 +2743,7 @@ async function luxass(options = {}, ...userConfigs) {
|
|
|
2651
2743
|
react,
|
|
2652
2744
|
renameRules,
|
|
2653
2745
|
resolveSubOptions,
|
|
2746
|
+
solid,
|
|
2654
2747
|
sortPackageJson,
|
|
2655
2748
|
sortTsconfig,
|
|
2656
2749
|
stylistic,
|
package/dist/index.d.cts
CHANGED
|
@@ -521,6 +521,27 @@ interface TOMLOptions {
|
|
|
521
521
|
}
|
|
522
522
|
declare function toml(options?: TOMLOptions): Promise<FlatConfigItem[]>;
|
|
523
523
|
|
|
524
|
+
interface SolidOptions {
|
|
525
|
+
/**
|
|
526
|
+
* Override rules.
|
|
527
|
+
*/
|
|
528
|
+
overrides?: FlatConfigItem['rules'];
|
|
529
|
+
/**
|
|
530
|
+
* Enable TypeScript support.
|
|
531
|
+
*
|
|
532
|
+
* @default true
|
|
533
|
+
*/
|
|
534
|
+
typescript?: boolean;
|
|
535
|
+
/**
|
|
536
|
+
* Glob patterns for JSX & TSX files.
|
|
537
|
+
*
|
|
538
|
+
* @default [GLOB_JSX, GLOB_TSX]
|
|
539
|
+
* @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
|
|
540
|
+
*/
|
|
541
|
+
files?: string[];
|
|
542
|
+
}
|
|
543
|
+
declare function solid(options?: SolidOptions): Promise<FlatConfigItem[]>;
|
|
544
|
+
|
|
524
545
|
type WrapRuleConfig<T extends {
|
|
525
546
|
[key: string]: any;
|
|
526
547
|
}> = {
|
|
@@ -686,6 +707,15 @@ interface ConfigOptions {
|
|
|
686
707
|
* @default []
|
|
687
708
|
*/
|
|
688
709
|
exts?: string[];
|
|
710
|
+
/**
|
|
711
|
+
* Enable Solid support.
|
|
712
|
+
*
|
|
713
|
+
* Requires installing:
|
|
714
|
+
* - `eslint-plugin-solid`
|
|
715
|
+
*
|
|
716
|
+
* @default false
|
|
717
|
+
*/
|
|
718
|
+
solid?: boolean | SolidOptions;
|
|
689
719
|
}
|
|
690
720
|
|
|
691
721
|
declare function luxass(options?: ConfigOptions & FlatConfigItem, ...userConfigs: Awaitable<UserConfigItem | UserConfigItem[]>[]): Promise<UserConfigItem[]>;
|
|
@@ -711,6 +741,7 @@ declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
|
711
741
|
declare const GLOB_TOML = "**/*.toml";
|
|
712
742
|
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
713
743
|
declare const GLOB_ASTRO = "**/*.astro";
|
|
744
|
+
declare const GLOB_GRAPHQL = "**/*.{g,graph}ql";
|
|
714
745
|
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
715
746
|
declare const GLOB_TESTS: string[];
|
|
716
747
|
declare const GLOB_NEXTJS_OG: string[];
|
|
@@ -733,4 +764,4 @@ type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
|
733
764
|
declare function resolveSubOptions<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): ResolvedOptions<ConfigOptions[K]>;
|
|
734
765
|
declare function getOverrides<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): any;
|
|
735
766
|
|
|
736
|
-
export { type AstroOptions, type Awaitable, type ConfigOptions, type FlatConfigItem, type FormattersOptions, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NEXTJS_OG, GLOB_NEXTJS_ROUTES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type ImportsOptions, type JSDOCOptions, type JSONOptions, type JavaScriptOptions, type MarkdownOptions, type NextJSOptions, type ReactOptions, type ResolvedOptions, type Rules, type StylisticConfig, type StylisticOptions, type TOMLOptions, type TailwindCSSOptions, type TestOptions, type TypeScriptOptions, type UnoCSSOptions, type UserConfigItem, type VueOptions, type WrapRuleConfig, type YAMLOptions, astro, combine, comments, ensure, formatters, getOverrides, ignores, imports, interop, javascript, jsdoc, jsonc, luxass, markdown, nextjs, node, react, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
|
767
|
+
export { type AstroOptions, type Awaitable, type ConfigOptions, type FlatConfigItem, type FormattersOptions, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NEXTJS_OG, GLOB_NEXTJS_ROUTES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type ImportsOptions, type JSDOCOptions, type JSONOptions, type JavaScriptOptions, type MarkdownOptions, type NextJSOptions, type ReactOptions, type ResolvedOptions, type Rules, type SolidOptions, type StylisticConfig, type StylisticOptions, type TOMLOptions, type TailwindCSSOptions, type TestOptions, type TypeScriptOptions, type UnoCSSOptions, type UserConfigItem, type VueOptions, type WrapRuleConfig, type YAMLOptions, astro, combine, comments, luxass as default, ensure, formatters, getOverrides, ignores, imports, interop, javascript, jsdoc, jsonc, luxass, markdown, nextjs, node, react, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
package/dist/index.d.ts
CHANGED
|
@@ -521,6 +521,27 @@ interface TOMLOptions {
|
|
|
521
521
|
}
|
|
522
522
|
declare function toml(options?: TOMLOptions): Promise<FlatConfigItem[]>;
|
|
523
523
|
|
|
524
|
+
interface SolidOptions {
|
|
525
|
+
/**
|
|
526
|
+
* Override rules.
|
|
527
|
+
*/
|
|
528
|
+
overrides?: FlatConfigItem['rules'];
|
|
529
|
+
/**
|
|
530
|
+
* Enable TypeScript support.
|
|
531
|
+
*
|
|
532
|
+
* @default true
|
|
533
|
+
*/
|
|
534
|
+
typescript?: boolean;
|
|
535
|
+
/**
|
|
536
|
+
* Glob patterns for JSX & TSX files.
|
|
537
|
+
*
|
|
538
|
+
* @default [GLOB_JSX, GLOB_TSX]
|
|
539
|
+
* @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
|
|
540
|
+
*/
|
|
541
|
+
files?: string[];
|
|
542
|
+
}
|
|
543
|
+
declare function solid(options?: SolidOptions): Promise<FlatConfigItem[]>;
|
|
544
|
+
|
|
524
545
|
type WrapRuleConfig<T extends {
|
|
525
546
|
[key: string]: any;
|
|
526
547
|
}> = {
|
|
@@ -686,6 +707,15 @@ interface ConfigOptions {
|
|
|
686
707
|
* @default []
|
|
687
708
|
*/
|
|
688
709
|
exts?: string[];
|
|
710
|
+
/**
|
|
711
|
+
* Enable Solid support.
|
|
712
|
+
*
|
|
713
|
+
* Requires installing:
|
|
714
|
+
* - `eslint-plugin-solid`
|
|
715
|
+
*
|
|
716
|
+
* @default false
|
|
717
|
+
*/
|
|
718
|
+
solid?: boolean | SolidOptions;
|
|
689
719
|
}
|
|
690
720
|
|
|
691
721
|
declare function luxass(options?: ConfigOptions & FlatConfigItem, ...userConfigs: Awaitable<UserConfigItem | UserConfigItem[]>[]): Promise<UserConfigItem[]>;
|
|
@@ -711,6 +741,7 @@ declare const GLOB_YAML = "**/*.y?(a)ml";
|
|
|
711
741
|
declare const GLOB_TOML = "**/*.toml";
|
|
712
742
|
declare const GLOB_HTML = "**/*.htm?(l)";
|
|
713
743
|
declare const GLOB_ASTRO = "**/*.astro";
|
|
744
|
+
declare const GLOB_GRAPHQL = "**/*.{g,graph}ql";
|
|
714
745
|
declare const GLOB_MARKDOWN_CODE = "**/*.md/**/*.?([cm])[jt]s?(x)";
|
|
715
746
|
declare const GLOB_TESTS: string[];
|
|
716
747
|
declare const GLOB_NEXTJS_OG: string[];
|
|
@@ -733,4 +764,4 @@ type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
|
733
764
|
declare function resolveSubOptions<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): ResolvedOptions<ConfigOptions[K]>;
|
|
734
765
|
declare function getOverrides<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): any;
|
|
735
766
|
|
|
736
|
-
export { type AstroOptions, type Awaitable, type ConfigOptions, type FlatConfigItem, type FormattersOptions, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NEXTJS_OG, GLOB_NEXTJS_ROUTES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type ImportsOptions, type JSDOCOptions, type JSONOptions, type JavaScriptOptions, type MarkdownOptions, type NextJSOptions, type ReactOptions, type ResolvedOptions, type Rules, type StylisticConfig, type StylisticOptions, type TOMLOptions, type TailwindCSSOptions, type TestOptions, type TypeScriptOptions, type UnoCSSOptions, type UserConfigItem, type VueOptions, type WrapRuleConfig, type YAMLOptions, astro, combine, comments, ensure, formatters, getOverrides, ignores, imports, interop, javascript, jsdoc, jsonc, luxass, markdown, nextjs, node, react, renameRules, resolveSubOptions, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
|
767
|
+
export { type AstroOptions, type Awaitable, type ConfigOptions, type FlatConfigItem, type FormattersOptions, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NEXTJS_OG, GLOB_NEXTJS_ROUTES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type ImportsOptions, type JSDOCOptions, type JSONOptions, type JavaScriptOptions, type MarkdownOptions, type NextJSOptions, type ReactOptions, type ResolvedOptions, type Rules, type SolidOptions, type StylisticConfig, type StylisticOptions, type TOMLOptions, type TailwindCSSOptions, type TestOptions, type TypeScriptOptions, type UnoCSSOptions, type UserConfigItem, type VueOptions, type WrapRuleConfig, type YAMLOptions, astro, combine, comments, luxass as default, ensure, formatters, getOverrides, ignores, imports, interop, javascript, jsdoc, jsonc, luxass, markdown, nextjs, node, react, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
package/dist/index.js
CHANGED
|
@@ -103,6 +103,7 @@ var GLOB_YAML = "**/*.y?(a)ml";
|
|
|
103
103
|
var GLOB_TOML = "**/*.toml";
|
|
104
104
|
var GLOB_HTML = "**/*.htm?(l)";
|
|
105
105
|
var GLOB_ASTRO = "**/*.astro";
|
|
106
|
+
var GLOB_GRAPHQL = "**/*.{g,graph}ql";
|
|
106
107
|
var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
|
|
107
108
|
var GLOB_TESTS = [
|
|
108
109
|
`**/__tests__/**/*.${GLOB_SRC_EXT}`,
|
|
@@ -774,7 +775,7 @@ function getOverrides(options, key) {
|
|
|
774
775
|
};
|
|
775
776
|
}
|
|
776
777
|
|
|
777
|
-
// src/configs/
|
|
778
|
+
// src/configs/jsdoc.ts
|
|
778
779
|
async function jsdoc(options = {}) {
|
|
779
780
|
const {
|
|
780
781
|
overrides,
|
|
@@ -812,7 +813,7 @@ async function jsdoc(options = {}) {
|
|
|
812
813
|
];
|
|
813
814
|
}
|
|
814
815
|
|
|
815
|
-
// src/configs/
|
|
816
|
+
// src/configs/json.ts
|
|
816
817
|
async function jsonc(options = {}) {
|
|
817
818
|
const {
|
|
818
819
|
files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
@@ -893,7 +894,7 @@ async function jsonc(options = {}) {
|
|
|
893
894
|
];
|
|
894
895
|
}
|
|
895
896
|
|
|
896
|
-
// src/configs/
|
|
897
|
+
// src/configs/markdown.ts
|
|
897
898
|
import * as parserPlain from "eslint-parser-plain";
|
|
898
899
|
import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
899
900
|
async function markdown(options = {}) {
|
|
@@ -1241,7 +1242,7 @@ async function typescript(options = {}) {
|
|
|
1241
1242
|
];
|
|
1242
1243
|
}
|
|
1243
1244
|
|
|
1244
|
-
// src/configs/
|
|
1245
|
+
// src/configs/vue.ts
|
|
1245
1246
|
import { mergeProcessors as mergeProcessors2 } from "eslint-merge-processors";
|
|
1246
1247
|
async function vue(options = {}) {
|
|
1247
1248
|
const {
|
|
@@ -1428,7 +1429,7 @@ async function vue(options = {}) {
|
|
|
1428
1429
|
];
|
|
1429
1430
|
}
|
|
1430
1431
|
|
|
1431
|
-
// src/configs/
|
|
1432
|
+
// src/configs/yaml.ts
|
|
1432
1433
|
async function yaml(options = {}) {
|
|
1433
1434
|
const {
|
|
1434
1435
|
files = [GLOB_YAML],
|
|
@@ -1541,7 +1542,7 @@ async function test(options = {}) {
|
|
|
1541
1542
|
];
|
|
1542
1543
|
}
|
|
1543
1544
|
|
|
1544
|
-
// src/configs/
|
|
1545
|
+
// src/configs/unocss.ts
|
|
1545
1546
|
async function unocss(options = {}) {
|
|
1546
1547
|
const {
|
|
1547
1548
|
attributify = true,
|
|
@@ -1578,7 +1579,7 @@ async function unocss(options = {}) {
|
|
|
1578
1579
|
];
|
|
1579
1580
|
}
|
|
1580
1581
|
|
|
1581
|
-
// src/configs/
|
|
1582
|
+
// src/configs/nextjs.ts
|
|
1582
1583
|
async function nextjs(options = {}) {
|
|
1583
1584
|
const {
|
|
1584
1585
|
files = [GLOB_SRC],
|
|
@@ -1661,7 +1662,7 @@ async function nextjs(options = {}) {
|
|
|
1661
1662
|
];
|
|
1662
1663
|
}
|
|
1663
1664
|
|
|
1664
|
-
// src/configs/
|
|
1665
|
+
// src/configs/react.ts
|
|
1665
1666
|
import { isPackageExists as isPackageExists2 } from "local-pkg";
|
|
1666
1667
|
async function react(options = {}) {
|
|
1667
1668
|
const {
|
|
@@ -1940,7 +1941,7 @@ async function react(options = {}) {
|
|
|
1940
1941
|
];
|
|
1941
1942
|
}
|
|
1942
1943
|
|
|
1943
|
-
// src/configs/
|
|
1944
|
+
// src/configs/astro.ts
|
|
1944
1945
|
async function astro(options) {
|
|
1945
1946
|
const {
|
|
1946
1947
|
files = [GLOB_ASTRO],
|
|
@@ -2033,7 +2034,7 @@ async function astro(options) {
|
|
|
2033
2034
|
];
|
|
2034
2035
|
}
|
|
2035
2036
|
|
|
2036
|
-
// src/configs/
|
|
2037
|
+
// src/configs/tailwindcss.ts
|
|
2037
2038
|
async function tailwindcss(options = {}) {
|
|
2038
2039
|
const {
|
|
2039
2040
|
files = [GLOB_SRC],
|
|
@@ -2256,7 +2257,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
2256
2257
|
if (options.graphql) {
|
|
2257
2258
|
configs.push({
|
|
2258
2259
|
name: "luxass:formatter:graphql",
|
|
2259
|
-
files: [
|
|
2260
|
+
files: [GLOB_GRAPHQL],
|
|
2260
2261
|
languageOptions: {
|
|
2261
2262
|
parser: parserPlain2
|
|
2262
2263
|
},
|
|
@@ -2274,7 +2275,7 @@ async function formatters(options = {}, stylistic2 = {}) {
|
|
|
2274
2275
|
return configs;
|
|
2275
2276
|
}
|
|
2276
2277
|
|
|
2277
|
-
// src/configs/
|
|
2278
|
+
// src/configs/toml.ts
|
|
2278
2279
|
async function toml(options = {}) {
|
|
2279
2280
|
const {
|
|
2280
2281
|
files = [GLOB_TOML],
|
|
@@ -2333,6 +2334,80 @@ async function toml(options = {}) {
|
|
|
2333
2334
|
];
|
|
2334
2335
|
}
|
|
2335
2336
|
|
|
2337
|
+
// src/configs/solid.ts
|
|
2338
|
+
async function solid(options = {}) {
|
|
2339
|
+
const {
|
|
2340
|
+
overrides = {},
|
|
2341
|
+
typescript: typescript2 = true,
|
|
2342
|
+
files = [GLOB_JSX, GLOB_TSX]
|
|
2343
|
+
} = options;
|
|
2344
|
+
await ensure([
|
|
2345
|
+
"eslint-plugin-solid"
|
|
2346
|
+
]);
|
|
2347
|
+
const [
|
|
2348
|
+
pluginSolid
|
|
2349
|
+
] = await Promise.all([
|
|
2350
|
+
interop(import("eslint-plugin-solid"))
|
|
2351
|
+
]);
|
|
2352
|
+
return [
|
|
2353
|
+
{
|
|
2354
|
+
name: "luxass:solid:setup",
|
|
2355
|
+
plugins: {
|
|
2356
|
+
solid: pluginSolid
|
|
2357
|
+
}
|
|
2358
|
+
},
|
|
2359
|
+
{
|
|
2360
|
+
name: "luxass:solid:rules",
|
|
2361
|
+
files,
|
|
2362
|
+
languageOptions: {
|
|
2363
|
+
parserOptions: {
|
|
2364
|
+
ecmaFeatures: {
|
|
2365
|
+
jsx: true
|
|
2366
|
+
}
|
|
2367
|
+
},
|
|
2368
|
+
sourceType: "module"
|
|
2369
|
+
},
|
|
2370
|
+
rules: {
|
|
2371
|
+
// solid recommended rules
|
|
2372
|
+
// reactivity
|
|
2373
|
+
"solid/components-return-once": "warn",
|
|
2374
|
+
"solid/event-handlers": "warn",
|
|
2375
|
+
// these rules are mostly style suggestions
|
|
2376
|
+
"solid/imports": "warn",
|
|
2377
|
+
// identifier usage is important
|
|
2378
|
+
"solid/jsx-no-duplicate-props": "error",
|
|
2379
|
+
"solid/jsx-no-script-url": "error",
|
|
2380
|
+
"solid/jsx-no-undef": "error",
|
|
2381
|
+
"solid/jsx-uses-vars": "error",
|
|
2382
|
+
"solid/no-array-handlers": "off",
|
|
2383
|
+
"solid/no-destructure": "error",
|
|
2384
|
+
// security problems
|
|
2385
|
+
"solid/no-innerhtml": "error",
|
|
2386
|
+
// only necessary for resource-constrained environments
|
|
2387
|
+
"solid/no-proxy-apis": "off",
|
|
2388
|
+
"solid/no-react-deps": "warn",
|
|
2389
|
+
"solid/no-react-specific-props": "warn",
|
|
2390
|
+
"solid/no-unknown-namespaces": "error",
|
|
2391
|
+
// deprecated
|
|
2392
|
+
"solid/prefer-classlist": "off",
|
|
2393
|
+
"solid/prefer-for": "error",
|
|
2394
|
+
// handled by Solid compiler, opt-in style suggestion
|
|
2395
|
+
"solid/prefer-show": "off",
|
|
2396
|
+
"solid/reactivity": "warn",
|
|
2397
|
+
"solid/self-closing-comp": "warn",
|
|
2398
|
+
"solid/style-prop": "warn",
|
|
2399
|
+
...typescript2 ? {
|
|
2400
|
+
"solid/jsx-no-undef": ["error", { typescriptEnabled: true }],
|
|
2401
|
+
// namespaces taken care of by TS
|
|
2402
|
+
"solid/no-unknown-namespaces": "off"
|
|
2403
|
+
} : {},
|
|
2404
|
+
// overrides
|
|
2405
|
+
...overrides
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
];
|
|
2409
|
+
}
|
|
2410
|
+
|
|
2336
2411
|
// src/factory.ts
|
|
2337
2412
|
var FLAT_CONFIG_PROPS = [
|
|
2338
2413
|
"name",
|
|
@@ -2360,6 +2435,7 @@ async function luxass(options = {}, ...userConfigs) {
|
|
|
2360
2435
|
nextjs: enableNextJS = false,
|
|
2361
2436
|
react: enableReact = false,
|
|
2362
2437
|
tailwindcss: enableTailwindCSS = false,
|
|
2438
|
+
solid: enableSolid = false,
|
|
2363
2439
|
typescript: enableTypeScript = isPackageExists4("typescript"),
|
|
2364
2440
|
unocss: enableUnoCSS = false,
|
|
2365
2441
|
vue: enableVue = VuePackages.some((i) => isPackageExists4(i))
|
|
@@ -2430,6 +2506,15 @@ async function luxass(options = {}, ...userConfigs) {
|
|
|
2430
2506
|
})
|
|
2431
2507
|
);
|
|
2432
2508
|
}
|
|
2509
|
+
if (enableSolid) {
|
|
2510
|
+
configs.push(
|
|
2511
|
+
solid({
|
|
2512
|
+
...resolveSubOptions(options, "solid"),
|
|
2513
|
+
overrides: getOverrides(options, "solid"),
|
|
2514
|
+
typescript: !!enableTypeScript
|
|
2515
|
+
})
|
|
2516
|
+
);
|
|
2517
|
+
}
|
|
2433
2518
|
if (enableVue) {
|
|
2434
2519
|
configs.push(
|
|
2435
2520
|
vue({
|
|
@@ -2512,10 +2597,14 @@ async function luxass(options = {}, ...userConfigs) {
|
|
|
2512
2597
|
);
|
|
2513
2598
|
return merged;
|
|
2514
2599
|
}
|
|
2600
|
+
|
|
2601
|
+
// src/index.ts
|
|
2602
|
+
var src_default = luxass;
|
|
2515
2603
|
export {
|
|
2516
2604
|
GLOB_ASTRO,
|
|
2517
2605
|
GLOB_CSS,
|
|
2518
2606
|
GLOB_EXCLUDE,
|
|
2607
|
+
GLOB_GRAPHQL,
|
|
2519
2608
|
GLOB_HTML,
|
|
2520
2609
|
GLOB_JS,
|
|
2521
2610
|
GLOB_JSON,
|
|
@@ -2542,6 +2631,7 @@ export {
|
|
|
2542
2631
|
astro,
|
|
2543
2632
|
combine,
|
|
2544
2633
|
comments,
|
|
2634
|
+
src_default as default,
|
|
2545
2635
|
ensure,
|
|
2546
2636
|
formatters,
|
|
2547
2637
|
getOverrides,
|
|
@@ -2558,6 +2648,7 @@ export {
|
|
|
2558
2648
|
react,
|
|
2559
2649
|
renameRules,
|
|
2560
2650
|
resolveSubOptions,
|
|
2651
|
+
solid,
|
|
2561
2652
|
sortPackageJson,
|
|
2562
2653
|
sortTsconfig,
|
|
2563
2654
|
stylistic,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luxass/eslint-config",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.14",
|
|
4
4
|
"description": "ESLint config for @luxass",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"email": "lucasnrgaard@gmail.com",
|
|
9
9
|
"url": "https://luxass.dev"
|
|
10
10
|
},
|
|
11
|
-
"packageManager": "pnpm@8.15.
|
|
11
|
+
"packageManager": "pnpm@8.15.5",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"repository": {
|
|
14
14
|
"type": "git",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"engines": {
|
|
37
|
-
"node": ">=
|
|
37
|
+
"node": ">=20"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsup --format esm,cjs --clean --dts",
|
|
@@ -54,8 +54,9 @@
|
|
|
54
54
|
"eslint-plugin-react": ">=7.33.2",
|
|
55
55
|
"eslint-plugin-react-hooks": ">=4.6.0",
|
|
56
56
|
"eslint-plugin-react-refresh": ">=0.4",
|
|
57
|
+
"eslint-plugin-solid": ">=0.1.0",
|
|
57
58
|
"eslint-plugin-tailwindcss": ">=3.13.0",
|
|
58
|
-
"prettier-plugin-astro": "
|
|
59
|
+
"prettier-plugin-astro": ">=0.13.0"
|
|
59
60
|
},
|
|
60
61
|
"peerDependenciesMeta": {
|
|
61
62
|
"@unocss/eslint-plugin": {
|
|
@@ -67,6 +68,9 @@
|
|
|
67
68
|
"eslint-plugin-astro": {
|
|
68
69
|
"optional": true
|
|
69
70
|
},
|
|
71
|
+
"eslint-plugin-solid": {
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
70
74
|
"eslint-plugin-format": {
|
|
71
75
|
"optional": true
|
|
72
76
|
},
|
|
@@ -111,7 +115,7 @@
|
|
|
111
115
|
"eslint-plugin-markdown": "^4.0.1",
|
|
112
116
|
"eslint-plugin-n": "^16.6.2",
|
|
113
117
|
"eslint-plugin-sort-keys": "^2.3.5",
|
|
114
|
-
"eslint-plugin-toml": "^0.
|
|
118
|
+
"eslint-plugin-toml": "^0.10.0",
|
|
115
119
|
"eslint-plugin-unicorn": "^51.0.1",
|
|
116
120
|
"eslint-plugin-unused-imports": "^3.1.0",
|
|
117
121
|
"eslint-plugin-vitest": "^0.3.26",
|
|
@@ -137,12 +141,14 @@
|
|
|
137
141
|
"@unocss/eslint-plugin": "^0.58.5",
|
|
138
142
|
"astro-eslint-parser": "^0.16.3",
|
|
139
143
|
"eslint": "^8.57.0",
|
|
140
|
-
"eslint-plugin-astro": "^0.
|
|
144
|
+
"eslint-plugin-astro": "^0.32.0",
|
|
141
145
|
"eslint-plugin-format": "^0.1.0",
|
|
142
146
|
"eslint-plugin-react": "^7.34.0",
|
|
143
147
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
144
148
|
"eslint-plugin-react-refresh": "^0.4.5",
|
|
149
|
+
"eslint-plugin-solid": "^0.13.2",
|
|
145
150
|
"eslint-plugin-tailwindcss": "^3.15.1",
|
|
151
|
+
"jiti": "^1.21.0",
|
|
146
152
|
"lint-staged": "^15.2.2",
|
|
147
153
|
"prettier-plugin-astro": "^0.13.0",
|
|
148
154
|
"simple-git-hooks": "^2.10.0",
|
|
@@ -150,6 +156,11 @@
|
|
|
150
156
|
"typescript": "^5.4.2",
|
|
151
157
|
"vitest": "^1.3.1"
|
|
152
158
|
},
|
|
159
|
+
"pnpm": {
|
|
160
|
+
"patchedDependencies": {
|
|
161
|
+
"eslint-parser-plain@0.1.0": "patches/eslint-parser-plain@0.1.0.patch"
|
|
162
|
+
}
|
|
163
|
+
},
|
|
153
164
|
"simple-git-hooks": {
|
|
154
165
|
"pre-commit": "pnpm lint-staged"
|
|
155
166
|
},
|