@oxlint-config-inspector/core 0.0.0 → 1.0.0-beta.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/config.ts","../src/plugins.ts","../src/inspect.ts"],"mappings":";KAiBY,gBAAA;EAAgB,+EAE1B,KAAA,YAF0B;EAI1B,UAAA;EAEA,GAAA;AAAA;;cAoBW,YAAA;;;;;;KCID,eAAA;EACV,OAAA;EACA,IAAA;EACA,SAAA;AAAA;;;;;;KCpCU,qBAAA;;;AFSP;KEJO,eAAA;EFwByE,8CEtBnF,SAAA,UFsBmF;EEpBnF,IAAA;EAEA,SAAA;EAEA,MAAA,EAAQ,qBAAqB;AAAA;;;;KAMnB,wBAAA,GAA2B,eAAe;;;ADiB3C;KCZC,YAAA;;;AAxBZ;KA6BY,mBAAA;;;AA7BqB;KAkCrB,iBAAA;;;;KAKA,0BAAA;;;;KAKA,mBAAA;EA/BmB,8FAiC7B,OAAA,aA3BU;EA6BV,GAAA;EAEA,MAAA,UA/BoD;EAiCpD,QAAA,EAAU,YAAY;AAAA;;;AA5BA;KAkCZ,kBAAA;EA7BmB,sDA+B7B,YAAA,UA/B6B;EAiC7B,eAAA,UA5BU;EA8BV,eAAA;EAEA,YAAA,UAhC2B;EAkC3B,YAAA,UA7BoC;EA+BpC,aAAA,UA/BoC;EAiCpC,aAAA,UA5BU;EA8BV,gBAAA;EAEA,UAAA,UA9BA;EAgCA,YAAA;AAAA;;;;KAMU,kBAAA;EA1BA,wEA4BV,QAAA;EAEA,cAAA,YA5BA;EA8BA,IAAA;AAAA;;;;KAMU,aAAA;EAtBV,2EAwBA,OAAA,YApBA;EAsBA,QAAA,WAtBY;EAwBZ,UAAA,GAAa,mBAAA,EAlBe;EAoB5B,eAAA,EAAiB,YAAA,EApBW;EAsB5B,WAAA,WAlBA;EAoBA,UAAA,WAlBI;EAoBJ,OAAA,WAdU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,KAAA,EAAO,kBAAA,EARS;EAUhB,IAAA;AAAA;;;;KAMU,0BAAA;EARH,8FAUP,OAAA,aARI;EAUJ,GAAA,WAJU;EAMV,MAAA;EAEA,QAAA,EAAU,YAAA,EANV;EAQA,MAAA,EAAQ,mBAAmB;AAAA;;;;KAMjB,sBAAA;EANiB,4DAQ3B,YAAA,aAFU;EAIV,KAAA;EAEA,KAAA,UAJA;EAMA,OAAA,aAFA;EAIA,KAAA,EAAO,0BAA0B;AAAA;;;AAAA;KAMvB,mBAAA;EAAmB,2DAE7B,WAAA,YAMgB;EAJhB,cAAA,UAQS;EANT,WAAA,UAYO;EAVP,cAAA,EAAgB,sBAAA,IAYW;EAV3B,YAAA,EAAc,wBAAA,IARd;EAUA,OAAA,EAAS,eAAA,IANT;EAQA,iBAAA,YANgB;EAQhB,KAAA,EAAO,aAAA,IANO;EAQd,KAAA,EAAO,kBAAA,EANE;EAQT,YAAA,EAAc,aAAA,IAJd;EAMA,OAAA;AAAA;;;;;;AAAO;iBAea,aAAA,CAAc,OAAA,GAAS,gBAAA,GAAwB,OAAA,CAAQ,mBAAA"}
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { cosmiconfig, defaultLoaders } from "cosmiconfig";
3
+ import { createJiti } from "jiti";
3
4
  import { parse, printParseErrorCode } from "jsonc-parser";
4
5
  import { fileURLToPath, pathToFileURL } from "node:url";
5
6
  import { x } from "tinyexec";
@@ -11,11 +12,13 @@ const searchPlaces = [
11
12
  "oxlint.config.ts"
12
13
  ];
