@luxass/eslint-config 4.2.11 → 4.2.13

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/README.md CHANGED
@@ -225,7 +225,7 @@ Since flat config requires us to explicitly provide the plugin names (instead of
225
225
 
226
226
  | New Prefix | Original Prefix | Source Plugin |
227
227
  | ---------- | ---------------------- | ------------------------------------------------------------------------------------------ |
228
- | `import/*` | `i/*` | [eslint-plugin-i](https://github.com/un-es/eslint-plugin-i) |
228
+ | `import/*` | `import-x/*` | [eslint-plugin-import-x](https://github.com/un-es/eslint-plugin-import-x) |
229
229
  | `node/*` | `n/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) |
230
230
  | `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) |
231
231
  | `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
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}`,
@@ -365,6 +369,22 @@ function sortPackageJson() {
365
369
  {
366
370
  order: ["types", "import", "require", "default"],
367
371
  pathPattern: "^exports.*$"
372
+ },
373
+ {
374
+ order: [
375
+ // client hooks only
376
+ "pre-commit",
377
+ "prepare-commit-msg",
378
+ "commit-msg",
379
+ "post-commit",
380
+ "pre-rebase",
381
+ "post-rewrite",
382
+ "post-checkout",
383
+ "post-merge",
384
+ "pre-push",
385
+ "pre-auto-gc"
386
+ ],
387
+ pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
368
388
  }
369
389
  ]
370
390
  }
@@ -498,7 +518,7 @@ function sortTsconfig() {
498
518
  }
499
519
 
500
520
  // src/configs/imports.ts
501
- var import_eslint_plugin_i = __toESM(require("eslint-plugin-i"), 1);
521
+ var import_eslint_plugin_import_x = __toESM(require("eslint-plugin-import-x"), 1);
502
522
  var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
503
523
  async function imports(options = {}) {
504
524
  const {
@@ -509,7 +529,7 @@ async function imports(options = {}) {
509
529
  name: "luxass:imports",
510
530
  plugins: {
511
531
  antfu: import_eslint_plugin_antfu.default,
512
- import: import_eslint_plugin_i.default
532
+ import: import_eslint_plugin_import_x.default
513
533
  },
514
534
  rules: {
515
535
  "antfu/import-dedupe": "error",
@@ -850,7 +870,7 @@ function getOverrides(options, key) {
850
870
  };
851
871
  }
852
872
 
853
- // src/configs/docs/jsdoc.ts
873
+ // src/configs/jsdoc.ts
854
874
  async function jsdoc(options = {}) {
855
875
  const {
856
876
  overrides,
@@ -888,7 +908,7 @@ async function jsdoc(options = {}) {
888
908
  ];
889
909
  }
890
910
 
891
- // src/configs/data/json.ts
911
+ // src/configs/json.ts
892
912
  async function jsonc(options = {}) {
893
913
  const {
894
914
  files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
@@ -969,7 +989,7 @@ async function jsonc(options = {}) {
969
989
  ];
970
990
  }
971
991
 
972
- // src/configs/docs/markdown.ts
992
+ // src/configs/markdown.ts
973
993
  var parserPlain = __toESM(require("eslint-parser-plain"), 1);
974
994
  var import_eslint_merge_processors = require("eslint-merge-processors");
975
995
  async function markdown(options = {}) {
@@ -1317,7 +1337,7 @@ async function typescript(options = {}) {
1317
1337
  ];
1318
1338
  }
1319
1339
 
1320
- // src/configs/frameworks/vue.ts
1340
+ // src/configs/vue.ts
1321
1341
  var import_eslint_merge_processors2 = require("eslint-merge-processors");
1322
1342
  async function vue(options = {}) {
1323
1343
  const {
@@ -1504,7 +1524,7 @@ async function vue(options = {}) {
1504
1524
  ];
1505
1525
  }
1506
1526
 
1507
- // src/configs/data/yaml.ts
1527
+ // src/configs/yaml.ts
1508
1528
  async function yaml(options = {}) {
1509
1529
  const {
1510
1530
  files = [GLOB_YAML],
@@ -1617,7 +1637,7 @@ async function test(options = {}) {
1617
1637
  ];
1618
1638
  }
1619
1639
 
1620
- // src/configs/css/unocss.ts
1640
+ // src/configs/unocss.ts
1621
1641
  async function unocss(options = {}) {
1622
1642
  const {
1623
1643
  attributify = true,
@@ -1654,7 +1674,7 @@ async function unocss(options = {}) {
1654
1674
  ];
1655
1675
  }
1656
1676
 
1657
- // src/configs/frameworks/nextjs.ts
1677
+ // src/configs/nextjs.ts
1658
1678
  async function nextjs(options = {}) {
1659
1679
  const {
1660
1680
  files = [GLOB_SRC],
@@ -1737,7 +1757,7 @@ async function nextjs(options = {}) {
1737
1757
  ];
1738
1758
  }
1739
1759
 
1740
- // src/configs/frameworks/react.ts
1760
+ // src/configs/react.ts
1741
1761
  var import_local_pkg2 = require("local-pkg");
1742
1762
  async function react(options = {}) {
1743
1763
  const {
@@ -2016,7 +2036,7 @@ async function react(options = {}) {
2016
2036
  ];
2017
2037
  }
2018
2038
 
2019
- // src/configs/frameworks/astro.ts
2039
+ // src/configs/astro.ts
2020
2040
  async function astro(options) {
2021
2041
  const {
2022
2042
  files = [GLOB_ASTRO],
@@ -2109,7 +2129,7 @@ async function astro(options) {
2109
2129
  ];
2110
2130
  }
2111
2131
 
2112
- // src/configs/css/tailwindcss.ts
2132
+ // src/configs/tailwindcss.ts
2113
2133
  async function tailwindcss(options = {}) {
2114
2134
  const {
2115
2135
  files = [GLOB_SRC],
@@ -2332,7 +2352,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2332
2352
  if (options.graphql) {
2333
2353
  configs.push({
2334
2354
  name: "luxass:formatter:graphql",
2335
- files: ["**/*.graphql"],
2355
+ files: [GLOB_GRAPHQL],
2336
2356
  languageOptions: {
2337
2357
  parser: parserPlain2
2338
2358
  },
@@ -2350,7 +2370,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2350
2370
  return configs;
2351
2371
  }
2352
2372
 
2353
- // src/configs/data/toml.ts
2373
+ // src/configs/toml.ts
2354
2374
  async function toml(options = {}) {
2355
2375
  const {
2356
2376
  files = [GLOB_TOML],
@@ -2409,6 +2429,80 @@ async function toml(options = {}) {
2409
2429
  ];
2410
2430
  }
2411
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
+
2412
2506
  // src/factory.ts
2413
2507
  var FLAT_CONFIG_PROPS = [
2414
2508
  "name",
@@ -2436,6 +2530,7 @@ async function luxass(options = {}, ...userConfigs) {
2436
2530
  nextjs: enableNextJS = false,
2437
2531
  react: enableReact = false,
2438
2532
  tailwindcss: enableTailwindCSS = false,
2533
+ solid: enableSolid = false,
2439
2534
  typescript: enableTypeScript = (0, import_local_pkg4.isPackageExists)("typescript"),
2440
2535
  unocss: enableUnoCSS = false,
2441
2536
  vue: enableVue = VuePackages.some((i) => (0, import_local_pkg4.isPackageExists)(i))
@@ -2506,6 +2601,15 @@ async function luxass(options = {}, ...userConfigs) {
2506
2601
  })
2507
2602
  );
2508
2603
  }
2604
+ if (enableSolid) {
2605
+ configs.push(
2606
+ solid({
2607
+ ...resolveSubOptions(options, "solid"),
2608
+ overrides: getOverrides(options, "solid"),
2609
+ typescript: !!enableTypeScript
2610
+ })
2611
+ );
2612
+ }
2509
2613
  if (enableVue) {
2510
2614
  configs.push(
2511
2615
  vue({
@@ -2588,11 +2692,15 @@ async function luxass(options = {}, ...userConfigs) {
2588
2692
  );
2589
2693
  return merged;
2590
2694
  }
2695
+
2696
+ // src/index.ts
2697
+ var src_default = luxass;
2591
2698
  // Annotate the CommonJS export names for ESM import in node:
2592
2699
  0 && (module.exports = {
2593
2700
  GLOB_ASTRO,
2594
2701
  GLOB_CSS,
2595
2702
  GLOB_EXCLUDE,
2703
+ GLOB_GRAPHQL,
2596
2704
  GLOB_HTML,
2597
2705
  GLOB_JS,
2598
2706
  GLOB_JSON,
@@ -2635,6 +2743,7 @@ async function luxass(options = {}, ...userConfigs) {
2635
2743
  react,
2636
2744
  renameRules,
2637
2745
  resolveSubOptions,
2746
+ solid,
2638
2747
  sortPackageJson,
2639
2748
  sortTsconfig,
2640
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}`,
@@ -273,6 +274,22 @@ function sortPackageJson() {
273
274
  {
274
275
  order: ["types", "import", "require", "default"],
275
276
  pathPattern: "^exports.*$"
277
+ },
278
+ {
279
+ order: [
280
+ // client hooks only
281
+ "pre-commit",
282
+ "prepare-commit-msg",
283
+ "commit-msg",
284
+ "post-commit",
285
+ "pre-rebase",
286
+ "post-rewrite",
287
+ "post-checkout",
288
+ "post-merge",
289
+ "pre-push",
290
+ "pre-auto-gc"
291
+ ],
292
+ pathPattern: "^(?:gitHooks|husky|simple-git-hooks)$"
276
293
  }
277
294
  ]
278
295
  }
@@ -406,7 +423,7 @@ function sortTsconfig() {
406
423
  }
407
424
 
408
425
  // src/configs/imports.ts
409
- import pluginImport from "eslint-plugin-i";
426
+ import pluginImport from "eslint-plugin-import-x";
410
427
  import pluginAntfu from "eslint-plugin-antfu";
411
428
  async function imports(options = {}) {
412
429
  const {
@@ -758,7 +775,7 @@ function getOverrides(options, key) {
758
775
  };
759
776
  }
760
777
 
761
- // src/configs/docs/jsdoc.ts
778
+ // src/configs/jsdoc.ts
762
779
  async function jsdoc(options = {}) {
763
780
  const {
764
781
  overrides,
@@ -796,7 +813,7 @@ async function jsdoc(options = {}) {
796
813
  ];
797
814
  }
798
815
 
799
- // src/configs/data/json.ts
816
+ // src/configs/json.ts
800
817
  async function jsonc(options = {}) {
801
818
  const {
802
819
  files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
@@ -877,7 +894,7 @@ async function jsonc(options = {}) {
877
894
  ];
878
895
  }
879
896
 
880
- // src/configs/docs/markdown.ts
897
+ // src/configs/markdown.ts
881
898
  import * as parserPlain from "eslint-parser-plain";
882
899
  import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
883
900
  async function markdown(options = {}) {
@@ -1225,7 +1242,7 @@ async function typescript(options = {}) {
1225
1242
  ];
1226
1243
  }
1227
1244
 
1228
- // src/configs/frameworks/vue.ts
1245
+ // src/configs/vue.ts
1229
1246
  import { mergeProcessors as mergeProcessors2 } from "eslint-merge-processors";
1230
1247
  async function vue(options = {}) {
1231
1248
  const {
@@ -1412,7 +1429,7 @@ async function vue(options = {}) {
1412
1429
  ];
1413
1430
  }
1414
1431
 
1415
- // src/configs/data/yaml.ts
1432
+ // src/configs/yaml.ts
1416
1433
  async function yaml(options = {}) {
1417
1434
  const {
1418
1435
  files = [GLOB_YAML],
@@ -1525,7 +1542,7 @@ async function test(options = {}) {
1525
1542
  ];
1526
1543
  }
1527
1544
 
1528
- // src/configs/css/unocss.ts
1545
+ // src/configs/unocss.ts
1529
1546
  async function unocss(options = {}) {
1530
1547
  const {
1531
1548
  attributify = true,
@@ -1562,7 +1579,7 @@ async function unocss(options = {}) {
1562
1579
  ];
1563
1580
  }
1564
1581
 
1565
- // src/configs/frameworks/nextjs.ts
1582
+ // src/configs/nextjs.ts
1566
1583
  async function nextjs(options = {}) {
1567
1584
  const {
1568
1585
  files = [GLOB_SRC],
@@ -1645,7 +1662,7 @@ async function nextjs(options = {}) {
1645
1662
  ];
1646
1663
  }
1647
1664
 
1648
- // src/configs/frameworks/react.ts
1665
+ // src/configs/react.ts
1649
1666
  import { isPackageExists as isPackageExists2 } from "local-pkg";
1650
1667
  async function react(options = {}) {
1651
1668
  const {
@@ -1924,7 +1941,7 @@ async function react(options = {}) {
1924
1941
  ];
1925
1942
  }
1926
1943
 
1927
- // src/configs/frameworks/astro.ts
1944
+ // src/configs/astro.ts
1928
1945
  async function astro(options) {
1929
1946
  const {
1930
1947
  files = [GLOB_ASTRO],
@@ -2017,7 +2034,7 @@ async function astro(options) {
2017
2034
  ];
2018
2035
  }
2019
2036
 
2020
- // src/configs/css/tailwindcss.ts
2037
+ // src/configs/tailwindcss.ts
2021
2038
  async function tailwindcss(options = {}) {
2022
2039
  const {
2023
2040
  files = [GLOB_SRC],
@@ -2240,7 +2257,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2240
2257
  if (options.graphql) {
2241
2258
  configs.push({
2242
2259
  name: "luxass:formatter:graphql",
2243
- files: ["**/*.graphql"],
2260
+ files: [GLOB_GRAPHQL],
2244
2261
  languageOptions: {
2245
2262
  parser: parserPlain2
2246
2263
  },
@@ -2258,7 +2275,7 @@ async function formatters(options = {}, stylistic2 = {}) {
2258
2275
  return configs;
2259
2276
  }
2260
2277
 
2261
- // src/configs/data/toml.ts
2278
+ // src/configs/toml.ts
2262
2279
  async function toml(options = {}) {
2263
2280
  const {
2264
2281
  files = [GLOB_TOML],
@@ -2317,6 +2334,80 @@ async function toml(options = {}) {
2317
2334
  ];
2318
2335
  }
2319
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
+
2320
2411
  // src/factory.ts
2321
2412
  var FLAT_CONFIG_PROPS = [
2322
2413
  "name",
@@ -2344,6 +2435,7 @@ async function luxass(options = {}, ...userConfigs) {
2344
2435
  nextjs: enableNextJS = false,
2345
2436
  react: enableReact = false,
2346
2437
  tailwindcss: enableTailwindCSS = false,
2438
+ solid: enableSolid = false,
2347
2439
  typescript: enableTypeScript = isPackageExists4("typescript"),
2348
2440
  unocss: enableUnoCSS = false,
2349
2441
  vue: enableVue = VuePackages.some((i) => isPackageExists4(i))
@@ -2414,6 +2506,15 @@ async function luxass(options = {}, ...userConfigs) {
2414
2506
  })
2415
2507
  );
2416
2508
  }
2509
+ if (enableSolid) {
2510
+ configs.push(
2511
+ solid({
2512
+ ...resolveSubOptions(options, "solid"),
2513
+ overrides: getOverrides(options, "solid"),
2514
+ typescript: !!enableTypeScript
2515
+ })
2516
+ );
2517
+ }
2417
2518
  if (enableVue) {
2418
2519
  configs.push(
2419
2520
  vue({
@@ -2496,10 +2597,14 @@ async function luxass(options = {}, ...userConfigs) {
2496
2597
  );
2497
2598
  return merged;
2498
2599
  }
2600
+
2601
+ // src/index.ts
2602
+ var src_default = luxass;
2499
2603
  export {
2500
2604
  GLOB_ASTRO,
2501
2605
  GLOB_CSS,
2502
2606
  GLOB_EXCLUDE,
2607
+ GLOB_GRAPHQL,
2503
2608
  GLOB_HTML,
2504
2609
  GLOB_JS,
2505
2610
  GLOB_JSON,
@@ -2526,6 +2631,7 @@ export {
2526
2631
  astro,
2527
2632
  combine,
2528
2633
  comments,
2634
+ src_default as default,
2529
2635
  ensure,
2530
2636
  formatters,
2531
2637
  getOverrides,
@@ -2542,6 +2648,7 @@ export {
2542
2648
  react,
2543
2649
  renameRules,
2544
2650
  resolveSubOptions,
2651
+ solid,
2545
2652
  sortPackageJson,
2546
2653
  sortTsconfig,
2547
2654
  stylistic,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxass/eslint-config",
3
- "version": "4.2.11",
3
+ "version": "4.2.13",
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.4",
11
+ "packageManager": "pnpm@8.15.5",
12
12
  "license": "MIT",
13
13
  "repository": {
14
14
  "type": "git",
@@ -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": "^0.13.0"
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
  },
@@ -104,14 +108,14 @@
104
108
  "eslint-merge-processors": "^0.1.0",
105
109
  "eslint-parser-plain": "^0.1.0",
106
110
  "eslint-plugin-antfu": "^2.1.2",
107
- "eslint-plugin-i": "^2.29.1",
111
+ "eslint-plugin-import-x": "^0.4.1",
108
112
  "eslint-plugin-jsdoc": "^48.2.1",
109
113
  "eslint-plugin-jsonc": "^2.13.0",
110
114
  "eslint-plugin-jsx-a11y": "^6.8.0",
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.9.2",
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.31.4",
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",