@infernodesign/eslint-config 2.9.0 → 2.10.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.js CHANGED
@@ -80,6 +80,11 @@ const GLOB_ASTRO_TS = "**/*.astro/*.ts";
80
80
  const GLOB_GRAPHQL = "**/*.{g,graph}ql";
81
81
  const GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
82
82
  const GLOB_STORYBOOK = ["**/*.mdx", `**/*.stories.${GLOB_SRC}`];
83
+ const GLOB_SANITY = [
84
+ GLOB_SRC,
85
+ GLOB_ASTRO,
86
+ GLOB_SVELTE
87
+ ];
83
88
  const GLOB_TESTS = [
84
89
  `**/__tests__/**/*.${GLOB_SRC_EXT}`,
85
90
  `**/tests/**/*.${GLOB_SRC_EXT}`,
@@ -670,7 +675,7 @@ async function formatters(options = {}, stylistic = {}) {
670
675
  tabWidth: typeof indent === "number" ? indent : 2,
671
676
  trailingComma: "all",
672
677
  useTabs: indent === "tab"
673
- }, options.prettierOptions || {});
678
+ }, options.prettierOptions ?? {});
674
679
  const prettierXmlOptions = {
675
680
  xmlQuoteAttributes: "double",
676
681
  xmlSelfClosingSpace: true,
@@ -681,7 +686,7 @@ async function formatters(options = {}, stylistic = {}) {
681
686
  indentWidth: typeof indent === "number" ? indent : 2,
682
687
  quoteStyle: quotes === "single" ? "preferSingle" : "preferDouble",
683
688
  useTabs: indent === "tab",
684
- ...options.dprintOptions || {}
689
+ ...options.dprintOptions ?? {}
685
690
  };
686
691
  const configs = [{
687
692
  name: "config/formatter/setup",
@@ -796,7 +801,7 @@ function mergePrettierOptions(options, overrides) {
796
801
  return {
797
802
  ...options,
798
803
  ...overrides,
799
- plugins: [...overrides.plugins || [], ...options.plugins || []]
804
+ plugins: [...overrides.plugins ?? [], ...options.plugins ?? []]
800
805
  };
801
806
  }
802
807
  //#endregion
@@ -1869,11 +1874,6 @@ async function regexp(options = {}) {
1869
1874
  }
1870
1875
  //#endregion
1871
1876
  //#region src/configs/sanity.ts
1872
- const GLOB_SANITY = [
1873
- GLOB_SRC,
1874
- GLOB_ASTRO,
1875
- GLOB_SVELTE
1876
- ];
1877
1877
  const SanityPluginName = "@sanity-labs/eslint-plugin";
1878
1878
  async function sanity(options = {}) {
1879
1879
  const { files = GLOB_SANITY, overrides = {}, preset = "recommended" } = options;
@@ -2718,6 +2718,37 @@ async function toml(options = {}) {
2718
2718
  }
2719
2719
  //#endregion
2720
2720
  //#region src/configs/typescript.ts
2721
+ const TypeScriptRuleRenames = { "@typescript-eslint": "ts" };
2722
+ const configuredRules = /* @__PURE__ */ new Set([
2723
+ "no-dupe-class-members",
2724
+ "no-redeclare",
2725
+ "no-unused-vars",
2726
+ "no-use-before-define",
2727
+ "no-useless-constructor",
2728
+ "ts/ban-ts-comment",
2729
+ "ts/consistent-type-definitions",
2730
+ "ts/consistent-type-imports",
2731
+ "ts/method-signature-style",
2732
+ "ts/no-dupe-class-members",
2733
+ "ts/no-dynamic-delete",
2734
+ "ts/no-empty-object-type",
2735
+ "ts/no-explicit-any",
2736
+ "ts/no-extraneous-class",
2737
+ "ts/no-import-type-side-effects",
2738
+ "ts/no-inferrable-types",
2739
+ "ts/no-invalid-void-type",
2740
+ "ts/no-non-null-assertion",
2741
+ "ts/no-redeclare",
2742
+ "ts/no-require-imports",
2743
+ "ts/no-unused-expressions",
2744
+ "ts/no-unused-vars",
2745
+ "ts/no-use-before-define",
2746
+ "ts/no-useless-constructor",
2747
+ "ts/no-wrapper-object-types",
2748
+ "ts/triple-slash-reference",
2749
+ "ts/unified-signatures"
2750
+ ]);
2751
+ const configuredTypeAwareRules = /* @__PURE__ */ new Set(["dot-notation", "ts/dot-notation"]);
2721
2752
  async function typescript(options = {}) {
2722
2753
  const { componentExts = [], erasableOnly = false, overrides = {}, overridesTypeAware = {}, parserOptions = {}, strict = false, type = "app" } = options;
2723
2754
  const files = options.files ?? [
@@ -2727,20 +2758,24 @@ async function typescript(options = {}) {
2727
2758
  ];
2728
2759
  const filesTypeAware = options.filesTypeAware ?? ["**/*.?([cm])ts", "**/*.?([cm])tsx"];
2729
2760
  const ignoresTypeAware = options.ignoresTypeAware ?? [`**/*.md/**`, "**/*.astro/*.ts"];
2730
- const tsconfigPath = options?.tsconfigPath ? options.tsconfigPath : void 0;
2761
+ const tsconfigPath = options.tsconfigPath ?? void 0;
2731
2762
  const isTypeAware = !!tsconfigPath;
2763
+ const isStrict = strict ?? false;
2764
+ const [pluginTs, parserTs] = await Promise.all([interopDefault(import("@typescript-eslint/eslint-plugin")), interopDefault(import("@typescript-eslint/parser"))]);
2732
2765
  const typeAwareRules = {
2766
+ ...renamePresetRules(pluginTs.configs["stylistic-type-checked-only"]?.rules ?? {}, configuredTypeAwareRules),
2733
2767
  "dot-notation": "off",
2734
2768
  "no-implied-eval": "off",
2735
2769
  "ts/await-thenable": "error",
2736
2770
  "ts/dot-notation": ["error", { allowKeywords: true }],
2771
+ "ts/prefer-nullish-coalescing": ["error", { ignorePrimitives: true }],
2737
2772
  "ts/promise-function-async": "error",
2738
2773
  "ts/restrict-plus-operands": "error",
2739
2774
  "ts/restrict-template-expressions": "error",
2740
2775
  "ts/return-await": ["error", "in-try-catch"],
2741
2776
  "ts/switch-exhaustiveness-check": "error",
2742
2777
  "ts/unbound-method": "error",
2743
- ...strict ?? false ? {
2778
+ ...isStrict ? {
2744
2779
  "ts/no-floating-promises": "error",
2745
2780
  "ts/no-for-in-array": "error",
2746
2781
  "ts/no-implied-eval": "error",
@@ -2757,7 +2792,6 @@ async function typescript(options = {}) {
2757
2792
  }]
2758
2793
  } : {}
2759
2794
  };
2760
- const [pluginTs, parserTs] = await Promise.all([interopDefault(import("@typescript-eslint/eslint-plugin")), interopDefault(import("@typescript-eslint/parser"))]);
2761
2795
  function makeParser(typeAware, files, ignores) {
2762
2796
  return {
2763
2797
  files,
@@ -2793,10 +2827,12 @@ async function typescript(options = {}) {
2793
2827
  files,
2794
2828
  name: "config/typescript/rules",
2795
2829
  rules: {
2796
- ...renameRules(pluginTs.configs["eslint-recommended"]?.overrides?.[0]?.rules ?? {}, { "@typescript-eslint": "ts" }),
2797
- ...renameRules(pluginTs.configs.strict?.rules ?? {}, { "@typescript-eslint": "ts" }),
2830
+ ...renamePresetRules(pluginTs.configs["eslint-recommended"]?.overrides?.[0]?.rules ?? {}, configuredRules),
2831
+ ...renamePresetRules(pluginTs.configs.strict?.rules ?? {}, configuredRules),
2832
+ ...renamePresetRules(pluginTs.configs.stylistic?.rules ?? {}, configuredRules),
2798
2833
  "no-dupe-class-members": "off",
2799
2834
  "no-redeclare": "off",
2835
+ "no-unused-vars": "off",
2800
2836
  "no-use-before-define": "off",
2801
2837
  "no-useless-constructor": "off",
2802
2838
  "ts/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
@@ -2813,6 +2849,10 @@ async function typescript(options = {}) {
2813
2849
  "ts/no-explicit-any": "off",
2814
2850
  "ts/no-extraneous-class": "off",
2815
2851
  "ts/no-import-type-side-effects": "error",
2852
+ "ts/no-inferrable-types": ["error", {
2853
+ ignoreParameters: true,
2854
+ ignoreProperties: true
2855
+ }],
2816
2856
  "ts/no-invalid-void-type": "off",
2817
2857
  "ts/no-non-null-assertion": "off",
2818
2858
  "ts/no-redeclare": ["error", { builtinGlobals: false }],
@@ -2822,7 +2862,16 @@ async function typescript(options = {}) {
2822
2862
  allowTaggedTemplates: true,
2823
2863
  allowTernary: true
2824
2864
  }],
2825
- "ts/no-unused-vars": "off",
2865
+ "ts/no-unused-vars": ["error", {
2866
+ args: "all",
2867
+ argsIgnorePattern: "^_",
2868
+ caughtErrors: "all",
2869
+ caughtErrorsIgnorePattern: "^_",
2870
+ destructuredArrayIgnorePattern: "^_",
2871
+ varsIgnorePattern: "^_",
2872
+ ignoreRestSiblings: true,
2873
+ enableAutofixRemoval: { imports: true }
2874
+ }],
2826
2875
  "ts/no-use-before-define": ["error", {
2827
2876
  classes: false,
2828
2877
  functions: false,
@@ -2861,6 +2910,9 @@ async function typescript(options = {}) {
2861
2910
  }] : []
2862
2911
  ];
2863
2912
  }
2913
+ function renamePresetRules(rules, omittedRules) {
2914
+ return Object.fromEntries(Object.entries(renameRules(rules, TypeScriptRuleRenames)).filter(([rule]) => !omittedRules.has(rule)));
2915
+ }
2864
2916
  //#endregion
2865
2917
  //#region src/configs/unicorn.ts
2866
2918
  async function unicorn(options = {}) {
@@ -3445,4 +3497,4 @@ const CONFIG_PRESET_FULL_OFF = {
3445
3497
  yaml: false
3446
3498
  };
3447
3499
  //#endregion
3448
- export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, 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_POSTCSS, GLOB_SCSS, GLOB_SEARCH_EXCLUDE, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, PACKAGE_NAME, StylisticConfigDefaults, astro, combine, command, comments, config, config as inferno, defaultPluginRenaming, disables, e18e, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInCursorAgent, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sanity, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
3500
+ export { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, 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_POSTCSS, GLOB_SANITY, GLOB_SCSS, GLOB_SEARCH_EXCLUDE, GLOB_SRC, GLOB_SRC_EXT, GLOB_STORYBOOK, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, PACKAGE_NAME, StylisticConfigDefaults, astro, combine, command, comments, config, config as inferno, defaultPluginRenaming, disables, e18e, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInCursorAgent, isInEditorEnv, isInGitHooksOrLintStaged, isInVSCodeESLintExtension, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, normalizeRules, packageExportsSortOrder, packageSortOrder, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, sanity, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infernodesign/eslint-config",
3
3
  "description": "ESLint config for Inferno Design.",
4
- "version": "2.9.0",
4
+ "version": "2.10.0",
5
5
  "type": "module",
6
6
  "author": "Inferno Design <support@infernodesign.com>",
7
7
  "license": "MIT",
@@ -47,18 +47,18 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@antfu/install-pkg": "1.1.0",
50
- "@clack/prompts": "1.6.0",
50
+ "@clack/prompts": "1.7.0",
51
51
  "@e18e/eslint-plugin": "0.5.1",
52
52
  "@eslint-community/eslint-plugin-eslint-comments": "4.7.2",
53
53
  "@eslint/compat": "2.1.0",
54
54
  "@eslint/config-array": "0.23.5",
55
55
  "@eslint/config-helpers": "0.6.0",
56
- "@eslint/markdown": "8.0.2",
56
+ "@eslint/markdown": "8.0.3",
57
57
  "@stylistic/eslint-plugin": "5.10.0",
58
- "@typescript-eslint/eslint-plugin": "8.62.0",
59
- "@typescript-eslint/parser": "8.62.0",
60
- "@typescript-eslint/utils": "8.62.0",
61
- "@vitest/eslint-plugin": "1.6.20",
58
+ "@typescript-eslint/eslint-plugin": "8.62.1",
59
+ "@typescript-eslint/parser": "8.62.1",
60
+ "@typescript-eslint/utils": "8.62.1",
61
+ "@vitest/eslint-plugin": "1.6.21",
62
62
  "ansis": "4.3.1",
63
63
  "cac": "7.0.0",
64
64
  "eslint-config-flat-gitignore": "2.3.0",
@@ -67,7 +67,7 @@
67
67
  "eslint-plugin-antfu": "3.2.3",
68
68
  "eslint-plugin-command": "3.5.2",
69
69
  "eslint-plugin-import-lite": "0.6.0",
70
- "eslint-plugin-jsdoc": "63.0.9",
70
+ "eslint-plugin-jsdoc": "63.0.11",
71
71
  "eslint-plugin-jsonc": "3.2.0",
72
72
  "eslint-plugin-n": "18.2.1",
73
73
  "eslint-plugin-no-only-tests": "3.4.0",
@@ -75,7 +75,7 @@
75
75
  "eslint-plugin-pnpm": "1.6.1",
76
76
  "eslint-plugin-regexp": "3.1.1",
77
77
  "eslint-plugin-toml": "1.4.0",
78
- "eslint-plugin-unicorn": "69.0.0",
78
+ "eslint-plugin-unicorn": "70.0.0",
79
79
  "eslint-plugin-unused-imports": "4.4.1",
80
80
  "eslint-plugin-vue": "10.9.2",
81
81
  "eslint-plugin-yml": "3.5.0",
@@ -89,21 +89,21 @@
89
89
  "yaml-eslint-parser": "2.0.0"
90
90
  },
91
91
  "devDependencies": {
92
- "@eslint-react/eslint-plugin": "5.9.3",
92
+ "@eslint-react/eslint-plugin": "5.10.4",
93
93
  "@eslint/config-inspector": "3.0.4",
94
94
  "@infernodesign/typescript-config": "workspace:*",
95
- "@next/eslint-plugin-next": "16.2.9",
95
+ "@next/eslint-plugin-next": "16.2.10",
96
96
  "@prettier/plugin-xml": "3.4.2",
97
97
  "@sanity-labs/eslint-plugin": "1.0.0",
98
98
  "@types/bun": "1.3.14",
99
99
  "@types/eslint-plugin-jsx-a11y": "6.10.1",
100
- "@types/node": "26.0.1",
101
- "@typescript/native-preview": "7.0.0-dev.20260624.1",
102
- "@unocss/eslint-plugin": "66.7.3",
100
+ "@types/node": "26.1.0",
101
+ "@typescript/native-preview": "7.0.0-dev.20260704.1",
102
+ "@unocss/eslint-plugin": "66.7.4",
103
103
  "astro-eslint-parser": "2.1.0",
104
- "eslint": "10.5.0",
104
+ "eslint": "10.6.0",
105
105
  "eslint-plugin-astro": "2.1.1",
106
- "eslint-plugin-better-tailwindcss": "4.6.0",
106
+ "eslint-plugin-better-tailwindcss": "4.6.1",
107
107
  "eslint-plugin-erasable-syntax-only": "0.4.2",
108
108
  "eslint-plugin-format": "2.0.1",
109
109
  "eslint-plugin-jsx-a11y": "6.10.2",
@@ -128,15 +128,15 @@
128
128
  "vue": "3.5.39"
129
129
  },
130
130
  "peerDependencies": {
131
- "@eslint-react/eslint-plugin": "^5.9.3",
132
- "@next/eslint-plugin-next": "^16.2.9",
131
+ "@eslint-react/eslint-plugin": "^5.10.4",
132
+ "@next/eslint-plugin-next": "^16.2.10",
133
133
  "@prettier/plugin-xml": "^3.4.2",
134
134
  "@sanity-labs/eslint-plugin": "^1.0.0",
135
- "@unocss/eslint-plugin": "^66.7.3",
135
+ "@unocss/eslint-plugin": "^66.7.4",
136
136
  "astro-eslint-parser": "^2.1.0",
137
- "eslint": "^10.5.0",
137
+ "eslint": "^10.6.0",
138
138
  "eslint-plugin-astro": "^2.1.1",
139
- "eslint-plugin-better-tailwindcss": "^4.6.0",
139
+ "eslint-plugin-better-tailwindcss": "^4.6.1",
140
140
  "eslint-plugin-erasable-syntax-only": "^0.4.2",
141
141
  "eslint-plugin-format": "^2.0.1",
142
142
  "eslint-plugin-jsx-a11y": "^6.10.2",