13
14
  function createExplorer(cache) {
15
+ const loadTs = createTypeScriptLoader(cache);
14
16
  return cosmiconfig("oxlint", {
15
17
  cache,
16
18
  loaders: {
17
19
  ...defaultLoaders,
18
- ".jsonc": loadJsonc
20
+ ".jsonc": loadJsonc,
21
+ ".ts": loadTs
19
22
  },
20
23
  searchPlaces
21
24
  });
@@ -28,6 +31,13 @@ function loadJsonc(filepath, content) {
28
31
  if (error) throw new Error(`JSONC Error in ${filepath}: ${printParseErrorCode(error.error)} at offset ${error.offset}`);
29
32
  return config ?? null;
30
33
  }
34
+ function createTypeScriptLoader(cache) {
35
+ const jiti = createJiti(import.meta.url, {
36
+ fsCache: cache,
37
+ moduleCache: cache
38
+ });
39
+ return async (filepath) => jiti.import(filepath, { default: true });
40
+ }
31
41
  /**
32
42
  * Loads and resolves an Oxlint configuration file.
33
43
  *
@@ -194,7 +204,7 @@ function mergeArrays(base, override) {
194
204
  }
195
205
  //#endregion
196
206
  //#region package.json
197
- var version = "0.0.0";
207
+ var version = "1.0.0-beta.1";
198
208
  //#endregion
199
209
  //#region src/plugins.ts
200
210
  /**
@@ -208,9 +218,10 @@ var version = "0.0.0";
208
218
  */
209
219
  async function getPlugins(config) {
210
220
  const entries = getPluginEntries(config);
221
+ const pluginLoader = createJiti(config.filepath);
211
222
  const results = await Promise.all(entries.map(async (entry) => {
212
223
  try {
213
- return await loadPlugin(entry, config.filepath);
224
+ return await loadPlugin(entry, config.filepath, pluginLoader);
214
225
  } catch (error) {
215
226
  return createPluginLoadError(entry, error);
216
227
  }
@@ -271,10 +282,10 @@ function isPluginLoadError(result) {
271
282
  /**
272
283
  * Resolves, imports, and extracts rule information from a single JS plugin entry.
273
284
  */
274
- async function loadPlugin(entry, configFilepath) {
285
+ async function loadPlugin(entry, configFilepath, pluginLoader) {
275
286
  const specifier = getPluginSpecifier(entry);
276
- const resolvedPath = resolvePluginPath(specifier, configFilepath);
277
- const plugin = await importPlugin(resolvedPath);
287
+ const resolvedPath = resolvePluginPath(specifier, configFilepath, pluginLoader);
288
+ const plugin = await importPlugin(resolvedPath, pluginLoader);
278
289
  const name = getPluginName$1(entry, specifier, plugin);
279
290
  return {
280
291
  name,
@@ -301,19 +312,18 @@ function getPluginSpecifier(entry) {
301
312
  * @param configFilepath - Absolute path to the config file declaring the plugin.
302
313
  * @returns The absolute file path to the plugin module.
303
314
  */
304
- function resolvePluginPath(specifier, configFilepath) {
315
+ function resolvePluginPath(specifier, configFilepath, pluginLoader) {
305
316
  if (specifier.startsWith("file:")) return fileURLToPath(specifier);
306
- if (isPathSpecifier(specifier)) return path.resolve(path.dirname(configFilepath), specifier);
307
- return fileURLToPath(import.meta.resolve(specifier, pathToFileURL(configFilepath).href));
317
+ const resolved = pluginLoader.esmResolve(specifier, { parentURL: pathToFileURL(configFilepath).href });
318
+ return resolved.startsWith("file:") ? fileURLToPath(resolved) : resolved;
308
319
  }
309
320
  /**
310
321
  * Dynamically imports a plugin module and validates that it is a {@link JsPlugin}.
311
322
  *
312
323
  * @throws {TypeError} If the imported module is not a valid plugin object.
313
324
  */
314
- async function importPlugin(resolvedPath) {
315
- const namespace = await import(pathToFileURL(resolvedPath).href);
316
- const plugin = namespace.default ?? namespace;
325
+ async function importPlugin(resolvedPath, pluginLoader) {
326
+ const plugin = await pluginLoader.import(pathToFileURL(resolvedPath).href, { default: true });
317
327
  if (!isJsPlugin(plugin)) throw new TypeError(`Invalid Oxlint JS plugin: ${resolvedPath}`);
318
328
  return plugin;
319
329
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["getPluginName","pkgJson.version"],"sources":["../src/config.ts","../package.json","../src/plugins.ts","../src/rules.ts","../src/utils.ts","../src/inspect.ts"],"sourcesContent":["import type { PublicExplorer } from 'cosmiconfig'\nimport type { ParseError } from 'jsonc-parser'\nimport type { OxlintConfig } from 'oxlint'\n\nimport path from 'node:path'\n\nimport { cosmiconfig, defaultLoaders } from 'cosmiconfig'\nimport { parse, printParseErrorCode } from 'jsonc-parser'\n\ntype JsonOxlintConfig = Omit<OxlintConfig, 'extends'> & {\n extends?: string[]\n}\n\ntype ConfigInput = Omit<OxlintConfig, 'extends'> & {\n extends?: Array<string | ConfigInput>\n}\n\nexport type GetConfigOptions = {\n /** Whether to cache discovered and loaded config files. Defaults to `true`. */\n cache?: boolean\n /** An explicit path to the config file. When provided, cosmiconfig loads this file directly instead of searching. */\n configFile?: string\n /** The directory to search for a config file. Defaults to `process.cwd()`. */\n cwd?: string\n}\n\n/**\n * An Oxlint config with all `extends` resolved and the field removed.\n */\ntype ResolvedOxlintConfig = Omit<OxlintConfig, 'extends'>\n\n/**\n * The result of loading and resolving a config file from disk.\n */\nexport type LoadedOxlintConfig = {\n config: ResolvedOxlintConfig\n /** Every config file visited during resolution (including extended files). */\n files: string[]\n /** Absolute path to the root config file. */\n filepath: string\n}\n\n/** Known Oxlint config file names, searched in order by cosmiconfig. */\nexport const searchPlaces = ['.oxlintrc.json', '.oxlintrc.jsonc', 'oxlint.config.ts']\n\nfunction createExplorer(cache: boolean) {\n return cosmiconfig('oxlint', {\n cache,\n loaders: {\n ...defaultLoaders,\n '.jsonc': loadJsonc,\n },\n searchPlaces,\n })\n}\n\nconst defaultExplorer = createExplorer(true)\n\nfunction loadJsonc(filepath: string, content: string): Record<string, unknown> | null {\n const errors: ParseError[] = []\n const config = parse(content, errors, { allowTrailingComma: true }) as Record<string, unknown> | null\n const [error] = errors\n\n if (error) {\n throw new Error(`JSONC Error in ${filepath}: ${printParseErrorCode(error.error)} at offset ${error.offset}`)\n }\n\n return config ?? null\n}\n\n/**\n * Loads and resolves an Oxlint configuration file.\n *\n * Discovers the config via cosmiconfig (searching from `cwd` or loading a\n * specific `configFile`), then recursively resolves all `extends` chains.\n *\n * @param options - See {@link GetConfigOptions}.\n * @returns The resolved config with all extensions flattened, or `null` if no config file is found.\n */\nexport async function getConfig(options: GetConfigOptions = {}): Promise<LoadedOxlintConfig | null> {\n const cwd = options.cwd ?? process.cwd()\n const explorer = options.cache === false ? createExplorer(false) : defaultExplorer\n const result = options.configFile\n ? await explorer.load(path.resolve(cwd, options.configFile))\n : await explorer.search(cwd)\n\n if (!result || result.isEmpty) {\n return null\n }\n\n const files = new Set<string>([result.filepath])\n const config = await resolveConfig(\n result.config as ConfigInput,\n result.filepath,\n files,\n new Set([result.filepath]),\n explorer,\n )\n\n return {\n config,\n files: [...files],\n filepath: result.filepath,\n }\n}\n\n/**\n * Recursively resolves a config and all of its `extends`.\n *\n * Extended configs are loaded, filtered to their extendable fields, then\n * merged with the own config (own takes precedence).\n *\n * @param config - The config to resolve (may include an `extends` array).\n * @param filepath - Absolute path to the config file, used as the base for resolving relative `extends` paths.\n * @param files - Accumulator for all config file paths visited throughout the resolution tree.\n * @param resolvingFiles - Tracks in-flight files to detect circular extends.\n * @returns The fully resolved config with all `extends` flattened.\n */\nasync function resolveConfig(\n config: ConfigInput,\n filepath: string,\n files: Set<string>,\n resolvingFiles: Set<string>,\n explorer: PublicExplorer,\n): Promise<ResolvedOxlintConfig> {\n const extendedConfigs = await resolveExtends(config.extends, filepath, files, resolvingFiles, explorer)\n const ownConfig = stripExtends(config)\n\n return mergeConfigs([...extendedConfigs, ownConfig])\n}\n\n/**\n * Loads and resolves all entries in the `extends` array.\n *\n * Each entry is either a file path string (JSON/JSONC config) or an inline config\n * object (TS config). Inline configs are resolved recursively.\n *\n * Returned configs are filtered through {@link pickExtendableConfig} so only\n * inheritable fields survive.\n *\n * @param entries - The `extends` array from a config (string paths or inline config objects).\n * @param filepath - Absolute path to the parent config file, used as the base for resolving relative path strings.\n * @param files - Accumulator for all config file paths visited.\n * @param resolvingFiles - Shared set tracking in-flight files across the entire extends tree. Each extend branch receives a snapshot copy to isolate per-branch cycles.\n * @returns An array of resolved configs with only extendable fields.\n */\nasync function resolveExtends(\n entries: ConfigInput['extends'],\n filepath: string,\n files: Set<string>,\n resolvingFiles: Set<string>,\n explorer: PublicExplorer,\n) {\n if (!entries?.length) {\n return []\n }\n\n const configs = await Promise.all(\n entries.map(async (entry) => {\n const resolvingBranch = new Set(resolvingFiles)\n\n if (typeof entry === 'string') {\n return loadJsonLikeConfig(path.resolve(path.dirname(filepath), entry), files, resolvingBranch, explorer)\n }\n\n return resolveConfig(entry, filepath, files, resolvingBranch, explorer)\n }),\n )\n\n return configs.map((config) => pickExtendableConfig(config))\n}\n\n/**\n * Loads a JSON or JSONC config from disk at the given file path and resolves its\n * `extends` chain.\n *\n * @param filepath - Absolute path to the JSON or JSONC config file to load.\n * @param files - Accumulator for all config file paths visited.\n * @param resolvingFiles - Set tracking in-flight files for cycle detection.\n * @returns The fully resolved config from this file.\n * @throws If a circular extends reference is detected.\n * @throws If the file cannot be loaded by cosmiconfig.\n */\nasync function loadJsonLikeConfig(\n filepath: string,\n files: Set<string>,\n resolvingFiles: Set<string>,\n explorer: PublicExplorer,\n) {\n if (resolvingFiles.has(filepath)) {\n throw new Error(`Circular Oxlint config extends detected: ${filepath}`)\n }\n\n const result = await explorer.load(filepath)\n\n if (!result || result.isEmpty) {\n throw new Error(`Unable to load extended Oxlint config: ${filepath}`)\n }\n\n files.add(result.filepath)\n resolvingFiles.add(result.filepath)\n\n try {\n return await resolveConfig(result.config as JsonOxlintConfig, result.filepath, files, resolvingFiles, explorer)\n } finally {\n resolvingFiles.delete(result.filepath)\n }\n}\n\n/**\n * Returns a shallow copy of the config with the `extends` key removed.\n *\n * The resulting object represents the \"own\" config (i.e., what this file\n * declares without inherited contributions).\n *\n * @param config - The original config (may include `extends`).\n * @returns A shallow copy of the config without the `extends` property.\n */\nfunction stripExtends(config: ConfigInput): ResolvedOxlintConfig {\n const rest: ConfigInput = { ...config }\n delete rest.extends\n\n return rest\n}\n\n/**\n * Picks only the fields that are inherited through `extends`.\n *\n * Per Oxlint docs, only `rules`, `plugins`, and `overrides` are extendable.\n * Other fields (env, globals, settings, categories, jsPlugins, etc.) are\n * intentionally dropped.\n *\n * If Oxlint changes this behavior, this function must be updated accordingly.\n *\n * @param config - A fully resolved config.\n * @returns A new config object containing only `plugins`, `rules`, and `overrides` (if present in the source).\n * @see https://oxc.rs/docs/guide/usage/linter/nested-config.html#extending-configuration-files\n */\nfunction pickExtendableConfig(config: ResolvedOxlintConfig): ResolvedOxlintConfig {\n const picked: ResolvedOxlintConfig = {}\n\n if (config.plugins) {\n picked.plugins = config.plugins\n }\n\n if (config.rules) {\n picked.rules = config.rules\n }\n\n if (config.overrides) {\n picked.overrides = config.overrides\n }\n\n return picked\n}\n\n/**\n * Merges an ordered list of resolved configs into a single config.\n *\n * The first config serves as the base. Each subsequent config contributes\n * its fields with the following merge strategies:\n *\n * - **plugins** — concatenated (union of all enabled plugins)\n * - **overrides** — concatenated\n * - **rules** — cascading override (later entries win on conflict)\n * - **all other** — last-write-wins via {@link Object.assign}\n *\n * @param configs - An ordered list of configs to merge (base first, own config last).\n * @returns A single merged config.\n */\nfunction mergeConfigs(configs: ResolvedOxlintConfig[]) {\n const merged: ResolvedOxlintConfig = {}\n\n for (const config of configs) {\n const overrides = mergeArrays(merged.overrides, config.overrides)\n const plugins = mergeArrays(merged.plugins, config.plugins)\n const rules = { ...merged.rules, ...config.rules }\n\n Object.assign(merged, config)\n merged.overrides = overrides\n merged.plugins = plugins\n merged.rules = rules\n }\n\n return merged\n}\n\n/**\n * Concatenates two arrays, handling the case where either is undefined.\n *\n * If both are undefined the result is undefined; if only one is defined it\n * is returned as-is; if both are defined they are concatenated with `base`\n * coming first.\n *\n * @param base - The base array (elements appear first in the result).\n * @param override - The override array (elements appear after the base).\n * @returns The concatenated array, or `undefined` if both inputs are falsy.\n */\nfunction mergeArrays<T>(base: T[] | undefined, override: T[] | undefined) {\n if (!base) {\n return override\n }\n\n if (!override) {\n return base\n }\n\n return [...base, ...override]\n}\n","","import type { ExternalPluginEntry } from 'oxlint'\nimport type { LoadedOxlintConfig } from './config'\n\nimport path from 'node:path'\nimport { fileURLToPath, pathToFileURL } from 'node:url'\n\ntype PluginModule = {\n default?: unknown\n}\n\ntype JsPlugin = {\n meta?: {\n name?: string\n }\n rules?: Record<string, JsPluginRuleDefinition>\n}\n\ntype JsPluginRuleDefinition = {\n meta?: unknown\n}\n\ntype PluginRuleInfo = {\n /** The rule's own metadata (e.g. schema, deprecation info). */\n meta?: unknown\n /** The rule name as exported by the plugin (without prefix). */\n name: string\n /** The plugin name this rule belongs to. */\n pluginName: string\n /** The fully-qualified rule ID, e.g. `\"my-plugin/my-rule\"`. */\n ruleId: string\n}\n\n/**\n * Information about a successfully loaded JS plugin.\n */\nexport type PluginInfo = {\n name: string\n /** The resolved file path to the plugin module on disk. */\n resolvedPath: string\n rules: PluginRuleInfo[]\n /** The original specifier used to load the plugin (path or package name). */\n specifier: string\n}\n\n/**\n * Represents an error that occurred while loading a JS plugin entry.\n */\nexport type PluginLoadError = {\n message: string\n name?: string\n specifier: string\n}\n\n/**\n * The result of loading JS plugins from a config, including any failures.\n */\nexport type LoadedPlugins = {\n errors: PluginLoadError[]\n plugins: PluginInfo[]\n}\n\ntype PluginLoadResult = PluginInfo | PluginLoadError\n\n/**\n * Loads all JS plugins declared in the config (both root-level and override-level).\n *\n * Each plugin entry is imported dynamically. Failures are captured as\n * {@link PluginLoadError} rather than thrown, so partial success is possible.\n *\n * @param config - The loaded Oxlint config.\n * @returns All successfully loaded plugins and any load errors encountered.\n */\nexport async function getPlugins(config: LoadedOxlintConfig): Promise<LoadedPlugins> {\n const entries = getPluginEntries(config)\n const results = await Promise.all(\n entries.map(async (entry) => {\n try {\n return await loadPlugin(entry, config.filepath)\n } catch (error) {\n return createPluginLoadError(entry, error)\n }\n }),\n )\n const errors: PluginLoadError[] = []\n const plugins: PluginInfo[] = []\n\n for (const result of results) {\n if (isPluginLoadError(result)) {\n errors.push(result)\n continue\n }\n\n plugins.push(result)\n }\n\n return {\n errors,\n plugins,\n }\n}\n\n/**\n * Collects all unique JS plugin entries from root-level and override-level config, deduplicating by key.\n */\nfunction getPluginEntries(config: LoadedOxlintConfig) {\n const entries = new Map<string, ExternalPluginEntry>()\n\n for (const entry of config.config.jsPlugins ?? []) {\n entries.set(getPluginEntryKey(entry), entry)\n }\n\n for (const override of config.config.overrides ?? []) {\n for (const entry of override.jsPlugins ?? []) {\n entries.set(getPluginEntryKey(entry), entry)\n }\n }\n\n return [...entries.values()]\n}\n\n/**\n * Computes a deduplication key for a plugin entry.\n *\n * String entries use the specifier itself as the key. Object entries use\n * `\"name:specifier\"` so that the same package loaded under a different alias\n * is treated as a distinct plugin.\n *\n * @param entry - The plugin entry (string specifier or object).\n * @returns A unique key string for deduplication.\n */\nfunction getPluginEntryKey(entry: ExternalPluginEntry) {\n if (typeof entry === 'string') {\n return entry\n }\n\n return `${entry.name}:${entry.specifier}`\n}\n\n/**\n * Wraps an error thrown during plugin loading into a structured {@link PluginLoadError}.\n */\nfunction createPluginLoadError(entry: ExternalPluginEntry, error: unknown): PluginLoadError {\n return {\n message: error instanceof Error ? error.message : String(error),\n name: typeof entry === 'string' ? undefined : entry.name,\n specifier: getPluginSpecifier(entry),\n }\n}\n\n/**\n * Type guard that discriminates {@link PluginLoadError} from {@link PluginInfo}.\n */\nfunction isPluginLoadError(result: PluginLoadResult): result is PluginLoadError {\n return 'message' in result\n}\n\n/**\n * Resolves, imports, and extracts rule information from a single JS plugin entry.\n */\nasync function loadPlugin(entry: ExternalPluginEntry, configFilepath: string): Promise<PluginInfo> {\n const specifier = getPluginSpecifier(entry)\n const resolvedPath = resolvePluginPath(specifier, configFilepath)\n const plugin = await importPlugin(resolvedPath)\n const name = getPluginName(entry, specifier, plugin)\n const rules = getPluginRules(name, plugin)\n\n return {\n name,\n resolvedPath,\n rules,\n specifier,\n }\n}\n\n/**\n * Extracts the specifier (path or package name) from a plugin entry.\n */\nfunction getPluginSpecifier(entry: ExternalPluginEntry) {\n if (typeof entry === 'string') {\n return entry\n }\n\n return entry.specifier\n}\n\n/**\n * Resolves a plugin specifier to an absolute file path.\n *\n * Handles three cases: `file:` URLs, relative/absolute path specifiers\n * (resolved against the config file directory), and bare package specifiers\n * (resolved via Node's module resolution).\n *\n * @param specifier - The plugin specifier string.\n * @param configFilepath - Absolute path to the config file declaring the plugin.\n * @returns The absolute file path to the plugin module.\n */\nfunction resolvePluginPath(specifier: string, configFilepath: string) {\n if (specifier.startsWith('file:')) {\n return fileURLToPath(specifier)\n }\n\n if (isPathSpecifier(specifier)) {\n return path.resolve(path.dirname(configFilepath), specifier)\n }\n\n const resolvedUrl = import.meta.resolve(specifier, pathToFileURL(configFilepath).href)\n\n return fileURLToPath(resolvedUrl)\n}\n\n/**\n * Dynamically imports a plugin module and validates that it is a {@link JsPlugin}.\n *\n * @throws {TypeError} If the imported module is not a valid plugin object.\n */\nasync function importPlugin(resolvedPath: string): Promise<JsPlugin> {\n const namespace = (await import(pathToFileURL(resolvedPath).href)) as PluginModule\n const plugin = namespace.default ?? namespace\n\n if (!isJsPlugin(plugin)) {\n throw new TypeError(`Invalid Oxlint JS plugin: ${resolvedPath}`)\n }\n\n return plugin\n}\n\n/**\n * Type guard that checks whether a value is a non-null object (valid JS plugin).\n */\nfunction isJsPlugin(value: unknown): value is JsPlugin {\n return typeof value === 'object' && value !== null\n}\n\n/**\n * Determines the plugin name based on the entry type and specifier.\n *\n * Priority:\n * 1. Object entry — uses the explicitly provided `name` (alias).\n * 2. Path specifier — uses `meta.name` from the plugin, falling back to the basename.\n * 3. Package specifier — normalizes the package name (strips `eslint-plugin-` prefix).\n */\nfunction getPluginName(entry: ExternalPluginEntry, specifier: string, plugin: JsPlugin) {\n if (typeof entry !== 'string') {\n return entry.name\n }\n\n if (isPathSpecifier(specifier)) {\n return plugin.meta?.name ?? path.basename(specifier, path.extname(specifier))\n }\n\n return normalizePackagePluginName(specifier)\n}\n\n/**\n * Extracts rule definitions from a loaded plugin and wraps them with metadata.\n */\nfunction getPluginRules(pluginName: string, plugin: JsPlugin) {\n const rules = plugin.rules ?? {}\n const infos: PluginRuleInfo[] = []\n\n for (const [name, rule] of Object.entries(rules)) {\n infos.push({\n meta: rule.meta,\n name,\n pluginName,\n ruleId: `${pluginName}/${name}`,\n })\n }\n\n return infos\n}\n\n/**\n * Returns `true` if the specifier looks like a local file path (starts with `./`, `../`, or `/`).\n */\nfunction isPathSpecifier(specifier: string) {\n return specifier.startsWith('.') || specifier.startsWith('/')\n}\n\n/**\n * Derives a plugin name from a resolved npm package path.\n *\n * Strips the `eslint-plugin-` prefix and handles scoped packages\n * (e.g. `@scope/eslint-plugin-foo` becomes `@scope/foo`).\n */\nfunction normalizePackagePluginName(specifier: string) {\n const packageName = specifier.split('/node_modules/').at(-1) ?? specifier\n\n if (packageName.startsWith('@')) {\n const [scope, name] = packageName.split('/')\n const scopedName = scope ?? packageName\n\n if (name === 'eslint-plugin') {\n return scopedName\n }\n\n if (!name) {\n return scopedName\n }\n\n return `${scopedName}/${name.replace(/^eslint-plugin-?/, '')}`\n }\n\n return packageName.replace(/^eslint-plugin-?/, '')\n}\n","import type { RuleInfo } from './types'\n\nimport { x } from 'tinyexec'\n\nlet oxlintBinaryAvailability: Promise<boolean> | undefined\n\nexport async function getOxlintRules() {\n if (!(await isOxlintBinaryAvailable())) {\n console.error('Unable to inspect builtin Oxlint rules because the `oxlint` binary is not available on PATH.')\n return []\n }\n\n try {\n const rules = await x('oxlint', ['--rules', '--format=json'])\n return JSON.parse(rules.stdout) as RuleInfo[]\n } catch (error) {\n console.error('Error fetching Oxlint rules:', error)\n return []\n }\n}\n\nasync function isOxlintBinaryAvailable() {\n oxlintBinaryAvailability ??= checkOxlintBinaryAvailability()\n\n return oxlintBinaryAvailability\n}\n\nasync function checkOxlintBinaryAvailability() {\n try {\n await x('oxlint', ['--version'])\n return true\n } catch {\n return false\n }\n}\n","/** Type guard that checks whether a value is a non-null object (record). */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null\n}\n\n/** Returns the string value if it is a string, or `undefined` otherwise. */\nexport function getString(value: unknown) {\n return typeof value === 'string' ? value : undefined\n}\n\n/** Returns the boolean value if it is a boolean, or `undefined` otherwise. */\nexport function getBoolean(value: unknown) {\n return typeof value === 'boolean' ? value : undefined\n}\n","import type { RuleCategories } from 'oxlint'\nimport type { GetConfigOptions, LoadedOxlintConfig } from './config'\nimport type { PluginInfo, PluginLoadError } from './plugins'\nimport type { RuleInfo } from './types'\n\nimport pkgJson from '../package.json'\nimport { getConfig } from './config'\nimport { getPlugins } from './plugins'\nimport { getOxlintRules } from './rules'\nimport { getBoolean, getString, isRecord } from './utils'\n\n/**\n * Origin of a plugin entry discovered during config inspection.\n */\nexport type InspectedPluginSource = 'builtin' | 'js-plugin'\n\n/**\n * Summary information about a builtin or JS plugin discovered during config inspection.\n */\nexport type InspectedPlugin = {\n /** Number of rules exported by the plugin. */\n ruleCount: number\n /** The plugin name used as the rule prefix. */\n name: string\n /** The original specifier used to load the JS plugin (path or package name). */\n specifier?: string\n /** Whether this is an Oxlint builtin plugin scope or a loaded JS plugin. */\n source: InspectedPluginSource\n}\n\n/**\n * Error information for a JS plugin that failed to load during config inspection.\n */\nexport type InspectedPluginLoadError = PluginLoadError\n\n/**\n * Normalized severity for a configured or cataloged Oxlint rule.\n */\nexport type RuleSeverity = 'error' | 'warn' | 'off' | 'unknown'\n\n/**\n * Origin of a rule discovered during config inspection.\n */\nexport type InspectedRuleSource = 'builtin' | 'js-plugin' | 'unknown'\n\n/**\n * ESLint-compatible rule type, when supplied by JS plugin metadata.\n */\nexport type InspectedRuleType = 'layout' | 'problem' | 'suggestion'\n\n/**\n * Normalized severity state used by the inspector UI.\n */\nexport type InspectedRuleUsageSeverity = 'error' | 'warn' | 'off'\n\n/**\n * Normalized representation of a rule entry from an Oxlint config.\n */\nexport type InspectedRuleConfig = {\n /** Rule options after the severity tuple item, or an empty array when none are configured. */\n options: unknown[]\n /** The original unmodified config value for the rule. */\n raw: unknown\n /** The rule ID exactly as it appeared in the config entry. */\n ruleId: string\n /** The normalized severity parsed from the config value. */\n severity: RuleSeverity\n}\n\n/**\n * Aggregate counts derived from inspected rules.\n */\nexport type InspectConfigStats = {\n /** Number of builtin rules known to the inspector. */\n builtinRules: number\n /** Number of rules configured at the root config level. */\n configuredRules: number\n /** Number of deprecated rules known to the inspector. */\n deprecatedRules: number\n /** Number of rules enabled by default, root config, or override config. */\n enabledRules: number\n /** Number of rules that can apply an automatic fix. */\n fixableRules: number\n /** Number of JS plugin rules known to the inspector. */\n jsPluginRules: number\n /** Number of rules configured in one or more override blocks. */\n overrideRules: number\n /** Number of rules that belong to a recommended rule set. */\n recommendedRules: number\n /** Total number of builtin, JS plugin, and unknown rules known to the inspector. */\n totalRules: number\n /** Number of configured rules that were not found in the builtin catalog or loaded JS plugins. */\n unknownRules: number\n}\n\n/**\n * Compact usage references for category, root, and override configuration.\n */\nexport type InspectedRuleUsage = {\n /** Whether this rule is enabled by a category-level severity config. */\n category: boolean\n /** Override group indexes that configure this rule. */\n overrideGroups: number[]\n /** Whether this rule is configured at the root config level. */\n root: boolean\n}\n\n/**\n * A builtin, JS plugin, or unknown rule with its catalog metadata and config state.\n */\nexport type InspectedRule = {\n /** Rule IDs that resolve to this rule, including compatibility aliases. */\n aliases: string[]\n /** Oxlint category for builtin rules, when available. */\n category?: string\n /** Root-level config applied to this rule, when configured. */\n configured?: InspectedRuleConfig\n /** Severity implied by the rule catalog before user configuration is applied. */\n defaultSeverity: RuleSeverity\n /** Human-readable rule description from ESLint-compatible rule metadata, when available. */\n description?: string\n /** Whether the rule is deprecated. */\n deprecated: boolean\n /** Documentation URL for builtin rules, when available. */\n docsUrl?: string\n /** Whether the rule can apply an automatic fix. */\n fixable: boolean\n /** Whether the rule can provide editor suggestions. */\n hasSuggestions: boolean\n /** Rule metadata provided by a JS plugin rule, when available. */\n meta?: unknown\n /** Rule name without the plugin prefix. */\n name: string\n /** Whether this rule is configured but explicitly turned off everywhere. */\n offOnly: boolean\n /** Whether this rule has more than one normalized usage severity. */\n overloaded: boolean\n /** Plugin or scope name for the rule, when the rule ID has one. */\n pluginName?: string\n /** Whether the rule belongs to the recommended/default-enabled rule set. */\n recommended: boolean\n /** Replacement rule IDs or names declared by deprecation metadata. */\n replacedBy: string[]\n /** Canonical rule ID used by the inspector. */\n ruleId: string\n /** Lowercase text index used by inspector search. */\n searchText: string\n /** Unique normalized severities present on this rule, ordered as error, warn, then off. */\n severityStates: InspectedRuleUsageSeverity[]\n /** ESLint-compatible rule type, when available. */\n ruleType?: InspectedRuleType\n /** Source that supplied this rule. */\n source: InspectedRuleSource\n /** Whether a builtin rule requires type information, when available. */\n typeAware?: boolean\n /** Compact usage references for default, root, and override configuration. */\n usage: InspectedRuleUsage\n /** Whether this rule is used by default, root config, or override config. */\n used: boolean\n}\n\n/**\n * A rule entry grouped under a config override block.\n */\nexport type InspectedOverrideGroupRule = {\n /** Rule options after the severity tuple item, or an empty array when none are configured. */\n options: unknown[]\n /** The original unmodified config value for the rule. */\n raw: unknown\n /** Canonical rule ID used by the inspector. */\n ruleId: string\n /** Normalized severity parsed from the override config value. */\n severity: RuleSeverity\n /** Source that supplied this rule. */\n source: InspectedRuleSource\n}\n\n/**\n * A normalized config override block.\n */\nexport type InspectedOverrideGroup = {\n /** File globs excluded by the override, when configured. */\n excludeFiles?: string[]\n /** File globs included by the override. */\n files: string[]\n /** Zero-based position of the override in the resolved config. */\n index: number\n /** Plugins enabled by this override block. */\n plugins?: string[]\n /** Rules configured by this override block. */\n rules: InspectedOverrideGroupRule[]\n}\n\n/**\n * Complete inspection result for a resolved Oxlint config.\n */\nexport type InspectConfigResult = {\n /** Every config file visited while resolving `extends`. */\n configFiles: string[]\n /** Absolute path to the root config file that was inspected. */\n configFilepath: string\n /** ISO 8601 timestamp for when this inspection result was generated. */\n generatedAt: string\n /** Override blocks from the resolved config, including blocks without rule configs. */\n overrideGroups: InspectedOverrideGroup[]\n /** JS plugin load errors encountered during inspection. */\n pluginErrors: InspectedPluginLoadError[]\n /** Builtin plugin scopes and JS plugins discovered during inspection. */\n plugins: InspectedPlugin[]\n /** Available plugin filter values derived from inspected rules. */\n rulePluginFilters: string[]\n /** All builtin, JS plugin, and unknown rules known to the inspector. */\n rules: InspectedRule[]\n /** Aggregate counts derived from inspected rules. */\n stats: InspectConfigStats\n /** Configured rules that were not found in the builtin catalog or loaded JS plugins. */\n unknownRules: InspectedRule[]\n /** The inspector package version that produced this result. */\n version: string\n}\n\ntype RuleCatalog = {\n aliasesByRuleId: Map<string, Set<string>>\n ruleIdByAlias: Map<string, string>\n rulesById: Map<string, InspectedRule>\n}\n\n/**\n * Loads an Oxlint config and returns an inspection model for its rules and JS plugins.\n *\n * @param options - See {@link GetConfigOptions}.\n * @returns The inspected config result, or `null` if no config file is found.\n */\nexport async function inspectConfig(options: GetConfigOptions = {}): Promise<InspectConfigResult | null> {\n const config = await getConfig(options)\n\n if (!config) {\n return null\n }\n\n const [builtinRules, loadedPlugins] = await Promise.all([getOxlintRules(), getPlugins(config)])\n\n return inspectLoadedConfig(config, builtinRules, loadedPlugins.plugins, loadedPlugins.errors)\n}\n\n/**\n * Builds an inspection model from an already loaded config and precomputed rule catalogs.\n *\n * @param config - The resolved Oxlint config to inspect.\n * @param builtinRules - Builtin Oxlint rules to include in the catalog.\n * @param plugins - Successfully loaded JS plugins to include in the catalog.\n * @param pluginErrors - JS plugin load errors to surface in the inspection result.\n * @returns The inspected config result.\n */\nexport function inspectLoadedConfig(\n config: LoadedOxlintConfig,\n builtinRules: RuleInfo[],\n plugins: PluginInfo[],\n pluginErrors: PluginLoadError[],\n): InspectConfigResult {\n const enabledPlugins = [\n ...(config.config.plugins ?? []),\n ...(config.config.overrides?.flatMap((o) => o.plugins ?? []) ?? []),\n ]\n\n const catalog = createRuleCatalog(builtinRules, plugins, enabledPlugins, config.config.categories)\n\n applyConfiguredRules(catalog, config.config.rules)\n\n const overrideGroups = createInspectedOverrideGroups(catalog, config.config.overrides)\n const overrideSeveritiesByRuleId = createOverrideSeveritiesByRuleId(overrideGroups)\n\n const rules = [...catalog.rulesById.values()]\n .map((rule) => {\n const usage = createRuleUsageSummary(rule, overrideSeveritiesByRuleId.get(rule.ruleId) ?? [])\n\n const aliases = [...(catalog.aliasesByRuleId.get(rule.ruleId) ?? [])]\n const inspectedRule = {\n ...rule,\n ...usage,\n aliases,\n }\n\n return {\n ...inspectedRule,\n searchText: createRuleSearchText(inspectedRule),\n }\n })\n .toSorted((left, right) => left.ruleId.localeCompare(right.ruleId))\n\n return {\n configFiles: config.files,\n configFilepath: config.filepath,\n generatedAt: new Date().toISOString(),\n overrideGroups,\n pluginErrors,\n plugins: createInspectedPlugins(plugins, rules),\n rulePluginFilters: createRulePluginFilters(rules),\n rules,\n stats: createInspectConfigStats(rules),\n unknownRules: rules.filter((rule) => rule.source === 'unknown'),\n version: pkgJson.version,\n }\n}\n\nfunction createInspectConfigStats(rules: InspectedRule[]): InspectConfigStats {\n return {\n builtinRules: rules.filter((rule) => rule.source === 'builtin').length,\n configuredRules: rules.filter((rule) => rule.configured).length,\n deprecatedRules: rules.filter((rule) => rule.deprecated).length,\n enabledRules: rules.filter((rule) => rule.severityStates.some((severity) => severity !== 'off')).length,\n fixableRules: rules.filter((rule) => rule.fixable).length,\n jsPluginRules: rules.filter((rule) => rule.source === 'js-plugin').length,\n overrideRules: rules.filter((rule) => rule.usage.overrideGroups.length > 0).length,\n recommendedRules: rules.filter((rule) => rule.recommended).length,\n totalRules: rules.length,\n unknownRules: rules.filter((rule) => rule.source === 'unknown').length,\n }\n}\n\nfunction createRulePluginFilters(rules: InspectedRule[]): string[] {\n const pluginNames = new Set<string>()\n\n for (const rule of rules) {\n if (rule.pluginName) {\n pluginNames.add(rule.pluginName)\n }\n }\n\n return ['all', ...[...pluginNames].toSorted((left, right) => left.localeCompare(right))]\n}\n\nfunction createInspectedOverrideGroups(\n catalog: RuleCatalog,\n overrides: LoadedOxlintConfig['config']['overrides'],\n): InspectedOverrideGroup[] {\n const groups: InspectedOverrideGroup[] = []\n\n for (const [index, override] of overrides?.entries() ?? []) {\n const group: InspectedOverrideGroup = {\n excludeFiles: override.excludeFiles,\n files: override.files,\n index,\n plugins: override.plugins,\n rules: [],\n }\n\n if (override.rules) {\n for (const [ruleId, raw] of Object.entries(override.rules)) {\n const normalizedRuleId = getNormalizedRuleId(catalog, ruleId)\n const rule = getOrCreateUnknownRule(catalog, normalizedRuleId, ruleId)\n const config = createRuleConfig(ruleId, raw)\n\n rule.usage.overrideGroups.push(index)\n group.rules.push({\n options: config.options,\n raw: config.raw,\n ruleId: rule.ruleId,\n severity: config.severity,\n source: rule.source,\n })\n }\n }\n\n groups.push(group)\n }\n\n return groups\n}\n\nfunction createOverrideSeveritiesByRuleId(overrideGroups: InspectedOverrideGroup[]) {\n const severitiesByRuleId = new Map<string, RuleSeverity[]>()\n\n for (const group of overrideGroups) {\n for (const rule of group.rules) {\n const severities = severitiesByRuleId.get(rule.ruleId) ?? []\n severities.push(rule.severity)\n severitiesByRuleId.set(rule.ruleId, severities)\n }\n }\n\n return severitiesByRuleId\n}\n\nfunction createRuleSearchText(rule: InspectedRule) {\n return [\n rule.ruleId,\n rule.name,\n rule.pluginName,\n rule.category,\n rule.source,\n rule.description,\n rule.ruleType,\n ...rule.aliases,\n ...rule.replacedBy,\n ]\n .filter(Boolean)\n .join(' ')\n .toLowerCase()\n}\n\nfunction createInspectedPlugins(plugins: PluginInfo[], rules: InspectedRule[]): InspectedPlugin[] {\n const inspectedPlugins = new Map<string, InspectedPlugin>()\n\n for (const rule of rules) {\n if (!rule.pluginName || rule.source === 'unknown') {\n continue\n }\n\n const key = `${rule.source}:${rule.pluginName}`\n const inspectedPlugin = inspectedPlugins.get(key) ?? {\n name: rule.pluginName,\n ruleCount: 0,\n source: rule.source,\n }\n\n inspectedPlugin.ruleCount += 1\n inspectedPlugins.set(key, inspectedPlugin)\n }\n\n for (const plugin of plugins) {\n const key = `js-plugin:${plugin.name}`\n const inspectedPlugin = inspectedPlugins.get(key) ?? {\n name: plugin.name,\n ruleCount: plugin.rules.length,\n source: 'js-plugin',\n }\n\n inspectedPlugins.set(key, {\n ...inspectedPlugin,\n specifier: plugin.specifier,\n })\n }\n\n return [...inspectedPlugins.values()].toSorted((left, right) => {\n if (left.source !== right.source) {\n return left.source.localeCompare(right.source)\n }\n\n return left.name.localeCompare(right.name)\n })\n}\n\nfunction createRuleCatalog(\n builtinRules: RuleInfo[],\n plugins: PluginInfo[],\n enabledPlugins: string[] | undefined,\n categories?: RuleCategories,\n): RuleCatalog {\n const bareBuiltinRuleIds = createBareBuiltinRuleIds(builtinRules)\n const enabledPluginNames = new Set(['eslint', ...(enabledPlugins ?? [])])\n /**\n * When categories are not explicitly configured, Oxlint applies a default\n * severity of `warn` to all correctness rules via the `RulesBuilder` defaults.\n *\n * @see https://github.com/oxc-project/oxc/blob/f30a64c26971a7eef6b4dd1b42c0a947555f47c0/crates/oxc_linter/src/config/config_builder.rs#L47-L51\n */\n const implicitCategoryDefaults: Record<string, unknown> = {\n correctness: 'warn',\n }\n const catalog: RuleCatalog = {\n aliasesByRuleId: new Map(),\n ruleIdByAlias: new Map(),\n rulesById: new Map(),\n }\n\n for (const rule of builtinRules) {\n const ruleId = getBuiltinRuleId(rule)\n const pluginName = getPluginName(rule.scope)\n const isPluginEnabled = enabledPluginNames.has(pluginName)\n const userCategorySeverity = categories?.[rule.category as keyof RuleCategories]\n const resolvedCategorySeverity = userCategorySeverity ?? implicitCategoryDefaults[rule.category]\n const useCategorySeverity = resolvedCategorySeverity !== undefined && isPluginEnabled\n const defaultSeverity = useCategorySeverity\n ? getRuleSeverity(resolvedCategorySeverity)\n : getDefaultSeverity(rule.default)\n\n const metadata = createBuiltinRuleMetadata(rule)\n\n catalog.rulesById.set(ruleId, {\n aliases: [],\n category: rule.category,\n defaultSeverity,\n ...metadata,\n name: rule.value,\n ...createEmptyRuleUsage(isPluginEnabled && useCategorySeverity),\n pluginName,\n ruleId,\n searchText: '',\n source: 'builtin',\n typeAware: rule.type_aware,\n })\n\n addAliases(catalog, ruleId, getBuiltinRuleAliases(rule, ruleId, bareBuiltinRuleIds))\n }\n\n for (const plugin of plugins) {\n for (const rule of plugin.rules) {\n const metadata = createPluginRuleMetadata(rule.meta)\n\n catalog.rulesById.set(rule.ruleId, {\n aliases: [],\n defaultSeverity: 'off',\n ...metadata,\n meta: rule.meta,\n name: rule.name,\n ...createEmptyRuleUsage(false),\n pluginName: plugin.name,\n ruleId: rule.ruleId,\n searchText: '',\n source: 'js-plugin',\n })\n\n addAliases(catalog, rule.ruleId, [rule.ruleId])\n }\n }\n\n return catalog\n}\n\nfunction applyConfiguredRules(catalog: RuleCatalog, rules: Record<string, unknown> | undefined) {\n if (!rules) {\n return\n }\n\n for (const [ruleId, raw] of Object.entries(rules)) {\n const normalizedRuleId = getNormalizedRuleId(catalog, ruleId)\n const rule = getOrCreateUnknownRule(catalog, normalizedRuleId, ruleId)\n const configured = createRuleConfig(ruleId, raw)\n\n rule.configured = configured\n rule.usage.root = true\n }\n}\n\nfunction getOrCreateUnknownRule(catalog: RuleCatalog, normalizedRuleId: string, configuredRuleId: string) {\n const rule = catalog.rulesById.get(normalizedRuleId)\n\n if (rule) {\n return rule\n }\n\n const unknownRule: InspectedRule = {\n aliases: [],\n defaultSeverity: 'unknown',\n deprecated: false,\n fixable: false,\n hasSuggestions: false,\n name: getRuleName(configuredRuleId),\n ...createEmptyRuleUsage(false),\n pluginName: getConfiguredPluginName(configuredRuleId),\n recommended: false,\n replacedBy: [],\n ruleId: configuredRuleId,\n searchText: '',\n source: 'unknown',\n }\n\n catalog.rulesById.set(configuredRuleId, unknownRule)\n addAliases(catalog, configuredRuleId, [configuredRuleId])\n\n return unknownRule\n}\n\nfunction createRuleConfig(ruleId: string, raw: unknown): InspectedRuleConfig {\n return {\n options: getRuleOptions(raw),\n raw,\n ruleId,\n severity: getRuleSeverity(raw),\n }\n}\n\nfunction getRuleSeverity(raw: unknown): RuleSeverity {\n let severity = raw\n\n if (Array.isArray(raw)) {\n severity = (raw as unknown[])[0]\n }\n\n if (typeof severity === 'number') {\n if (severity === 0) {\n return 'off'\n }\n\n if (severity === 1) {\n return 'warn'\n }\n\n if (severity === 2) {\n return 'error'\n }\n\n return 'unknown'\n }\n\n if (typeof severity !== 'string') {\n return 'unknown'\n }\n\n if (severity === 'allow' || severity === 'off') {\n return 'off'\n }\n\n if (severity === 'deny' || severity === 'error') {\n return 'error'\n }\n\n if (severity === 'warn') {\n return severity\n }\n\n return 'unknown'\n}\n\nfunction getRuleOptions(raw: unknown): unknown[] {\n if (!Array.isArray(raw)) {\n return []\n }\n\n return raw.slice(1)\n}\n\nfunction getDefaultSeverity(enabledByDefault: boolean): RuleSeverity {\n return enabledByDefault ? 'warn' : 'off'\n}\n\ntype RuleUsageSummary = Pick<InspectedRule, 'offOnly' | 'overloaded' | 'severityStates' | 'used'>\n\nfunction createRuleUsageSummary(rule: InspectedRule, overrideSeverities: RuleSeverity[]): RuleUsageSummary {\n const severities: InspectedRuleUsageSeverity[] = []\n\n if (rule.usage.category) {\n addUsageSeverity(severities, rule.defaultSeverity)\n }\n\n if (rule.configured) {\n addUsageSeverity(severities, rule.configured.severity)\n }\n\n for (const severity of overrideSeverities) {\n addUsageSeverity(severities, severity)\n }\n\n const severityStates = createSeverityStates(severities)\n const used = rule.usage.category || rule.usage.root || rule.usage.overrideGroups.length > 0\n\n return {\n offOnly: used && severityStates.every((severity) => severity === 'off'),\n overloaded: severityStates.length > 1,\n severityStates,\n used,\n }\n}\n\nfunction createEmptyRuleUsage(isCategory: boolean): RuleUsageSummary & Pick<InspectedRule, 'usage'> {\n return {\n offOnly: false,\n overloaded: false,\n severityStates: [],\n usage: {\n category: isCategory,\n overrideGroups: [],\n root: false,\n },\n used: false,\n }\n}\n\nfunction addUsageSeverity(severities: InspectedRuleUsageSeverity[], severity: RuleSeverity) {\n if (severity === 'unknown') {\n return\n }\n\n severities.push(severity)\n}\n\nfunction createSeverityStates(configs: InspectedRuleUsageSeverity[]) {\n const severities = new Set(configs)\n\n return (['error', 'warn', 'off'] satisfies InspectedRuleUsageSeverity[]).filter((severity) =>\n severities.has(severity),\n )\n}\n\ntype NormalizedRuleMetadata = {\n deprecated: boolean\n description?: string\n docsUrl?: string\n fixable: boolean\n hasSuggestions: boolean\n recommended: boolean\n replacedBy: string[]\n ruleType?: InspectedRuleType\n typeAware?: boolean\n}\n\nfunction createBuiltinRuleMetadata(rule: RuleInfo): NormalizedRuleMetadata {\n return {\n deprecated: false,\n docsUrl: rule.docs_url,\n fixable: isBuiltinRuleFixable(rule.fix),\n hasSuggestions: hasBuiltinRuleSuggestions(rule.fix),\n recommended: rule.default,\n replacedBy: [],\n }\n}\n\nfunction createPluginRuleMetadata(meta: unknown): NormalizedRuleMetadata {\n if (!isRecord(meta)) {\n return createEmptyRuleMetadata()\n }\n\n const docs = isRecord(meta.docs) ? meta.docs : undefined\n\n return {\n deprecated: isDeprecated(meta.deprecated),\n description: getString(docs?.description),\n docsUrl: getString(docs?.url),\n fixable: meta.fixable === 'code' || meta.fixable === 'whitespace',\n hasSuggestions: meta.hasSuggestions === true,\n recommended: docs?.recommended === true,\n replacedBy: getReplacementRuleNames(meta.replacedBy),\n ruleType: getRuleType(meta.type),\n typeAware: getBoolean(docs?.requiresTypeChecking),\n }\n}\n\nfunction createEmptyRuleMetadata(): NormalizedRuleMetadata {\n return {\n deprecated: false,\n fixable: false,\n hasSuggestions: false,\n recommended: false,\n replacedBy: [],\n }\n}\n\nfunction isDeprecated(value: unknown) {\n return value === true || isRecord(value)\n}\n\nfunction getReplacementRuleNames(value: unknown) {\n if (!Array.isArray(value)) {\n return []\n }\n\n return value.flatMap((item) => {\n if (typeof item === 'string') {\n return [item]\n }\n\n if (!isRecord(item)) {\n return []\n }\n\n const ruleName = getString(item.name) ?? getString(item.ruleName)\n\n if (ruleName) {\n return [ruleName]\n }\n\n const rule = isRecord(item.rule) ? item.rule : undefined\n const plugin = isRecord(item.plugin) ? item.plugin : undefined\n const nestedRuleName = getString(rule?.name)\n const nestedPluginName = getString(plugin?.name)\n\n if (nestedRuleName && nestedPluginName) {\n return [`${nestedPluginName}/${nestedRuleName}`]\n }\n\n if (nestedRuleName) {\n return [nestedRuleName]\n }\n\n return []\n })\n}\n\nfunction getRuleType(value: unknown): InspectedRuleType | undefined {\n if (value === 'layout' || value === 'problem' || value === 'suggestion') {\n return value\n }\n\n return undefined\n}\n\nfunction isBuiltinRuleFixable(fix: string) {\n return fix !== 'none' && fix !== 'pending' && fix.includes('fix')\n}\n\nfunction hasBuiltinRuleSuggestions(fix: string) {\n return fix.includes('suggestion')\n}\n\nfunction getNormalizedRuleId(catalog: RuleCatalog, ruleId: string) {\n return catalog.ruleIdByAlias.get(ruleId) ?? ruleId\n}\n\nfunction addAliases(catalog: RuleCatalog, ruleId: string, aliases: string[]) {\n let aliasSet = catalog.aliasesByRuleId.get(ruleId)\n\n if (!aliasSet) {\n aliasSet = new Set()\n catalog.aliasesByRuleId.set(ruleId, aliasSet)\n }\n\n for (const alias of aliases) {\n aliasSet.add(alias)\n\n if (!catalog.ruleIdByAlias.has(alias)) {\n catalog.ruleIdByAlias.set(alias, ruleId)\n }\n }\n}\n\nfunction getBuiltinRuleId(rule: RuleInfo) {\n return `${getPluginName(rule.scope)}/${rule.value}`\n}\n\ntype ScopeConfig = {\n /** Canonical plugin prefix used by Oxlint for this internal rule scope. */\n pluginName: string\n /** Additional accepted rule prefixes that should resolve to the same builtin rule. */\n prefixAliases?: string[]\n}\n\n/**\n * Maps oxlint's internal rule scopes to user-facing plugin prefixes and known\n * compatibility aliases accepted by oxlint.\n *\n * This mirrors the plugin scope normalization in Oxlint so rules configured\n * with aliases like `@typescript-eslint/no-unused-vars`,\n * `react-hooks/rules-of-hooks`, or `deepscan/no-...` resolve to the same\n * builtin catalog entries as their canonical Oxlint rule IDs.\n *\n * @see https://github.com/oxc-project/oxc/blob/f30a64c2/crates/oxc_linter/src/config/plugins.rs#L150-L184\n */\nconst SCOPE_CONFIG: Record<string, ScopeConfig> = {\n import: { pluginName: 'import', prefixAliases: ['import-x'] },\n jsx_a11y: { pluginName: 'jsx-a11y', prefixAliases: ['jsx_a11y', 'jsx-a11y-x', 'jsx_a11y-x'] },\n oxc: { pluginName: 'oxc', prefixAliases: ['deepscan'] },\n react: { pluginName: 'react', prefixAliases: ['react-hooks', 'react_hooks'] },\n react_perf: { pluginName: 'react-perf', prefixAliases: ['react_perf'] },\n typescript: {\n pluginName: 'typescript',\n prefixAliases: ['@typescript-eslint', 'typescript-eslint', 'typescript_eslint'],\n },\n}\n\nfunction getPluginName(scope: string): string {\n return SCOPE_CONFIG[scope]?.pluginName ?? scope\n}\n\nfunction createBareBuiltinRuleIds(rules: RuleInfo[]): Set<string> {\n return new Set(rules.filter((rule) => rule.scope === 'eslint').map((rule) => getBuiltinRuleId(rule)))\n}\n\nfunction getBuiltinRuleAliases(rule: RuleInfo, ruleId: string, bareRuleIds: Set<string>): string[] {\n const config = SCOPE_CONFIG[rule.scope]\n const aliases = [ruleId]\n\n if (bareRuleIds.has(ruleId)) {\n aliases.push(rule.value)\n }\n\n for (const prefix of config?.prefixAliases ?? []) {\n aliases.push(`${prefix}/${rule.value}`)\n }\n\n return aliases\n}\n\nfunction getRuleName(ruleId: string) {\n return ruleId.split('/').at(-1) ?? ruleId\n}\n\nfunction getConfiguredPluginName(ruleId: string) {\n const segments = ruleId.split('/')\n\n if (segments.length < 2) {\n return\n }\n\n if (ruleId.startsWith('@') && segments.length > 2) {\n return `${segments[0]}/${segments[1]}`\n }\n\n return segments[0]\n}\n"],"mappings":";;;;;;;AA2CA,MAAa,eAAe;CAAC;CAAkB;CAAmB;AAAkB;AAEpF,SAAS,eAAe,OAAgB;CACtC,OAAO,YAAY,UAAU;EAC3B;EACA,SAAS;GACP,GAAG;GACH,UAAU;EACZ;EACA;CACF,CAAC;AACH;AAEA,MAAM,kBAAkB,eAAe,IAAI;AAE3C,SAAS,UAAU,UAAkB,SAAiD;CACpF,MAAM,SAAuB,CAAC;CAC9B,MAAM,SAAS,MAAM,SAAS,QAAQ,EAAE,oBAAoB,KAAK,CAAC;CAClE,MAAM,CAAC,SAAS;CAEhB,IAAI,OACF,MAAM,IAAI,MAAM,kBAAkB,SAAS,IAAI,oBAAoB,MAAM,KAAK,EAAE,aAAa,MAAM,QAAQ;CAG7G,OAAO,UAAU;AACnB;;;;;;;;;;AAWA,eAAsB,UAAU,UAA4B,CAAC,GAAuC;CAClG,MAAM,MAAM,QAAQ,OAAO,QAAQ,IAAI;CACvC,MAAM,WAAW,QAAQ,UAAU,QAAQ,eAAe,KAAK,IAAI;CACnE,MAAM,SAAS,QAAQ,aACnB,MAAM,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}
1
+ {"version":3,"file":"index.mjs","names":["getPluginName","pkgJson.version"],"sources":["../src/config.ts","../package.json","../src/plugins.ts","../src/rules.ts","../src/utils.ts","../src/inspect.ts"],"sourcesContent":["import type { PublicExplorer } from 'cosmiconfig'\nimport type { ParseError } from 'jsonc-parser'\nimport type { OxlintConfig } from 'oxlint'\n\nimport path from 'node:path'\n\nimport { cosmiconfig, defaultLoaders } from 'cosmiconfig'\nimport { createJiti } from 'jiti'\nimport { parse, printParseErrorCode } from 'jsonc-parser'\n\ntype JsonOxlintConfig = Omit<OxlintConfig, 'extends'> & {\n extends?: string[]\n}\n\ntype ConfigInput = Omit<OxlintConfig, 'extends'> & {\n extends?: Array<string | ConfigInput>\n}\n\nexport type GetConfigOptions = {\n /** Whether to cache discovered and loaded config files. Defaults to `true`. */\n cache?: boolean\n /** An explicit path to the config file. When provided, cosmiconfig loads this file directly instead of searching. */\n configFile?: string\n /** The directory to search for a config file. Defaults to `process.cwd()`. */\n cwd?: string\n}\n\n/**\n * An Oxlint config with all `extends` resolved and the field removed.\n */\ntype ResolvedOxlintConfig = Omit<OxlintConfig, 'extends'>\n\n/**\n * The result of loading and resolving a config file from disk.\n */\nexport type LoadedOxlintConfig = {\n config: ResolvedOxlintConfig\n /** Every config file visited during resolution (including extended files). */\n files: string[]\n /** Absolute path to the root config file. */\n filepath: string\n}\n\n/** Known Oxlint config file names, searched in order by cosmiconfig. */\nexport const searchPlaces = ['.oxlintrc.json', '.oxlintrc.jsonc', 'oxlint.config.ts']\n\nfunction createExplorer(cache: boolean) {\n const loadTs = createTypeScriptLoader(cache)\n\n return cosmiconfig('oxlint', {\n cache,\n loaders: {\n ...defaultLoaders,\n '.jsonc': loadJsonc,\n '.ts': loadTs,\n },\n searchPlaces,\n })\n}\n\nconst defaultExplorer = createExplorer(true)\n\nfunction loadJsonc(filepath: string, content: string): Record<string, unknown> | null {\n const errors: ParseError[] = []\n const config = parse(content, errors, { allowTrailingComma: true }) as Record<string, unknown> | null\n const [error] = errors\n\n if (error) {\n throw new Error(`JSONC Error in ${filepath}: ${printParseErrorCode(error.error)} at offset ${error.offset}`)\n }\n\n return config ?? null\n}\n\nfunction createTypeScriptLoader(cache: boolean): (filepath: string) => Promise<Record<string, unknown> | null> {\n const jiti = createJiti(import.meta.url, {\n fsCache: cache,\n moduleCache: cache,\n })\n\n return async (filepath: string) => jiti.import<Record<string, unknown> | null>(filepath, { default: true })\n}\n\n/**\n * Loads and resolves an Oxlint configuration file.\n *\n * Discovers the config via cosmiconfig (searching from `cwd` or loading a\n * specific `configFile`), then recursively resolves all `extends` chains.\n *\n * @param options - See {@link GetConfigOptions}.\n * @returns The resolved config with all extensions flattened, or `null` if no config file is found.\n */\nexport async function getConfig(options: GetConfigOptions = {}): Promise<LoadedOxlintConfig | null> {\n const cwd = options.cwd ?? process.cwd()\n const explorer = options.cache === false ? createExplorer(false) : defaultExplorer\n const result = options.configFile\n ? await explorer.load(path.resolve(cwd, options.configFile))\n : await explorer.search(cwd)\n\n if (!result || result.isEmpty) {\n return null\n }\n\n const files = new Set<string>([result.filepath])\n const config = await resolveConfig(\n result.config as ConfigInput,\n result.filepath,\n files,\n new Set([result.filepath]),\n explorer,\n )\n\n return {\n config,\n files: [...files],\n filepath: result.filepath,\n }\n}\n\n/**\n * Recursively resolves a config and all of its `extends`.\n *\n * Extended configs are loaded, filtered to their extendable fields, then\n * merged with the own config (own takes precedence).\n *\n * @param config - The config to resolve (may include an `extends` array).\n * @param filepath - Absolute path to the config file, used as the base for resolving relative `extends` paths.\n * @param files - Accumulator for all config file paths visited throughout the resolution tree.\n * @param resolvingFiles - Tracks in-flight files to detect circular extends.\n * @returns The fully resolved config with all `extends` flattened.\n */\nasync function resolveConfig(\n config: ConfigInput,\n filepath: string,\n files: Set<string>,\n resolvingFiles: Set<string>,\n explorer: PublicExplorer,\n): Promise<ResolvedOxlintConfig> {\n const extendedConfigs = await resolveExtends(config.extends, filepath, files, resolvingFiles, explorer)\n const ownConfig = stripExtends(config)\n\n return mergeConfigs([...extendedConfigs, ownConfig])\n}\n\n/**\n * Loads and resolves all entries in the `extends` array.\n *\n * Each entry is either a file path string (JSON/JSONC config) or an inline config\n * object (TS config). Inline configs are resolved recursively.\n *\n * Returned configs are filtered through {@link pickExtendableConfig} so only\n * inheritable fields survive.\n *\n * @param entries - The `extends` array from a config (string paths or inline config objects).\n * @param filepath - Absolute path to the parent config file, used as the base for resolving relative path strings.\n * @param files - Accumulator for all config file paths visited.\n * @param resolvingFiles - Shared set tracking in-flight files across the entire extends tree. Each extend branch receives a snapshot copy to isolate per-branch cycles.\n * @returns An array of resolved configs with only extendable fields.\n */\nasync function resolveExtends(\n entries: ConfigInput['extends'],\n filepath: string,\n files: Set<string>,\n resolvingFiles: Set<string>,\n explorer: PublicExplorer,\n) {\n if (!entries?.length) {\n return []\n }\n\n const configs = await Promise.all(\n entries.map(async (entry) => {\n const resolvingBranch = new Set(resolvingFiles)\n\n if (typeof entry === 'string') {\n return loadJsonLikeConfig(path.resolve(path.dirname(filepath), entry), files, resolvingBranch, explorer)\n }\n\n return resolveConfig(entry, filepath, files, resolvingBranch, explorer)\n }),\n )\n\n return configs.map((config) => pickExtendableConfig(config))\n}\n\n/**\n * Loads a JSON or JSONC config from disk at the given file path and resolves its\n * `extends` chain.\n *\n * @param filepath - Absolute path to the JSON or JSONC config file to load.\n * @param files - Accumulator for all config file paths visited.\n * @param resolvingFiles - Set tracking in-flight files for cycle detection.\n * @returns The fully resolved config from this file.\n * @throws If a circular extends reference is detected.\n * @throws If the file cannot be loaded by cosmiconfig.\n */\nasync function loadJsonLikeConfig(\n filepath: string,\n files: Set<string>,\n resolvingFiles: Set<string>,\n explorer: PublicExplorer,\n) {\n if (resolvingFiles.has(filepath)) {\n throw new Error(`Circular Oxlint config extends detected: ${filepath}`)\n }\n\n const result = await explorer.load(filepath)\n\n if (!result || result.isEmpty) {\n throw new Error(`Unable to load extended Oxlint config: ${filepath}`)\n }\n\n files.add(result.filepath)\n resolvingFiles.add(result.filepath)\n\n try {\n return await resolveConfig(result.config as JsonOxlintConfig, result.filepath, files, resolvingFiles, explorer)\n } finally {\n resolvingFiles.delete(result.filepath)\n }\n}\n\n/**\n * Returns a shallow copy of the config with the `extends` key removed.\n *\n * The resulting object represents the \"own\" config (i.e., what this file\n * declares without inherited contributions).\n *\n * @param config - The original config (may include `extends`).\n * @returns A shallow copy of the config without the `extends` property.\n */\nfunction stripExtends(config: ConfigInput): ResolvedOxlintConfig {\n const rest: ConfigInput = { ...config }\n delete rest.extends\n\n return rest\n}\n\n/**\n * Picks only the fields that are inherited through `extends`.\n *\n * Per Oxlint docs, only `rules`, `plugins`, and `overrides` are extendable.\n * Other fields (env, globals, settings, categories, jsPlugins, etc.) are\n * intentionally dropped.\n *\n * If Oxlint changes this behavior, this function must be updated accordingly.\n *\n * @param config - A fully resolved config.\n * @returns A new config object containing only `plugins`, `rules`, and `overrides` (if present in the source).\n * @see https://oxc.rs/docs/guide/usage/linter/nested-config.html#extending-configuration-files\n */\nfunction pickExtendableConfig(config: ResolvedOxlintConfig): ResolvedOxlintConfig {\n const picked: ResolvedOxlintConfig = {}\n\n if (config.plugins) {\n picked.plugins = config.plugins\n }\n\n if (config.rules) {\n picked.rules = config.rules\n }\n\n if (config.overrides) {\n picked.overrides = config.overrides\n }\n\n return picked\n}\n\n/**\n * Merges an ordered list of resolved configs into a single config.\n *\n * The first config serves as the base. Each subsequent config contributes\n * its fields with the following merge strategies:\n *\n * - **plugins** — concatenated (union of all enabled plugins)\n * - **overrides** — concatenated\n * - **rules** — cascading override (later entries win on conflict)\n * - **all other** — last-write-wins via {@link Object.assign}\n *\n * @param configs - An ordered list of configs to merge (base first, own config last).\n * @returns A single merged config.\n */\nfunction mergeConfigs(configs: ResolvedOxlintConfig[]) {\n const merged: ResolvedOxlintConfig = {}\n\n for (const config of configs) {\n const overrides = mergeArrays(merged.overrides, config.overrides)\n const plugins = mergeArrays(merged.plugins, config.plugins)\n const rules = { ...merged.rules, ...config.rules }\n\n Object.assign(merged, config)\n merged.overrides = overrides\n merged.plugins = plugins\n merged.rules = rules\n }\n\n return merged\n}\n\n/**\n * Concatenates two arrays, handling the case where either is undefined.\n *\n * If both are undefined the result is undefined; if only one is defined it\n * is returned as-is; if both are defined they are concatenated with `base`\n * coming first.\n *\n * @param base - The base array (elements appear first in the result).\n * @param override - The override array (elements appear after the base).\n * @returns The concatenated array, or `undefined` if both inputs are falsy.\n */\nfunction mergeArrays<T>(base: T[] | undefined, override: T[] | undefined) {\n if (!base) {\n return override\n }\n\n if (!override) {\n return base\n }\n\n return [...base, ...override]\n}\n","","import type { Jiti } from 'jiti'\nimport type { ExternalPluginEntry } from 'oxlint'\nimport type { LoadedOxlintConfig } from './config'\n\nimport path from 'node:path'\nimport { fileURLToPath, pathToFileURL } from 'node:url'\n\nimport { createJiti } from 'jiti'\n\ntype JsPlugin = {\n meta?: {\n name?: string\n }\n rules?: Record<string, JsPluginRuleDefinition>\n}\n\ntype JsPluginRuleDefinition = {\n meta?: unknown\n}\n\ntype PluginRuleInfo = {\n /** The rule's own metadata (e.g. schema, deprecation info). */\n meta?: unknown\n /** The rule name as exported by the plugin (without prefix). */\n name: string\n /** The plugin name this rule belongs to. */\n pluginName: string\n /** The fully-qualified rule ID, e.g. `\"my-plugin/my-rule\"`. */\n ruleId: string\n}\n\n/**\n * Information about a successfully loaded JS plugin.\n */\nexport type PluginInfo = {\n name: string\n /** The resolved file path to the plugin module on disk. */\n resolvedPath: string\n rules: PluginRuleInfo[]\n /** The original specifier used to load the plugin (path or package name). */\n specifier: string\n}\n\n/**\n * Represents an error that occurred while loading a JS plugin entry.\n */\nexport type PluginLoadError = {\n message: string\n name?: string\n specifier: string\n}\n\n/**\n * The result of loading JS plugins from a config, including any failures.\n */\nexport type LoadedPlugins = {\n errors: PluginLoadError[]\n plugins: PluginInfo[]\n}\n\ntype PluginLoadResult = PluginInfo | PluginLoadError\n\n/**\n * Loads all JS plugins declared in the config (both root-level and override-level).\n *\n * Each plugin entry is imported dynamically. Failures are captured as\n * {@link PluginLoadError} rather than thrown, so partial success is possible.\n *\n * @param config - The loaded Oxlint config.\n * @returns All successfully loaded plugins and any load errors encountered.\n */\nexport async function getPlugins(config: LoadedOxlintConfig): Promise<LoadedPlugins> {\n const entries = getPluginEntries(config)\n const pluginLoader = createJiti(config.filepath)\n const results = await Promise.all(\n entries.map(async (entry) => {\n try {\n return await loadPlugin(entry, config.filepath, pluginLoader)\n } catch (error) {\n return createPluginLoadError(entry, error)\n }\n }),\n )\n const errors: PluginLoadError[] = []\n const plugins: PluginInfo[] = []\n\n for (const result of results) {\n if (isPluginLoadError(result)) {\n errors.push(result)\n continue\n }\n\n plugins.push(result)\n }\n\n return {\n errors,\n plugins,\n }\n}\n\n/**\n * Collects all unique JS plugin entries from root-level and override-level config, deduplicating by key.\n */\nfunction getPluginEntries(config: LoadedOxlintConfig) {\n const entries = new Map<string, ExternalPluginEntry>()\n\n for (const entry of config.config.jsPlugins ?? []) {\n entries.set(getPluginEntryKey(entry), entry)\n }\n\n for (const override of config.config.overrides ?? []) {\n for (const entry of override.jsPlugins ?? []) {\n entries.set(getPluginEntryKey(entry), entry)\n }\n }\n\n return [...entries.values()]\n}\n\n/**\n * Computes a deduplication key for a plugin entry.\n *\n * String entries use the specifier itself as the key. Object entries use\n * `\"name:specifier\"` so that the same package loaded under a different alias\n * is treated as a distinct plugin.\n *\n * @param entry - The plugin entry (string specifier or object).\n * @returns A unique key string for deduplication.\n */\nfunction getPluginEntryKey(entry: ExternalPluginEntry) {\n if (typeof entry === 'string') {\n return entry\n }\n\n return `${entry.name}:${entry.specifier}`\n}\n\n/**\n * Wraps an error thrown during plugin loading into a structured {@link PluginLoadError}.\n */\nfunction createPluginLoadError(entry: ExternalPluginEntry, error: unknown): PluginLoadError {\n return {\n message: error instanceof Error ? error.message : String(error),\n name: typeof entry === 'string' ? undefined : entry.name,\n specifier: getPluginSpecifier(entry),\n }\n}\n\n/**\n * Type guard that discriminates {@link PluginLoadError} from {@link PluginInfo}.\n */\nfunction isPluginLoadError(result: PluginLoadResult): result is PluginLoadError {\n return 'message' in result\n}\n\n/**\n * Resolves, imports, and extracts rule information from a single JS plugin entry.\n */\nasync function loadPlugin(entry: ExternalPluginEntry, configFilepath: string, pluginLoader: Jiti): Promise<PluginInfo> {\n const specifier = getPluginSpecifier(entry)\n const resolvedPath = resolvePluginPath(specifier, configFilepath, pluginLoader)\n const plugin = await importPlugin(resolvedPath, pluginLoader)\n const name = getPluginName(entry, specifier, plugin)\n const rules = getPluginRules(name, plugin)\n\n return {\n name,\n resolvedPath,\n rules,\n specifier,\n }\n}\n\n/**\n * Extracts the specifier (path or package name) from a plugin entry.\n */\nfunction getPluginSpecifier(entry: ExternalPluginEntry) {\n if (typeof entry === 'string') {\n return entry\n }\n\n return entry.specifier\n}\n\n/**\n * Resolves a plugin specifier to an absolute file path.\n *\n * Handles three cases: `file:` URLs, relative/absolute path specifiers\n * (resolved against the config file directory), and bare package specifiers\n * (resolved via Node's module resolution).\n *\n * @param specifier - The plugin specifier string.\n * @param configFilepath - Absolute path to the config file declaring the plugin.\n * @returns The absolute file path to the plugin module.\n */\nfunction resolvePluginPath(specifier: string, configFilepath: string, pluginLoader: Jiti) {\n if (specifier.startsWith('file:')) {\n return fileURLToPath(specifier)\n }\n\n const resolved = pluginLoader.esmResolve(specifier, {\n parentURL: pathToFileURL(configFilepath).href,\n })\n\n return resolved.startsWith('file:') ? fileURLToPath(resolved) : resolved\n}\n\n/**\n * Dynamically imports a plugin module and validates that it is a {@link JsPlugin}.\n *\n * @throws {TypeError} If the imported module is not a valid plugin object.\n */\nasync function importPlugin(resolvedPath: string, pluginLoader: Jiti): Promise<JsPlugin> {\n const plugin = await pluginLoader.import(pathToFileURL(resolvedPath).href, { default: true })\n\n if (!isJsPlugin(plugin)) {\n throw new TypeError(`Invalid Oxlint JS plugin: ${resolvedPath}`)\n }\n\n return plugin\n}\n\n/**\n * Type guard that checks whether a value is a non-null object (valid JS plugin).\n */\nfunction isJsPlugin(value: unknown): value is JsPlugin {\n return typeof value === 'object' && value !== null\n}\n\n/**\n * Determines the plugin name based on the entry type and specifier.\n *\n * Priority:\n * 1. Object entry — uses the explicitly provided `name` (alias).\n * 2. Path specifier — uses `meta.name` from the plugin, falling back to the basename.\n * 3. Package specifier — normalizes the package name (strips `eslint-plugin-` prefix).\n */\nfunction getPluginName(entry: ExternalPluginEntry, specifier: string, plugin: JsPlugin) {\n if (typeof entry !== 'string') {\n return entry.name\n }\n\n if (isPathSpecifier(specifier)) {\n return plugin.meta?.name ?? path.basename(specifier, path.extname(specifier))\n }\n\n return normalizePackagePluginName(specifier)\n}\n\n/**\n * Extracts rule definitions from a loaded plugin and wraps them with metadata.\n */\nfunction getPluginRules(pluginName: string, plugin: JsPlugin) {\n const rules = plugin.rules ?? {}\n const infos: PluginRuleInfo[] = []\n\n for (const [name, rule] of Object.entries(rules)) {\n infos.push({\n meta: rule.meta,\n name,\n pluginName,\n ruleId: `${pluginName}/${name}`,\n })\n }\n\n return infos\n}\n\n/**\n * Returns `true` if the specifier looks like a local file path (starts with `./`, `../`, or `/`).\n */\nfunction isPathSpecifier(specifier: string) {\n return specifier.startsWith('.') || specifier.startsWith('/')\n}\n\n/**\n * Derives a plugin name from a resolved npm package path.\n *\n * Strips the `eslint-plugin-` prefix and handles scoped packages\n * (e.g. `@scope/eslint-plugin-foo` becomes `@scope/foo`).\n */\nfunction normalizePackagePluginName(specifier: string) {\n const packageName = specifier.split('/node_modules/').at(-1) ?? specifier\n\n if (packageName.startsWith('@')) {\n const [scope, name] = packageName.split('/')\n const scopedName = scope ?? packageName\n\n if (name === 'eslint-plugin') {\n return scopedName\n }\n\n if (!name) {\n return scopedName\n }\n\n return `${scopedName}/${name.replace(/^eslint-plugin-?/, '')}`\n }\n\n return packageName.replace(/^eslint-plugin-?/, '')\n}\n","import type { RuleInfo } from './types'\n\nimport { x } from 'tinyexec'\n\nlet oxlintBinaryAvailability: Promise<boolean> | undefined\n\nexport async function getOxlintRules() {\n if (!(await isOxlintBinaryAvailable())) {\n console.error('Unable to inspect builtin Oxlint rules because the `oxlint` binary is not available on PATH.')\n return []\n }\n\n try {\n const rules = await x('oxlint', ['--rules', '--format=json'])\n return JSON.parse(rules.stdout) as RuleInfo[]\n } catch (error) {\n console.error('Error fetching Oxlint rules:', error)\n return []\n }\n}\n\nasync function isOxlintBinaryAvailable() {\n oxlintBinaryAvailability ??= checkOxlintBinaryAvailability()\n\n return oxlintBinaryAvailability\n}\n\nasync function checkOxlintBinaryAvailability() {\n try {\n await x('oxlint', ['--version'])\n return true\n } catch {\n return false\n }\n}\n","/** Type guard that checks whether a value is a non-null object (record). */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null\n}\n\n/** Returns the string value if it is a string, or `undefined` otherwise. */\nexport function getString(value: unknown) {\n return typeof value === 'string' ? value : undefined\n}\n\n/** Returns the boolean value if it is a boolean, or `undefined` otherwise. */\nexport function getBoolean(value: unknown) {\n return typeof value === 'boolean' ? value : undefined\n}\n","import type { RuleCategories } from 'oxlint'\nimport type { GetConfigOptions, LoadedOxlintConfig } from './config'\nimport type { PluginInfo, PluginLoadError } from './plugins'\nimport type { RuleInfo } from './types'\n\nimport pkgJson from '../package.json'\nimport { getConfig } from './config'\nimport { getPlugins } from './plugins'\nimport { getOxlintRules } from './rules'\nimport { getBoolean, getString, isRecord } from './utils'\n\n/**\n * Origin of a plugin entry discovered during config inspection.\n */\nexport type InspectedPluginSource = 'builtin' | 'js-plugin'\n\n/**\n * Summary information about a builtin or JS plugin discovered during config inspection.\n */\nexport type InspectedPlugin = {\n /** Number of rules exported by the plugin. */\n ruleCount: number\n /** The plugin name used as the rule prefix. */\n name: string\n /** The original specifier used to load the JS plugin (path or package name). */\n specifier?: string\n /** Whether this is an Oxlint builtin plugin scope or a loaded JS plugin. */\n source: InspectedPluginSource\n}\n\n/**\n * Error information for a JS plugin that failed to load during config inspection.\n */\nexport type InspectedPluginLoadError = PluginLoadError\n\n/**\n * Normalized severity for a configured or cataloged Oxlint rule.\n */\nexport type RuleSeverity = 'error' | 'warn' | 'off' | 'unknown'\n\n/**\n * Origin of a rule discovered during config inspection.\n */\nexport type InspectedRuleSource = 'builtin' | 'js-plugin' | 'unknown'\n\n/**\n * ESLint-compatible rule type, when supplied by JS plugin metadata.\n */\nexport type InspectedRuleType = 'layout' | 'problem' | 'suggestion'\n\n/**\n * Normalized severity state used by the inspector UI.\n */\nexport type InspectedRuleUsageSeverity = 'error' | 'warn' | 'off'\n\n/**\n * Normalized representation of a rule entry from an Oxlint config.\n */\nexport type InspectedRuleConfig = {\n /** Rule options after the severity tuple item, or an empty array when none are configured. */\n options: unknown[]\n /** The original unmodified config value for the rule. */\n raw: unknown\n /** The rule ID exactly as it appeared in the config entry. */\n ruleId: string\n /** The normalized severity parsed from the config value. */\n severity: RuleSeverity\n}\n\n/**\n * Aggregate counts derived from inspected rules.\n */\nexport type InspectConfigStats = {\n /** Number of builtin rules known to the inspector. */\n builtinRules: number\n /** Number of rules configured at the root config level. */\n configuredRules: number\n /** Number of deprecated rules known to the inspector. */\n deprecatedRules: number\n /** Number of rules enabled by default, root config, or override config. */\n enabledRules: number\n /** Number of rules that can apply an automatic fix. */\n fixableRules: number\n /** Number of JS plugin rules known to the inspector. */\n jsPluginRules: number\n /** Number of rules configured in one or more override blocks. */\n overrideRules: number\n /** Number of rules that belong to a recommended rule set. */\n recommendedRules: number\n /** Total number of builtin, JS plugin, and unknown rules known to the inspector. */\n totalRules: number\n /** Number of configured rules that were not found in the builtin catalog or loaded JS plugins. */\n unknownRules: number\n}\n\n/**\n * Compact usage references for category, root, and override configuration.\n */\nexport type InspectedRuleUsage = {\n /** Whether this rule is enabled by a category-level severity config. */\n category: boolean\n /** Override group indexes that configure this rule. */\n overrideGroups: number[]\n /** Whether this rule is configured at the root config level. */\n root: boolean\n}\n\n/**\n * A builtin, JS plugin, or unknown rule with its catalog metadata and config state.\n */\nexport type InspectedRule = {\n /** Rule IDs that resolve to this rule, including compatibility aliases. */\n aliases: string[]\n /** Oxlint category for builtin rules, when available. */\n category?: string\n /** Root-level config applied to this rule, when configured. */\n configured?: InspectedRuleConfig\n /** Severity implied by the rule catalog before user configuration is applied. */\n defaultSeverity: RuleSeverity\n /** Human-readable rule description from ESLint-compatible rule metadata, when available. */\n description?: string\n /** Whether the rule is deprecated. */\n deprecated: boolean\n /** Documentation URL for builtin rules, when available. */\n docsUrl?: string\n /** Whether the rule can apply an automatic fix. */\n fixable: boolean\n /** Whether the rule can provide editor suggestions. */\n hasSuggestions: boolean\n /** Rule metadata provided by a JS plugin rule, when available. */\n meta?: unknown\n /** Rule name without the plugin prefix. */\n name: string\n /** Whether this rule is configured but explicitly turned off everywhere. */\n offOnly: boolean\n /** Whether this rule has more than one normalized usage severity. */\n overloaded: boolean\n /** Plugin or scope name for the rule, when the rule ID has one. */\n pluginName?: string\n /** Whether the rule belongs to the recommended/default-enabled rule set. */\n recommended: boolean\n /** Replacement rule IDs or names declared by deprecation metadata. */\n replacedBy: string[]\n /** Canonical rule ID used by the inspector. */\n ruleId: string\n /** Lowercase text index used by inspector search. */\n searchText: string\n /** Unique normalized severities present on this rule, ordered as error, warn, then off. */\n severityStates: InspectedRuleUsageSeverity[]\n /** ESLint-compatible rule type, when available. */\n ruleType?: InspectedRuleType\n /** Source that supplied this rule. */\n source: InspectedRuleSource\n /** Whether a builtin rule requires type information, when available. */\n typeAware?: boolean\n /** Compact usage references for default, root, and override configuration. */\n usage: InspectedRuleUsage\n /** Whether this rule is used by default, root config, or override config. */\n used: boolean\n}\n\n/**\n * A rule entry grouped under a config override block.\n */\nexport type InspectedOverrideGroupRule = {\n /** Rule options after the severity tuple item, or an empty array when none are configured. */\n options: unknown[]\n /** The original unmodified config value for the rule. */\n raw: unknown\n /** Canonical rule ID used by the inspector. */\n ruleId: string\n /** Normalized severity parsed from the override config value. */\n severity: RuleSeverity\n /** Source that supplied this rule. */\n source: InspectedRuleSource\n}\n\n/**\n * A normalized config override block.\n */\nexport type InspectedOverrideGroup = {\n /** File globs excluded by the override, when configured. */\n excludeFiles?: string[]\n /** File globs included by the override. */\n files: string[]\n /** Zero-based position of the override in the resolved config. */\n index: number\n /** Plugins enabled by this override block. */\n plugins?: string[]\n /** Rules configured by this override block. */\n rules: InspectedOverrideGroupRule[]\n}\n\n/**\n * Complete inspection result for a resolved Oxlint config.\n */\nexport type InspectConfigResult = {\n /** Every config file visited while resolving `extends`. */\n configFiles: string[]\n /** Absolute path to the root config file that was inspected. */\n configFilepath: string\n /** ISO 8601 timestamp for when this inspection result was generated. */\n generatedAt: string\n /** Override blocks from the resolved config, including blocks without rule configs. */\n overrideGroups: InspectedOverrideGroup[]\n /** JS plugin load errors encountered during inspection. */\n pluginErrors: InspectedPluginLoadError[]\n /** Builtin plugin scopes and JS plugins discovered during inspection. */\n plugins: InspectedPlugin[]\n /** Available plugin filter values derived from inspected rules. */\n rulePluginFilters: string[]\n /** All builtin, JS plugin, and unknown rules known to the inspector. */\n rules: InspectedRule[]\n /** Aggregate counts derived from inspected rules. */\n stats: InspectConfigStats\n /** Configured rules that were not found in the builtin catalog or loaded JS plugins. */\n unknownRules: InspectedRule[]\n /** The inspector package version that produced this result. */\n version: string\n}\n\ntype RuleCatalog = {\n aliasesByRuleId: Map<string, Set<string>>\n ruleIdByAlias: Map<string, string>\n rulesById: Map<string, InspectedRule>\n}\n\n/**\n * Loads an Oxlint config and returns an inspection model for its rules and JS plugins.\n *\n * @param options - See {@link GetConfigOptions}.\n * @returns The inspected config result, or `null` if no config file is found.\n */\nexport async function inspectConfig(options: GetConfigOptions = {}): Promise<InspectConfigResult | null> {\n const config = await getConfig(options)\n\n if (!config) {\n return null\n }\n\n const [builtinRules, loadedPlugins] = await Promise.all([getOxlintRules(), getPlugins(config)])\n\n return inspectLoadedConfig(config, builtinRules, loadedPlugins.plugins, loadedPlugins.errors)\n}\n\n/**\n * Builds an inspection model from an already loaded config and precomputed rule catalogs.\n *\n * @param config - The resolved Oxlint config to inspect.\n * @param builtinRules - Builtin Oxlint rules to include in the catalog.\n * @param plugins - Successfully loaded JS plugins to include in the catalog.\n * @param pluginErrors - JS plugin load errors to surface in the inspection result.\n * @returns The inspected config result.\n */\nexport function inspectLoadedConfig(\n config: LoadedOxlintConfig,\n builtinRules: RuleInfo[],\n plugins: PluginInfo[],\n pluginErrors: PluginLoadError[],\n): InspectConfigResult {\n const enabledPlugins = [\n ...(config.config.plugins ?? []),\n ...(config.config.overrides?.flatMap((o) => o.plugins ?? []) ?? []),\n ]\n\n const catalog = createRuleCatalog(builtinRules, plugins, enabledPlugins, config.config.categories)\n\n applyConfiguredRules(catalog, config.config.rules)\n\n const overrideGroups = createInspectedOverrideGroups(catalog, config.config.overrides)\n const overrideSeveritiesByRuleId = createOverrideSeveritiesByRuleId(overrideGroups)\n\n const rules = [...catalog.rulesById.values()]\n .map((rule) => {\n const usage = createRuleUsageSummary(rule, overrideSeveritiesByRuleId.get(rule.ruleId) ?? [])\n\n const aliases = [...(catalog.aliasesByRuleId.get(rule.ruleId) ?? [])]\n const inspectedRule = {\n ...rule,\n ...usage,\n aliases,\n }\n\n return {\n ...inspectedRule,\n searchText: createRuleSearchText(inspectedRule),\n }\n })\n .toSorted((left, right) => left.ruleId.localeCompare(right.ruleId))\n\n return {\n configFiles: config.files,\n configFilepath: config.filepath,\n generatedAt: new Date().toISOString(),\n overrideGroups,\n pluginErrors,\n plugins: createInspectedPlugins(plugins, rules),\n rulePluginFilters: createRulePluginFilters(rules),\n rules,\n stats: createInspectConfigStats(rules),\n unknownRules: rules.filter((rule) => rule.source === 'unknown'),\n version: pkgJson.version,\n }\n}\n\nfunction createInspectConfigStats(rules: InspectedRule[]): InspectConfigStats {\n return {\n builtinRules: rules.filter((rule) => rule.source === 'builtin').length,\n configuredRules: rules.filter((rule) => rule.configured).length,\n deprecatedRules: rules.filter((rule) => rule.deprecated).length,\n enabledRules: rules.filter((rule) => rule.severityStates.some((severity) => severity !== 'off')).length,\n fixableRules: rules.filter((rule) => rule.fixable).length,\n jsPluginRules: rules.filter((rule) => rule.source === 'js-plugin').length,\n overrideRules: rules.filter((rule) => rule.usage.overrideGroups.length > 0).length,\n recommendedRules: rules.filter((rule) => rule.recommended).length,\n totalRules: rules.length,\n unknownRules: rules.filter((rule) => rule.source === 'unknown').length,\n }\n}\n\nfunction createRulePluginFilters(rules: InspectedRule[]): string[] {\n const pluginNames = new Set<string>()\n\n for (const rule of rules) {\n if (rule.pluginName) {\n pluginNames.add(rule.pluginName)\n }\n }\n\n return ['all', ...[...pluginNames].toSorted((left, right) => left.localeCompare(right))]\n}\n\nfunction createInspectedOverrideGroups(\n catalog: RuleCatalog,\n overrides: LoadedOxlintConfig['config']['overrides'],\n): InspectedOverrideGroup[] {\n const groups: InspectedOverrideGroup[] = []\n\n for (const [index, override] of overrides?.entries() ?? []) {\n const group: InspectedOverrideGroup = {\n excludeFiles: override.excludeFiles,\n files: override.files,\n index,\n plugins: override.plugins,\n rules: [],\n }\n\n if (override.rules) {\n for (const [ruleId, raw] of Object.entries(override.rules)) {\n const normalizedRuleId = getNormalizedRuleId(catalog, ruleId)\n const rule = getOrCreateUnknownRule(catalog, normalizedRuleId, ruleId)\n const config = createRuleConfig(ruleId, raw)\n\n rule.usage.overrideGroups.push(index)\n group.rules.push({\n options: config.options,\n raw: config.raw,\n ruleId: rule.ruleId,\n severity: config.severity,\n source: rule.source,\n })\n }\n }\n\n groups.push(group)\n }\n\n return groups\n}\n\nfunction createOverrideSeveritiesByRuleId(overrideGroups: InspectedOverrideGroup[]) {\n const severitiesByRuleId = new Map<string, RuleSeverity[]>()\n\n for (const group of overrideGroups) {\n for (const rule of group.rules) {\n const severities = severitiesByRuleId.get(rule.ruleId) ?? []\n severities.push(rule.severity)\n severitiesByRuleId.set(rule.ruleId, severities)\n }\n }\n\n return severitiesByRuleId\n}\n\nfunction createRuleSearchText(rule: InspectedRule) {\n return [\n rule.ruleId,\n rule.name,\n rule.pluginName,\n rule.category,\n rule.source,\n rule.description,\n rule.ruleType,\n ...rule.aliases,\n ...rule.replacedBy,\n ]\n .filter(Boolean)\n .join(' ')\n .toLowerCase()\n}\n\nfunction createInspectedPlugins(plugins: PluginInfo[], rules: InspectedRule[]): InspectedPlugin[] {\n const inspectedPlugins = new Map<string, InspectedPlugin>()\n\n for (const rule of rules) {\n if (!rule.pluginName || rule.source === 'unknown') {\n continue\n }\n\n const key = `${rule.source}:${rule.pluginName}`\n const inspectedPlugin = inspectedPlugins.get(key) ?? {\n name: rule.pluginName,\n ruleCount: 0,\n source: rule.source,\n }\n\n inspectedPlugin.ruleCount += 1\n inspectedPlugins.set(key, inspectedPlugin)\n }\n\n for (const plugin of plugins) {\n const key = `js-plugin:${plugin.name}`\n const inspectedPlugin = inspectedPlugins.get(key) ?? {\n name: plugin.name,\n ruleCount: plugin.rules.length,\n source: 'js-plugin',\n }\n\n inspectedPlugins.set(key, {\n ...inspectedPlugin,\n specifier: plugin.specifier,\n })\n }\n\n return [...inspectedPlugins.values()].toSorted((left, right) => {\n if (left.source !== right.source) {\n return left.source.localeCompare(right.source)\n }\n\n return left.name.localeCompare(right.name)\n })\n}\n\nfunction createRuleCatalog(\n builtinRules: RuleInfo[],\n plugins: PluginInfo[],\n enabledPlugins: string[] | undefined,\n categories?: RuleCategories,\n): RuleCatalog {\n const bareBuiltinRuleIds = createBareBuiltinRuleIds(builtinRules)\n const enabledPluginNames = new Set(['eslint', ...(enabledPlugins ?? [])])\n /**\n * When categories are not explicitly configured, Oxlint applies a default\n * severity of `warn` to all correctness rules via the `RulesBuilder` defaults.\n *\n * @see https://github.com/oxc-project/oxc/blob/f30a64c26971a7eef6b4dd1b42c0a947555f47c0/crates/oxc_linter/src/config/config_builder.rs#L47-L51\n */\n const implicitCategoryDefaults: Record<string, unknown> = {\n correctness: 'warn',\n }\n const catalog: RuleCatalog = {\n aliasesByRuleId: new Map(),\n ruleIdByAlias: new Map(),\n rulesById: new Map(),\n }\n\n for (const rule of builtinRules) {\n const ruleId = getBuiltinRuleId(rule)\n const pluginName = getPluginName(rule.scope)\n const isPluginEnabled = enabledPluginNames.has(pluginName)\n const userCategorySeverity = categories?.[rule.category as keyof RuleCategories]\n const resolvedCategorySeverity = userCategorySeverity ?? implicitCategoryDefaults[rule.category]\n const useCategorySeverity = resolvedCategorySeverity !== undefined && isPluginEnabled\n const defaultSeverity = useCategorySeverity\n ? getRuleSeverity(resolvedCategorySeverity)\n : getDefaultSeverity(rule.default)\n\n const metadata = createBuiltinRuleMetadata(rule)\n\n catalog.rulesById.set(ruleId, {\n aliases: [],\n category: rule.category,\n defaultSeverity,\n ...metadata,\n name: rule.value,\n ...createEmptyRuleUsage(isPluginEnabled && useCategorySeverity),\n pluginName,\n ruleId,\n searchText: '',\n source: 'builtin',\n typeAware: rule.type_aware,\n })\n\n addAliases(catalog, ruleId, getBuiltinRuleAliases(rule, ruleId, bareBuiltinRuleIds))\n }\n\n for (const plugin of plugins) {\n for (const rule of plugin.rules) {\n const metadata = createPluginRuleMetadata(rule.meta)\n\n catalog.rulesById.set(rule.ruleId, {\n aliases: [],\n defaultSeverity: 'off',\n ...metadata,\n meta: rule.meta,\n name: rule.name,\n ...createEmptyRuleUsage(false),\n pluginName: plugin.name,\n ruleId: rule.ruleId,\n searchText: '',\n source: 'js-plugin',\n })\n\n addAliases(catalog, rule.ruleId, [rule.ruleId])\n }\n }\n\n return catalog\n}\n\nfunction applyConfiguredRules(catalog: RuleCatalog, rules: Record<string, unknown> | undefined) {\n if (!rules) {\n return\n }\n\n for (const [ruleId, raw] of Object.entries(rules)) {\n const normalizedRuleId = getNormalizedRuleId(catalog, ruleId)\n const rule = getOrCreateUnknownRule(catalog, normalizedRuleId, ruleId)\n const configured = createRuleConfig(ruleId, raw)\n\n rule.configured = configured\n rule.usage.root = true\n }\n}\n\nfunction getOrCreateUnknownRule(catalog: RuleCatalog, normalizedRuleId: string, configuredRuleId: string) {\n const rule = catalog.rulesById.get(normalizedRuleId)\n\n if (rule) {\n return rule\n }\n\n const unknownRule: InspectedRule = {\n aliases: [],\n defaultSeverity: 'unknown',\n deprecated: false,\n fixable: false,\n hasSuggestions: false,\n name: getRuleName(configuredRuleId),\n ...createEmptyRuleUsage(false),\n pluginName: getConfiguredPluginName(configuredRuleId),\n recommended: false,\n replacedBy: [],\n ruleId: configuredRuleId,\n searchText: '',\n source: 'unknown',\n }\n\n catalog.rulesById.set(configuredRuleId, unknownRule)\n addAliases(catalog, configuredRuleId, [configuredRuleId])\n\n return unknownRule\n}\n\nfunction createRuleConfig(ruleId: string, raw: unknown): InspectedRuleConfig {\n return {\n options: getRuleOptions(raw),\n raw,\n ruleId,\n severity: getRuleSeverity(raw),\n }\n}\n\nfunction getRuleSeverity(raw: unknown): RuleSeverity {\n let severity = raw\n\n if (Array.isArray(raw)) {\n severity = (raw as unknown[])[0]\n }\n\n if (typeof severity === 'number') {\n if (severity === 0) {\n return 'off'\n }\n\n if (severity === 1) {\n return 'warn'\n }\n\n if (severity === 2) {\n return 'error'\n }\n\n return 'unknown'\n }\n\n if (typeof severity !== 'string') {\n return 'unknown'\n }\n\n if (severity === 'allow' || severity === 'off') {\n return 'off'\n }\n\n if (severity === 'deny' || severity === 'error') {\n return 'error'\n }\n\n if (severity === 'warn') {\n return severity\n }\n\n return 'unknown'\n}\n\nfunction getRuleOptions(raw: unknown): unknown[] {\n if (!Array.isArray(raw)) {\n return []\n }\n\n return raw.slice(1)\n}\n\nfunction getDefaultSeverity(enabledByDefault: boolean): RuleSeverity {\n return enabledByDefault ? 'warn' : 'off'\n}\n\ntype RuleUsageSummary = Pick<InspectedRule, 'offOnly' | 'overloaded' | 'severityStates' | 'used'>\n\nfunction createRuleUsageSummary(rule: InspectedRule, overrideSeverities: RuleSeverity[]): RuleUsageSummary {\n const severities: InspectedRuleUsageSeverity[] = []\n\n if (rule.usage.category) {\n addUsageSeverity(severities, rule.defaultSeverity)\n }\n\n if (rule.configured) {\n addUsageSeverity(severities, rule.configured.severity)\n }\n\n for (const severity of overrideSeverities) {\n addUsageSeverity(severities, severity)\n }\n\n const severityStates = createSeverityStates(severities)\n const used = rule.usage.category || rule.usage.root || rule.usage.overrideGroups.length > 0\n\n return {\n offOnly: used && severityStates.every((severity) => severity === 'off'),\n overloaded: severityStates.length > 1,\n severityStates,\n used,\n }\n}\n\nfunction createEmptyRuleUsage(isCategory: boolean): RuleUsageSummary & Pick<InspectedRule, 'usage'> {\n return {\n offOnly: false,\n overloaded: false,\n severityStates: [],\n usage: {\n category: isCategory,\n overrideGroups: [],\n root: false,\n },\n used: false,\n }\n}\n\nfunction addUsageSeverity(severities: InspectedRuleUsageSeverity[], severity: RuleSeverity) {\n if (severity === 'unknown') {\n return\n }\n\n severities.push(severity)\n}\n\nfunction createSeverityStates(configs: InspectedRuleUsageSeverity[]) {\n const severities = new Set(configs)\n\n return (['error', 'warn', 'off'] satisfies InspectedRuleUsageSeverity[]).filter((severity) =>\n severities.has(severity),\n )\n}\n\ntype NormalizedRuleMetadata = {\n deprecated: boolean\n description?: string\n docsUrl?: string\n fixable: boolean\n hasSuggestions: boolean\n recommended: boolean\n replacedBy: string[]\n ruleType?: InspectedRuleType\n typeAware?: boolean\n}\n\nfunction createBuiltinRuleMetadata(rule: RuleInfo): NormalizedRuleMetadata {\n return {\n deprecated: false,\n docsUrl: rule.docs_url,\n fixable: isBuiltinRuleFixable(rule.fix),\n hasSuggestions: hasBuiltinRuleSuggestions(rule.fix),\n recommended: rule.default,\n replacedBy: [],\n }\n}\n\nfunction createPluginRuleMetadata(meta: unknown): NormalizedRuleMetadata {\n if (!isRecord(meta)) {\n return createEmptyRuleMetadata()\n }\n\n const docs = isRecord(meta.docs) ? meta.docs : undefined\n\n return {\n deprecated: isDeprecated(meta.deprecated),\n description: getString(docs?.description),\n docsUrl: getString(docs?.url),\n fixable: meta.fixable === 'code' || meta.fixable === 'whitespace',\n hasSuggestions: meta.hasSuggestions === true,\n recommended: docs?.recommended === true,\n replacedBy: getReplacementRuleNames(meta.replacedBy),\n ruleType: getRuleType(meta.type),\n typeAware: getBoolean(docs?.requiresTypeChecking),\n }\n}\n\nfunction createEmptyRuleMetadata(): NormalizedRuleMetadata {\n return {\n deprecated: false,\n fixable: false,\n hasSuggestions: false,\n recommended: false,\n replacedBy: [],\n }\n}\n\nfunction isDeprecated(value: unknown) {\n return value === true || isRecord(value)\n}\n\nfunction getReplacementRuleNames(value: unknown) {\n if (!Array.isArray(value)) {\n return []\n }\n\n return value.flatMap((item) => {\n if (typeof item === 'string') {\n return [item]\n }\n\n if (!isRecord(item)) {\n return []\n }\n\n const ruleName = getString(item.name) ?? getString(item.ruleName)\n\n if (ruleName) {\n return [ruleName]\n }\n\n const rule = isRecord(item.rule) ? item.rule : undefined\n const plugin = isRecord(item.plugin) ? item.plugin : undefined\n const nestedRuleName = getString(rule?.name)\n const nestedPluginName = getString(plugin?.name)\n\n if (nestedRuleName && nestedPluginName) {\n return [`${nestedPluginName}/${nestedRuleName}`]\n }\n\n if (nestedRuleName) {\n return [nestedRuleName]\n }\n\n return []\n })\n}\n\nfunction getRuleType(value: unknown): InspectedRuleType | undefined {\n if (value === 'layout' || value === 'problem' || value === 'suggestion') {\n return value\n }\n\n return undefined\n}\n\nfunction isBuiltinRuleFixable(fix: string) {\n return fix !== 'none' && fix !== 'pending' && fix.includes('fix')\n}\n\nfunction hasBuiltinRuleSuggestions(fix: string) {\n return fix.includes('suggestion')\n}\n\nfunction getNormalizedRuleId(catalog: RuleCatalog, ruleId: string) {\n return catalog.ruleIdByAlias.get(ruleId) ?? ruleId\n}\n\nfunction addAliases(catalog: RuleCatalog, ruleId: string, aliases: string[]) {\n let aliasSet = catalog.aliasesByRuleId.get(ruleId)\n\n if (!aliasSet) {\n aliasSet = new Set()\n catalog.aliasesByRuleId.set(ruleId, aliasSet)\n }\n\n for (const alias of aliases) {\n aliasSet.add(alias)\n\n if (!catalog.ruleIdByAlias.has(alias)) {\n catalog.ruleIdByAlias.set(alias, ruleId)\n }\n }\n}\n\nfunction getBuiltinRuleId(rule: RuleInfo) {\n return `${getPluginName(rule.scope)}/${rule.value}`\n}\n\ntype ScopeConfig = {\n /** Canonical plugin prefix used by Oxlint for this internal rule scope. */\n pluginName: string\n /** Additional accepted rule prefixes that should resolve to the same builtin rule. */\n prefixAliases?: string[]\n}\n\n/**\n * Maps oxlint's internal rule scopes to user-facing plugin prefixes and known\n * compatibility aliases accepted by oxlint.\n *\n * This mirrors the plugin scope normalization in Oxlint so rules configured\n * with aliases like `@typescript-eslint/no-unused-vars`,\n * `react-hooks/rules-of-hooks`, or `deepscan/no-...` resolve to the same\n * builtin catalog entries as their canonical Oxlint rule IDs.\n *\n * @see https://github.com/oxc-project/oxc/blob/f30a64c2/crates/oxc_linter/src/config/plugins.rs#L150-L184\n */\nconst SCOPE_CONFIG: Record<string, ScopeConfig> = {\n import: { pluginName: 'import', prefixAliases: ['import-x'] },\n jsx_a11y: { pluginName: 'jsx-a11y', prefixAliases: ['jsx_a11y', 'jsx-a11y-x', 'jsx_a11y-x'] },\n oxc: { pluginName: 'oxc', prefixAliases: ['deepscan'] },\n react: { pluginName: 'react', prefixAliases: ['react-hooks', 'react_hooks'] },\n react_perf: { pluginName: 'react-perf', prefixAliases: ['react_perf'] },\n typescript: {\n pluginName: 'typescript',\n prefixAliases: ['@typescript-eslint', 'typescript-eslint', 'typescript_eslint'],\n },\n}\n\nfunction getPluginName(scope: string): string {\n return SCOPE_CONFIG[scope]?.pluginName ?? scope\n}\n\nfunction createBareBuiltinRuleIds(rules: RuleInfo[]): Set<string> {\n return new Set(rules.filter((rule) => rule.scope === 'eslint').map((rule) => getBuiltinRuleId(rule)))\n}\n\nfunction getBuiltinRuleAliases(rule: RuleInfo, ruleId: string, bareRuleIds: Set<string>): string[] {\n const config = SCOPE_CONFIG[rule.scope]\n const aliases = [ruleId]\n\n if (bareRuleIds.has(ruleId)) {\n aliases.push(rule.value)\n }\n\n for (const prefix of config?.prefixAliases ?? []) {\n aliases.push(`${prefix}/${rule.value}`)\n }\n\n return aliases\n}\n\nfunction getRuleName(ruleId: string) {\n return ruleId.split('/').at(-1) ?? ruleId\n}\n\nfunction getConfiguredPluginName(ruleId: string) {\n const segments = ruleId.split('/')\n\n if (segments.length < 2) {\n return\n }\n\n if (ruleId.startsWith('@') && segments.length > 2) {\n return `${segments[0]}/${segments[1]}`\n }\n\n return segments[0]\n}\n"],"mappings":";;;;;;;;AA4CA,MAAa,eAAe;CAAC;CAAkB;CAAmB;AAAkB;AAEpF,SAAS,eAAe,OAAgB;CACtC,MAAM,SAAS,uBAAuB,KAAK;CAE3C,OAAO,YAAY,UAAU;EAC3B;EACA,SAAS;GACP,GAAG;GACH,UAAU;GACV,OAAO;EACT;EACA;CACF,CAAC;AACH;AAEA,MAAM,kBAAkB,eAAe,IAAI;AAE3C,SAAS,UAAU,UAAkB,SAAiD;CACpF,MAAM,SAAuB,CAAC;CAC9B,MAAM,SAAS,MAAM,SAAS,QAAQ,EAAE,oBAAoB,KAAK,CAAC;CAClE,MAAM,CAAC,SAAS;CAEhB,IAAI,OACF,MAAM,IAAI,MAAM,kBAAkB,SAAS,IAAI,oBAAoB,MAAM,KAAK,EAAE,aAAa,MAAM,QAAQ;CAG7G,OAAO,UAAU;AACnB;AAEA,SAAS,uBAAuB,OAA+E;CAC7G,MAAM,OAAO,WAAW,OAAO,KAAK,KAAK;EACvC,SAAS;EACT,aAAa;CACf,CAAC;CAED,OAAO,OAAO,aAAqB,KAAK,OAAuC,UAAU,EAAE,SAAS,KAAK,CAAC;AAC5G;;;;;;;;;;AAWA,eAAsB,UAAU,UAA4B,CAAC,GAAuC;CAClG,MAAM,MAAM,QAAQ,OAAO,QAAQ,IAAI;CACvC,MAAM,WAAW,QAAQ,UAAU,QAAQ,eAAe,KAAK,IAAI;CACnE,MAAM,SAAS,QAAQ,aACnB,MAAM,SAAS,KAAK,KAAK,QAAQ,KAAK,QAAQ,UAAU,CAAC,IACzD,MAAM,SAAS,OAAO,GAAG;CAE7B,IAAI,CAAC,UAAU,OAAO,SACpB,OAAO;CAGT,MAAM,wB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version": "0.0.0",
3
+ "version": "1.0.0-beta.1",
4
4
  "description": "Core config loading and inspection utilities for Oxlint Config Inspector.",
5
5
  "keywords": [
6
6
  "config-inspector",
@@ -37,6 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "cosmiconfig": "9.0.2",
40
+ "jiti": "2.7.0",
40
41
  "jsonc-parser": "3.3.1",
41
42
  "tinyexec": "1.2.4"
42
43
  },