@infernodesign/eslint-config 2.8.0 → 2.9.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
@@ -1,9 +1,9 @@
1
1
  import { t as PACKAGE_NAME } from "./constants-BxEizS7D.js";
2
2
  import { FlatConfigComposer } from "eslint-flat-config-utils";
3
3
  import process$1 from "node:process";
4
- import fs from "node:fs/promises";
4
+ import fsPromises from "node:fs/promises";
5
5
  import { fileURLToPath } from "node:url";
6
- import fs$1, { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
6
+ import fs, { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
7
7
  import path from "node:path";
8
8
  import { isPackageExists } from "local-pkg";
9
9
  import createCommand from "eslint-plugin-command/config";
@@ -28,7 +28,7 @@ async function findUp(name, { cwd = process$1.cwd(), type = "file", stopAt } = {
28
28
  while (directory) {
29
29
  const filePath = isAbsoluteName ? name : path.join(directory, name);
30
30
  try {
31
- const stats = await fs.stat(filePath);
31
+ const stats = await fsPromises.stat(filePath);
32
32
  if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) return filePath;
33
33
  } catch {}
34
34
  if (directory === stopAt || directory === root) break;
@@ -43,7 +43,7 @@ function findUpSync(name, { cwd = process$1.cwd(), type = "file", stopAt } = {})
43
43
  while (directory) {
44
44
  const filePath = isAbsoluteName ? name : path.join(directory, name);
45
45
  try {
46
- const stats = fs$1.statSync(filePath, { throwIfNoEntry: false });
46
+ const stats = fs.statSync(filePath, { throwIfNoEntry: false });
47
47
  if (type === "file" && stats?.isFile() || type === "directory" && stats?.isDirectory()) return filePath;
48
48
  } catch {}
49
49
  if (directory === stopAt || directory === root) break;
@@ -160,7 +160,7 @@ const GLOB_EXCLUDE = [
160
160
  "**/vendor",
161
161
  "**/yarn.lock"
162
162
  ];
163
- const GLOB_SEARCH_EXCLUDE = new Set([
163
+ const GLOB_SEARCH_EXCLUDE = /* @__PURE__ */ new Set([
164
164
  "__snapshots__",
165
165
  "_bmad",
166
166
  "_bmad-*",
@@ -1760,7 +1760,7 @@ async function pnpm(options) {
1760
1760
  async function detectCatalogUsage() {
1761
1761
  const workspaceFile = await findUp("pnpm-workspace.yaml");
1762
1762
  if (!workspaceFile) return false;
1763
- const yaml = await fs.readFile(workspaceFile, "utf-8");
1763
+ const yaml = await fsPromises.readFile(workspaceFile, "utf-8");
1764
1764
  return yaml.includes("catalog:") || yaml.includes("catalogs:");
1765
1765
  }
1766
1766
  //#endregion
@@ -1868,6 +1868,56 @@ async function regexp(options = {}) {
1868
1868
  }];
1869
1869
  }
1870
1870
  //#endregion
1871
+ //#region src/configs/sanity.ts
1872
+ const GLOB_SANITY = [
1873
+ GLOB_SRC,
1874
+ GLOB_ASTRO,
1875
+ GLOB_SVELTE
1876
+ ];
1877
+ const SanityPluginName = "@sanity-labs/eslint-plugin";
1878
+ async function sanity(options = {}) {
1879
+ const { files = GLOB_SANITY, overrides = {}, preset = "recommended" } = options;
1880
+ if (!isPackageExists(SanityPluginName)) return [];
1881
+ await ensurePackages([SanityPluginName]);
1882
+ const pluginSanity = await interopDefault(import(SanityPluginName));
1883
+ const presetConfigs = pluginSanity.configs[preset];
1884
+ if (!presetConfigs) throw new Error(`Failed to find config ${preset} in ${SanityPluginName}`);
1885
+ const settings = resolveSanitySettings(options);
1886
+ return [{
1887
+ name: "config/sanity/setup",
1888
+ plugins: { sanity: pluginSanity },
1889
+ ...settings ? { settings } : {}
1890
+ }, ...presetConfigs.map(({ plugins: _plugins, ...config }, index) => {
1891
+ const mergedSettings = mergeSanitySettings(config.settings, settings);
1892
+ return {
1893
+ ...config,
1894
+ files,
1895
+ name: index === 0 ? "config/sanity/rules" : `config/sanity/rules/${index}`,
1896
+ rules: {
1897
+ ...normalizeRules(config.rules ?? {}),
1898
+ ...index === presetConfigs.length - 1 ? overrides : {}
1899
+ },
1900
+ ...mergedSettings ? { settings: mergedSettings } : {}
1901
+ };
1902
+ })];
1903
+ }
1904
+ function resolveSanitySettings(options) {
1905
+ if (!options.schemaPath) return;
1906
+ const cwd = path.resolve(process.cwd(), options.cwd ?? ".");
1907
+ return { sanity: { schemaPath: path.isAbsolute(options.schemaPath) ? options.schemaPath : path.resolve(cwd, options.schemaPath) } };
1908
+ }
1909
+ function mergeSanitySettings(existing, next) {
1910
+ if (!existing) return next;
1911
+ if (!next) return existing;
1912
+ return {
1913
+ ...existing,
1914
+ sanity: {
1915
+ ...existing.sanity,
1916
+ ...next.sanity
1917
+ }
1918
+ };
1919
+ }
1920
+ //#endregion
1871
1921
  //#region src/configs/solid.ts
1872
1922
  async function solid(options = {}) {
1873
1923
  const { files = [GLOB_JSX, GLOB_TSX], overrides = {}, typescript = true } = options;
@@ -2335,7 +2385,7 @@ const defaultEntryPointCandidates = [
2335
2385
  "index.css",
2336
2386
  "style.css"
2337
2387
  ];
2338
- const entryPointCandidateFileNames = new Set([
2388
+ const entryPointCandidateFileNames = /* @__PURE__ */ new Set([
2339
2389
  "app.css",
2340
2390
  "global.css",
2341
2391
  "globals.css",
@@ -3180,7 +3230,7 @@ const defaultPluginRenaming = {
3180
3230
  * The merged ESLint configurations.
3181
3231
  */
3182
3232
  function config(options = {}, ...userConfigs) {
3183
- const { astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], e18e: enableE18e = true, gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, jsdoc: enableJSDoc = false, jsx: enableJsx = true, nextjs: enableNextjs = false, pnpm: enableCatalogs = !!findUpSync("pnpm-workspace.yaml"), react: enableReact = false, regexp: enableRegexp = true, solid: enableSolid = false, storybook: enableStorybook = false, svelte: enableSvelte = false, tailwindcss: enableTailwindcss = false, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
3233
+ const { astro: enableAstro = false, autoRenamePlugins = true, componentExts = [], e18e: enableE18e = true, gitignore: enableGitignore = true, ignores: userIgnores = [], imports: enableImports = true, jsdoc: enableJSDoc = false, jsx: enableJsx = true, nextjs: enableNextjs = false, pnpm: enableCatalogs = !!findUpSync("pnpm-workspace.yaml"), react: enableReact = false, regexp: enableRegexp = true, sanity: enableSanity = false, solid: enableSolid = false, storybook: enableStorybook = false, svelte: enableSvelte = false, tailwindcss: enableTailwindcss = false, typescript: enableTypeScript = isPackageExists("typescript"), unicorn: enableUnicorn = true, unocss: enableUnoCSS = false, vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
3184
3234
  let isInEditor = options.isInEditor;
3185
3235
  if (isInEditor == null) {
3186
3236
  isInEditor = isInEditorEnv();
@@ -3230,6 +3280,10 @@ function config(options = {}, ...userConfigs) {
3230
3280
  overrides: getOverrides(options, "stylistic")
3231
3281
  }));
3232
3282
  if (enableRegexp) configs.push(regexp(typeof enableRegexp === "boolean" ? {} : enableRegexp));
3283
+ if (enableSanity) configs.push(sanity({
3284
+ ...resolveSubOptions(options, "sanity"),
3285
+ overrides: getOverrides(options, "sanity")
3286
+ }));
3233
3287
  if (enableTailwindcss) {
3234
3288
  const tailwindcssOptions = resolveSubOptions(options, "tailwindcss");
3235
3289
  configs.push(tailwindcss({
@@ -3342,6 +3396,10 @@ const CONFIG_PRESET_FULL_ON = {
3342
3396
  pnpm: true,
3343
3397
  react: { reactCompiler: true },
3344
3398
  regexp: true,
3399
+ sanity: {
3400
+ preset: "strict",
3401
+ schemaPath: "schema.json"
3402
+ },
3345
3403
  solid: true,
3346
3404
  storybook: true,
3347
3405
  stylistic: { experimental: true },
@@ -3372,6 +3430,7 @@ const CONFIG_PRESET_FULL_OFF = {
3372
3430
  pnpm: false,
3373
3431
  react: false,
3374
3432
  regexp: false,
3433
+ sanity: false,
3375
3434
  solid: false,
3376
3435
  storybook: false,
3377
3436
  stylistic: false,
@@ -3386,4 +3445,4 @@ const CONFIG_PRESET_FULL_OFF = {
3386
3445
  yaml: false
3387
3446
  };
3388
3447
  //#endregion
3389
- 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, solid, sortPackageJson, sortTsconfig, storybook, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
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 };
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.8.0",
4
+ "version": "2.9.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.5.1",
51
- "@e18e/eslint-plugin": "0.5.0",
50
+ "@clack/prompts": "1.6.0",
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
56
  "@eslint/markdown": "8.0.2",
57
57
  "@stylistic/eslint-plugin": "5.10.0",
58
- "@typescript-eslint/eslint-plugin": "8.60.1",
59
- "@typescript-eslint/parser": "8.60.1",
60
- "@typescript-eslint/utils": "8.60.1",
61
- "@vitest/eslint-plugin": "1.6.19",
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",
62
62
  "ansis": "4.3.1",
63
63
  "cac": "7.0.0",
64
64
  "eslint-config-flat-gitignore": "2.3.0",
@@ -67,20 +67,20 @@
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.1",
70
+ "eslint-plugin-jsdoc": "63.0.9",
71
71
  "eslint-plugin-jsonc": "3.2.0",
72
- "eslint-plugin-n": "18.0.1",
72
+ "eslint-plugin-n": "18.2.1",
73
73
  "eslint-plugin-no-only-tests": "3.4.0",
74
- "eslint-plugin-perfectionist": "5.9.0",
74
+ "eslint-plugin-perfectionist": "5.9.1",
75
75
  "eslint-plugin-pnpm": "1.6.1",
76
- "eslint-plugin-regexp": "3.1.0",
76
+ "eslint-plugin-regexp": "3.1.1",
77
77
  "eslint-plugin-toml": "1.4.0",
78
- "eslint-plugin-unicorn": "64.0.0",
78
+ "eslint-plugin-unicorn": "69.0.0",
79
79
  "eslint-plugin-unused-imports": "4.4.1",
80
80
  "eslint-plugin-vue": "10.9.2",
81
- "eslint-plugin-yml": "3.4.0",
81
+ "eslint-plugin-yml": "3.5.0",
82
82
  "eslint-processor-vue-blocks": "2.0.0",
83
- "globals": "17.6.0",
83
+ "globals": "17.7.0",
84
84
  "jsonc-eslint-parser": "3.1.0",
85
85
  "local-pkg": "1.2.1",
86
86
  "parse-gitignore": "2.0.0",
@@ -89,27 +89,28 @@
89
89
  "yaml-eslint-parser": "2.0.0"
90
90
  },
91
91
  "devDependencies": {
92
- "@eslint-react/eslint-plugin": "5.8.12",
92
+ "@eslint-react/eslint-plugin": "5.9.3",
93
93
  "@eslint/config-inspector": "3.0.4",
94
94
  "@infernodesign/typescript-config": "workspace:*",
95
- "@next/eslint-plugin-next": "16.2.7",
95
+ "@next/eslint-plugin-next": "16.2.9",
96
96
  "@prettier/plugin-xml": "3.4.2",
97
+ "@sanity-labs/eslint-plugin": "1.0.0",
97
98
  "@types/bun": "1.3.14",
98
99
  "@types/eslint-plugin-jsx-a11y": "6.10.1",
99
- "@types/node": "25.9.1",
100
- "@typescript/native-preview": "7.0.0-dev.20260605.1",
101
- "@unocss/eslint-plugin": "66.7.0",
102
- "astro-eslint-parser": "1.4.0",
103
- "eslint": "10.4.1",
104
- "eslint-plugin-astro": "1.7.0",
105
- "eslint-plugin-better-tailwindcss": "4.5.0",
106
- "eslint-plugin-erasable-syntax-only": "0.4.1",
100
+ "@types/node": "26.0.1",
101
+ "@typescript/native-preview": "7.0.0-dev.20260624.1",
102
+ "@unocss/eslint-plugin": "66.7.3",
103
+ "astro-eslint-parser": "2.1.0",
104
+ "eslint": "10.5.0",
105
+ "eslint-plugin-astro": "2.1.1",
106
+ "eslint-plugin-better-tailwindcss": "4.6.0",
107
+ "eslint-plugin-erasable-syntax-only": "0.4.2",
107
108
  "eslint-plugin-format": "2.0.1",
108
109
  "eslint-plugin-jsx-a11y": "6.10.2",
109
- "eslint-plugin-react-refresh": "0.5.2",
110
+ "eslint-plugin-react-refresh": "0.5.3",
110
111
  "eslint-plugin-solid": "0.14.5",
111
- "eslint-plugin-storybook": "10.4.2",
112
- "eslint-plugin-svelte": "3.19.0",
112
+ "eslint-plugin-storybook": "10.4.6",
113
+ "eslint-plugin-svelte": "3.20.0",
113
114
  "eslint-plugin-vuejs-accessibility": "2.5.0",
114
115
  "eslint-typegen": "2.3.1",
115
116
  "execa": "9.6.1",
@@ -118,30 +119,31 @@
118
119
  "pnpm-workspace-yaml": "1.6.1",
119
120
  "prettier-plugin-astro": "0.14.1",
120
121
  "prettier-plugin-slidev": "1.0.5",
121
- "svelte": "5.56.2",
122
+ "svelte": "5.56.4",
122
123
  "svelte-eslint-parser": "1.8.0",
123
124
  "tinyglobby": "0.2.17",
124
- "tsdown": "0.22.2",
125
+ "tsdown": "0.22.3",
125
126
  "typescript": "6.0.3",
126
- "vitest": "4.1.8",
127
- "vue": "3.5.35"
127
+ "vitest": "4.1.9",
128
+ "vue": "3.5.39"
128
129
  },
129
130
  "peerDependencies": {
130
- "@eslint-react/eslint-plugin": "^5.8.12",
131
- "@next/eslint-plugin-next": "^16.2.7",
131
+ "@eslint-react/eslint-plugin": "^5.9.3",
132
+ "@next/eslint-plugin-next": "^16.2.9",
132
133
  "@prettier/plugin-xml": "^3.4.2",
133
- "@unocss/eslint-plugin": "^66.7.0",
134
- "astro-eslint-parser": "^1.4.0",
135
- "eslint": "^10.4.1",
136
- "eslint-plugin-astro": "^1.7.0",
137
- "eslint-plugin-better-tailwindcss": "^4.5.0",
138
- "eslint-plugin-erasable-syntax-only": "^0.4.1",
134
+ "@sanity-labs/eslint-plugin": "^1.0.0",
135
+ "@unocss/eslint-plugin": "^66.7.3",
136
+ "astro-eslint-parser": "^2.1.0",
137
+ "eslint": "^10.5.0",
138
+ "eslint-plugin-astro": "^2.1.1",
139
+ "eslint-plugin-better-tailwindcss": "^4.6.0",
140
+ "eslint-plugin-erasable-syntax-only": "^0.4.2",
139
141
  "eslint-plugin-format": "^2.0.1",
140
142
  "eslint-plugin-jsx-a11y": "^6.10.2",
141
- "eslint-plugin-react-refresh": "^0.5.2",
143
+ "eslint-plugin-react-refresh": "^0.5.3",
142
144
  "eslint-plugin-solid": "^0.14.5",
143
- "eslint-plugin-storybook": "^10.4.2",
144
- "eslint-plugin-svelte": "^3.19.0",
145
+ "eslint-plugin-storybook": "^10.4.6",
146
+ "eslint-plugin-svelte": "^3.20.0",
145
147
  "eslint-plugin-vuejs-accessibility": "^2.5.0",
146
148
  "prettier-plugin-astro": "^0.14.1",
147
149
  "prettier-plugin-slidev": "^1.0.5",
@@ -157,6 +159,9 @@
157
159
  "@prettier/plugin-xml": {
158
160
  "optional": true
159
161
  },
162
+ "@sanity-labs/eslint-plugin": {
163
+ "optional": true
164
+ },
160
165
  "@unocss/eslint-plugin": {
161
166
  "optional": true
162
167
  },