@oxlint-config-inspector/core 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -139,7 +139,8 @@ type InspectedOverrideGroupRule = {
139
139
  type InspectedOverrideGroup = {
140
140
  /** File globs excluded by the override, when configured. */excludeFiles?: string[]; /** File globs included by the override. */
141
141
  files: string[]; /** Zero-based position of the override in the resolved config. */
142
- index: number; /** Plugins enabled by this override block. */
142
+ index: number; /** JS plugins enabled by this override block. */
143
+ jsPlugins?: string[]; /** Plugins enabled by this override block. */
143
144
  plugins?: string[]; /** Rules configured by this override block. */
144
145
  rules: InspectedOverrideGroupRule[];
145
146
  };
@@ -168,8 +169,12 @@ type InspectConfigResult = {
168
169
  declare function inspectConfig(options?: GetConfigOptions): Promise<InspectConfigResult | null>;
169
170
  //#endregion
170
171
  //#region src/rules.d.ts
172
+ /**
173
+ * Options for locating and invoking the project's linter.
174
+ */
171
175
  type GetOxlintRulesOptions = {
172
- /** When `true`, invokes the Vite+ (`vp`) binary instead of `oxlint`. */useVitePlus?: boolean;
176
+ /** The project directory used to resolve and run Vite+. Defaults to `process.cwd()`. */cwd?: string; /** Selects Vite+ instead of Oxlint. When omitted, detects Vite+ in the project. */
177
+ useVitePlus?: boolean;
173
178
  };
174
179
  /**
175
180
  * Fetches the list of builtin lint rules by invoking the linter binary.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/config.ts","../src/plugins.ts","../src/types.ts","../src/inspect.ts","../src/rules.ts"],"mappings":";KAmBY,gBAAA;EAAgB,+EAE1B,KAAA,YAF0B;EAI1B,UAAA;EAEA,GAAA;AAAA;;cAoBW,YAAA;;;;;;KCCD,eAAA;EACV,OAAA;EACA,IAAA;EACA,SAAA;AAAA;;;KCjDU,QAAA;EACV,KAAA;EACA,KAAA;EACA,QAAA;EACA,UAAA;EACA,GAAA;EACA,OAAA;EACA,QAAA;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SAAA,YAtCA;EAwCA,KAAA,EAAO,kBAAA,EAtCP;EAwCA,IAAA;AAAA;;;;KAMU,0BAAA;EApCV,8FAsCA,OAAA,aAlCA;EAoCA,GAAA,WAhCA;EAkCA,MAAA,UA9BA;EAgCA,QAAA,EAAU,YAAA,EA5BV;EA8BA,MAAA,EAAQ,mBAAmB;AAAA;;;;KAMjB,sBAAA;EA5BF,4DA8BR,YAAA,aA1BA;EA4BA,KAAA,YA1BA;EA4BA,KAAA,UA5BI;EA8BJ,SAAA,aAxBoC;EA0BpC,OAAA,aAhB2B;EAkB3B,KAAA,EAAO,0BAA0B;AAAA;;;;KAMvB,mBAAA;EAxBF,2DA0BR,WAAA,YA1B2B;EA4B3B,cAAA,UAtBgC;EAwBhC,WAAA,UAZiC;EAcjC,cAAA,EAAgB,sBAAA,IAtBhB;EAwBA,YAAA,EAAc,wBAAA,IApBd;EAsBA,OAAA,EAAS,eAAA,IAlBT;EAoBA,iBAAA,YApBiC;EAsBjC,KAAA,EAAO,aAAA,IAhBG;EAkBV,KAAA,EAAO,kBAAA;EAEP,YAAA,EAAc,aAAA,IAVA;EAYd,OAAA;AAAA;;;;;;;iBAeoB,aAAA,CAAc,OAAA,GAAS,gBAAA,GAAwB,OAAA,CAAQ,mBAAA;;;AH7N7E;;;AAAA,KINY,qBAAA;EJQV,wFINA,GAAA,WJUA;EIRA,WAAW;AAAA;AJ4Bb;;;;AAAuG;;AAAvG,iBInBsB,cAAA,CAAe,OAAA,GAAU,qBAAA,GAAwB,OAAA,CAAQ,QAAA"}
package/dist/index.mjs CHANGED
@@ -1,9 +1,11 @@
1
+ import { createRequire } from "node:module";
1
2
  import { access } from "node:fs/promises";
2
3
  import path from "node:path";
3
4
  import { cosmiconfig, defaultLoaders } from "cosmiconfig";
4
5
  import { createJiti } from "jiti";
5
6
  import { parse, printParseErrorCode } from "jsonc-parser";
6
7
  import { fileURLToPath, pathToFileURL } from "node:url";
8
+ import process$1 from "node:process";
7
9
  import { x } from "tinyexec";
8
10
  //#region src/config.ts
9
11
  /** Known Oxlint / Vite+ config file names, searched in order by cosmiconfig. */
@@ -242,7 +244,7 @@ function mergeArrays(base, override) {
242
244
  }
243
245
  //#endregion
244
246
  //#region package.json
245
- var version = "1.1.1";
247
+ var version = "1.1.3";
246
248
  //#endregion
247
249
  //#region src/generated/builtin-rule-docs.ts
248
250
  const builtinRuleDocs = {
@@ -313,6 +315,7 @@ const builtinRuleDocs = {
313
315
  description: "Require grouped accessor pairs in object literals and classes."
314
316
  },
315
317
  "eslint/guard-for-in": { description: "Require for-in loops to include an if statement." },
318
+ "eslint/id-denylist": { description: "Disallow specified identifiers" },
316
319
  "eslint/id-length": {
317
320
  defaultOptions: {
318
321
  checkGeneric: true,
@@ -429,7 +432,10 @@ const builtinRuleDocs = {
429
432
  description: "Disallow the use of console."
430
433
  },
431
434
  "eslint/no-const-assign": { description: "Disallow reassigning const variables." },
432
- "eslint/no-constant-binary-expression": { description: "Disallow expressions where the operation doesn't affect the value." },
435
+ "eslint/no-constant-binary-expression": {
436
+ defaultOptions: { checkRelationalComparisons: true },
437
+ description: "Disallow expressions where the operation doesn't affect the value."
438
+ },
433
439
  "eslint/no-constant-condition": { description: "Disallow constant expressions in conditions." },
434
440
  "eslint/no-constructor-return": { description: "Disallow returning a value from a constructor." },
435
441
  "eslint/no-continue": { description: "Disallow continue statements." },
@@ -465,7 +471,7 @@ const builtinRuleDocs = {
465
471
  "eslint/no-empty-static-block": { description: "Disallow empty static blocks." },
466
472
  "eslint/no-eq-null": { description: "Disallow null comparisons without type-checking operators." },
467
473
  "eslint/no-eval": {
468
- defaultOptions: { allowIndirect: true },
474
+ defaultOptions: { allowIndirect: false },
469
475
  description: "Disallows referencing the eval function. This rule is aimed at preventing potentially dangerous, unnecessary, and slow code by disallowing the use of the eval() function."
470
476
  },
471
477
  "eslint/no-ex-assign": { description: "Disallow reassigning exceptions in catch clauses." },
@@ -514,7 +520,7 @@ const builtinRuleDocs = {
514
520
  },
515
521
  "eslint/no-irregular-whitespace": {
516
522
  defaultOptions: {
517
- skipComments: true,
523
+ skipComments: false,
518
524
  skipJSXText: true,
519
525
  skipRegExps: true,
520
526
  skipStrings: true,
@@ -603,19 +609,8 @@ const builtinRuleDocs = {
603
609
  },
604
610
  description: "This rule disallows specified names from being used as exported names."
605
611
  },
606
- "eslint/no-restricted-globals": {
607
- defaultOptions: {
608
- checkGlobalObject: false,
609
- globalObjects: [
610
- "globalThis",
611
- "self",
612
- "window"
613
- ],
614
- globals: {}
615
- },
616
- description: "Specify global variable names that should not be used in your application."
617
- },
618
- "eslint/no-restricted-imports": { description: "This rule allows you to specify imports that you don’t want to use in your application. It applies to static imports only, not dynamic ones." },
612
+ "eslint/no-restricted-globals": { description: "Specify global variable names that should not be used in your application." },
613
+ "eslint/no-restricted-imports": { description: "This rule allows you to specify imports that you don’t want to use in your application. It applies to static imports and to dynamic import() with a string-literal source; computed sources like import(bar) are ignored." },
619
614
  "eslint/no-restricted-properties": { description: "This rule allows you to disallow access to certain properties on certain objects." },
620
615
  "eslint/no-return-assign": { description: "Disallows assignment operators in return statements." },
621
616
  "eslint/no-script-url": { description: "Disallow javascript: URLs." },
@@ -671,12 +666,16 @@ const builtinRuleDocs = {
671
666
  description: "Disallows dangling underscores in identifiers."
672
667
  },
673
668
  "eslint/no-unexpected-multiline": { description: "In most cases, semicolons are not required in JavaScript in order for code to be parsed and executed as expected. Typically this occurs because semicolons are automatically inserted based on a fixed set of rules. This rule exists to detect those cases where a semicolon is NOT inserted automatically, and may be parsed differently than expected." },
674
- "eslint/no-unmodified-loop-condition": { description: "Disallow references in loop conditions that are never modified within the loop." },
669
+ "eslint/no-unmodified-loop-condition": {
670
+ defaultOptions: { checkConditionalExpressions: false },
671
+ description: "Disallow references in loop conditions that are never modified within the loop."
672
+ },
675
673
  "eslint/no-unneeded-ternary": {
676
674
  defaultOptions: { defaultAssignment: true },
677
675
  description: "Disallow ternary operators when simpler alternatives exist."
678
676
  },
679
677
  "eslint/no-unreachable": { description: "Disallow unreachable code after return, throw, continue, and break statements." },
678
+ "eslint/no-unreachable-loop": { description: "Disallow loops whose body allows only one iteration." },
680
679
  "eslint/no-unsafe-finally": { description: "Disallow control flow statements in finally blocks." },
681
680
  "eslint/no-unsafe-negation": {
682
681
  defaultOptions: { enforceForOrderingRelations: false },
@@ -748,7 +747,18 @@ const builtinRuleDocs = {
748
747
  defaultOptions: { allowAsStatement: false },
749
748
  description: "Disallows the use of the void operator."
750
749
  },
751
- "eslint/no-warning-comments": { description: "Disallows warning comments such as TODO, FIXME, XXX in code." },
750
+ "eslint/no-warning-comments": {
751
+ defaultOptions: {
752
+ decoration: [],
753
+ location: "\"start\"",
754
+ terms: [
755
+ "todo",
756
+ "fixme",
757
+ "xxx"
758
+ ]
759
+ },
760
+ description: "Disallows warning comments such as TODO, FIXME, XXX in code."
761
+ },
752
762
  "eslint/no-with": { description: "Disallow with statements." },
753
763
  "eslint/object-shorthand": {
754
764
  defaultOptions: { "The 2nd option": {
@@ -758,6 +768,7 @@ const builtinRuleDocs = {
758
768
  } },
759
769
  description: "Require or disallow method and property shorthand syntax for object literals"
760
770
  },
771
+ "eslint/one-var": { description: "Enforces variables to be declared either together or separately." },
761
772
  "eslint/operator-assignment": { description: "This rule requires or disallows assignment operator shorthand where possible. It encourages the use of shorthand assignment operators like +=, -=, =, /=, etc. to make the code more concise and readable." },
762
773
  "eslint/prefer-arrow-callback": {
763
774
  defaultOptions: {
@@ -771,7 +782,10 @@ const builtinRuleDocs = {
771
782
  description: "Requires const declarations for variables that are never reassigned after their initial declaration."
772
783
  },
773
784
  "eslint/prefer-destructuring": {
774
- defaultOptions: { "The 2nd option": { enforceForRenamedProperties: false } },
785
+ defaultOptions: { "The 2nd option": {
786
+ enforceForDeclarationWithTypeAnnotation: false,
787
+ enforceForRenamedProperties: false
788
+ } },
775
789
  description: "Require destructuring from arrays and/or objects."
776
790
  },
777
791
  "eslint/prefer-exponentiation-operator": { description: "Disallow the use of Math.pow in favor of the operator." },
@@ -1003,7 +1017,7 @@ const builtinRuleDocs = {
1003
1017
  "jest/no-large-snapshots": {
1004
1018
  defaultOptions: {
1005
1019
  allowedSnapshots: {},
1006
- inlineMaxSize: 50,
1020
+ inlineMaxSize: null,
1007
1021
  maxSize: 50
1008
1022
  },
1009
1023
  description: "Disallow large snapshots."
@@ -1111,6 +1125,10 @@ const builtinRuleDocs = {
1111
1125
  description: "Expects the following tags to be empty of any content:"
1112
1126
  },
1113
1127
  "jsdoc/implements-on-classes": { description: "Reports an issue with any non-constructor function using @implements." },
1128
+ "jsdoc/no-blank-blocks": {
1129
+ defaultOptions: { enableFixer: false },
1130
+ description: "Reports and optionally removes blocks with whitespace only."
1131
+ },
1114
1132
  "jsdoc/no-defaults": {
1115
1133
  defaultOptions: { noOptionalParamNames: false },
1116
1134
  description: "This rule reports defaults being used on the relevant portion of @param or @default. It also optionally reports the presence of the square-bracketed optional arguments at all."
@@ -1124,7 +1142,10 @@ const builtinRuleDocs = {
1124
1142
  checkRestProperty: false,
1125
1143
  checkSetters: true,
1126
1144
  checkTypesPattern: "\"^(?:[oO]bject|[aA]rray|PlainObject|Generic(?:Object|Array))$\"",
1127
- exemptedBy: ["inheritdoc"]
1145
+ exemptedBy: ["inheritdoc"],
1146
+ ignoreWhenAllParamsMissing: false,
1147
+ interfaceExemptsParamsCheck: false,
1148
+ useDefaultObjectProperties: false
1128
1149
  },
1129
1150
  description: "Requires that all function parameters are documented with JSDoc @param tags."
1130
1151
  },
@@ -1190,7 +1211,10 @@ const builtinRuleDocs = {
1190
1211
  ] },
1191
1212
  description: "Inspects anchor link text for the use of ambiguous words."
1192
1213
  },
1193
- "jsx-a11y/anchor-has-content": { description: "Enforce that anchors have content and that the content is accessible to screen readers. Accessible means that it is not hidden using the aria-hidden prop." },
1214
+ "jsx-a11y/anchor-has-content": {
1215
+ defaultOptions: { components: [] },
1216
+ description: "Enforce that anchors have content and that the content is accessible to screen readers. Accessible means that it is not hidden using the aria-hidden prop."
1217
+ },
1194
1218
  "jsx-a11y/anchor-is-valid": {
1195
1219
  defaultOptions: {
1196
1220
  components: [],
@@ -1385,6 +1409,10 @@ const builtinRuleDocs = {
1385
1409
  "nextjs/no-typos": { description: "Detects common typos in Next.js data fetching function names." },
1386
1410
  "nextjs/no-unwanted-polyfillio": { description: "Prevent use of unsafe polyfill.io domains and duplicate polyfills." },
1387
1411
  "node/callback-return": { description: "Require return statements after callbacks." },
1412
+ "node/exports-style": {
1413
+ defaultOptions: { "The 2nd option": { allowBatchAssign: false } },
1414
+ description: "Enforce either module.exports or exports."
1415
+ },
1388
1416
  "node/global-require": { description: "Require require() calls to be placed at top-level module scope." },
1389
1417
  "node/handle-callback-err": { description: "This rule expects that when you're using the callback pattern in Node.js you'll handle the error." },
1390
1418
  "node/no-exports-assign": { description: "Disallows assignment to exports." },
@@ -1408,11 +1436,16 @@ const builtinRuleDocs = {
1408
1436
  },
1409
1437
  description: "Disallows synchronous methods from being called in Node.js code."
1410
1438
  },
1439
+ "node/no-top-level-await": {
1440
+ defaultOptions: { ignoreBin: false },
1441
+ description: "Disallows the use of top-level await, including for await...of loops and await using declarations that are not nested inside a function."
1442
+ },
1411
1443
  "oxc/approx-constant": { description: "Disallows the use of approximate constants, instead preferring the use of the constants in the Math object." },
1412
1444
  "oxc/bad-array-method-on-arguments": { description: "This rule applies when an array method is called on the arguments object itself." },
1413
1445
  "oxc/bad-bitwise-operator": { description: "This rule applies when bitwise operators are used where logical operators are expected." },
1414
- "oxc/bad-char-at-comparison": { description: "This rule warns when the return value of the charAt method is used to compare a string of length greater than 1." },
1446
+ "oxc/bad-char-at-comparison": { description: "This rule warns when a character accessed with charAt, at, or bracket notation is compared with a string of length greater than 1." },
1415
1447
  "oxc/bad-comparison-sequence": { description: "This rule applies when the comparison operator is applied two or more times in a row." },
1448
+ "oxc/bad-match-all-arg": { description: "This rule warns when the matchAll method is called with a regular expression that does not have the global flag (g)." },
1416
1449
  "oxc/bad-min-max-func": { description: "Checks whether the clamp function Math.min(Math.max(x, y), z) always evaluates to a constant result because the arguments are in the wrong order." },
1417
1450
  "oxc/bad-object-literal-comparison": { description: "Checks for comparisons between object and array literals." },
1418
1451
  "oxc/bad-replace-all-arg": { description: "This rule warns when the replaceAll method is called with a regular expression that does not have the global flag (g)." },
@@ -1510,6 +1543,7 @@ const builtinRuleDocs = {
1510
1543
  },
1511
1544
  description: "Enforces an explicit type attribute for all HTML button elements."
1512
1545
  },
1546
+ "react/capitalized-calls": { description: "Disallows calling capitalized functions or methods directly during render instead of rendering them with JSX, since capitalized names are reserved for components." },
1513
1547
  "react/checked-requires-onchange-or-readonly": {
1514
1548
  defaultOptions: {
1515
1549
  ignoreExclusiveCheckedAttribute: false,
@@ -1524,16 +1558,24 @@ const builtinRuleDocs = {
1524
1558
  },
1525
1559
  description: "Enforces that React components have a displayName property."
1526
1560
  },
1561
+ "react/error-boundaries": { description: "Validates using error boundaries instead of try/catch around JSX for errors in child components." },
1527
1562
  "react/exhaustive-deps": { description: "Verifies the list of dependencies for Hooks like useEffect and similar." },
1563
+ "react/exhaustive-effect-dependencies": { description: "Validates that effect dependency arrays are exhaustive and contain no extraneous values." },
1528
1564
  "react/forbid-component-props": { description: "This rule prevents passing of props to components. This rule only applies to Components (e.g. <Foo />) and not DOM nodes (e.g. <div />). By default this rule prevents passing of props that add lots of complexity (className, style) to Components. The list of forbidden props can be customized with the forbid option." },
1529
1565
  "react/forbid-dom-props": { description: "This rule prevents passing of props to elements. This rule only applies to DOM Nodes (e.g. <div />) and not Components (e.g. <Component />). The list of forbidden props can be customized with the forbid option." },
1530
1566
  "react/forbid-elements": { description: "Allows you to configure a list of forbidden elements and to specify their desired replacements." },
1531
1567
  "react/forward-ref-uses-ref": { description: "Requires that components wrapped with forwardRef must have a ref parameter. Omitting the ref argument is usually a bug, and components not using ref don't need to be wrapped by forwardRef." },
1568
+ "react/function-component-definition": { description: "Enforces a consistent function form for React function components." },
1569
+ "react/globals": { description: "Disallows assigning to or mutating variables declared outside a component or hook during render; side effects must run outside of render." },
1532
1570
  "react/hook-use-state": {
1533
1571
  defaultOptions: { allowDestructuredState: false },
1534
1572
  description: "Ensure destructuring and symmetric naming of useState hook value and setter variables."
1535
1573
  },
1574
+ "react/hooks": { description: "Runs the React Compiler's Rules of Hooks validation: hooks must be called unconditionally, in a consistent order, at the top level of a component or hook, and not be used as first-class values." },
1536
1575
  "react/iframe-missing-sandbox": { description: "Enforce the sandbox attribute on iframe elements." },
1576
+ "react/immutability": { description: "Disallows mutating props, state, hook arguments, hook return values, and other values that are immutable by the Rules of React." },
1577
+ "react/incompatible-library": { description: "Warns on usage of library APIs known to be incompatible with memoization (manual or automatic), such as react-hook-form's watch(), TanStack Table's useReactTable(), and TanStack Virtual's useVirtualizer()." },
1578
+ "react/invariant": { description: "Reports internal React Compiler invariant violations. These indicate a bug in the compiler itself, not in your code — consider reporting them to the oxc or React teams." },
1537
1579
  "react/jsx-boolean-value": {
1538
1580
  defaultOptions: { "The 2nd option": {
1539
1581
  always: [],
@@ -1632,11 +1674,13 @@ const builtinRuleDocs = {
1632
1674
  },
1633
1675
  description: "Disallow JSX prop spreading."
1634
1676
  },
1677
+ "react/memo-dependencies": { description: "Validates that useMemo() and useCallback() declare comprehensive dependency lists without extraneous values." },
1635
1678
  "react/no-array-index-key": { description: "Warn if an element uses an Array index in its key." },
1636
1679
  "react/no-children-prop": { description: "Checks that children are not passed using a prop." },
1637
1680
  "react/no-clone-element": { description: "Prevents the usage of React.cloneElement, which is considered an anti-pattern in React." },
1638
1681
  "react/no-danger": { description: "This rule prevents the use of dangerouslySetInnerHTML prop." },
1639
1682
  "react/no-danger-with-children": { description: "Disallows DOM elements from using both children and dangerouslySetInnerHTML properties." },
1683
+ "react/no-deriving-state-in-effects": { description: "Disallows deriving values from state inside an effect and storing them back into state; derived values should be computed during render instead." },
1640
1684
  "react/no-did-mount-set-state": { description: "Disallows using setState in the componentDidMount lifecycle method." },
1641
1685
  "react/no-did-update-set-state": { description: "Disallow usage of setState in componentDidUpdate." },
1642
1686
  "react/no-direct-mutation-state": { description: "This rule forbids the direct mutation of this.state in React components." },
@@ -1695,12 +1739,12 @@ const builtinRuleDocs = {
1695
1739
  },
1696
1740
  description: "Enforces that React components are written as function components instead of class components."
1697
1741
  },
1698
- "react/react-compiler": {
1699
- defaultOptions: { reportAllBailouts: false },
1700
- description: "Runs the React Compiler's analysis in lint-only mode and reports code that violates the Rules of React — for example calling hooks conditionally, calling setState during render, accessing refs during render, or mutating props and state."
1701
- },
1742
+ "react/preserve-manual-memoization": { description: "Validates that existing manual memoization (useMemo, useCallback, React.memo) is preserved by the React Compiler: the compiler only compiles code whose inferred dependencies match or exceed the manually specified ones." },
1743
+ "react/purity": { description: "Validates that components and hooks are pure by checking that they do not call known-impure functions such as Math.random(), Date.now(), or performance.now() during render." },
1702
1744
  "react/react-in-jsx-scope": { description: "Enforces that React is imported and in-scope when using JSX syntax." },
1745
+ "react/refs": { description: "Validates correct usage of refs: ref.current may not be read or written during render, only in event handlers and effects." },
1703
1746
  "react/require-render-return": { description: "Require render methods in ES5 and ES2015 React components to return a value." },
1747
+ "react/rule-suppression": { description: "Reports ESLint/Oxlint suppressions of React rules (for example eslint-disable-next-line react-hooks/exhaustive-deps) inside a component or hook. The React Compiler skips functions containing such suppressions, since the suppressed violation may make compilation unsafe." },
1704
1748
  "react/rules-of-hooks": { description: "Enforces the Rules of Hooks, ensuring that React Hooks are only called in valid contexts and in the correct order." },
1705
1749
  "react/self-closing-comp": {
1706
1750
  defaultOptions: {
@@ -1709,12 +1753,20 @@ const builtinRuleDocs = {
1709
1753
  },
1710
1754
  description: "Detects components without children which can be self-closed to avoid unnecessary extra closing tags."
1711
1755
  },
1756
+ "react/set-state-in-effect": { description: "Disallows calling setState synchronously inside an effect body." },
1757
+ "react/set-state-in-render": { description: "Disallows unconditionally setting state during render (including inside useMemo callbacks), which triggers additional renders and can cause infinite render loops." },
1712
1758
  "react/state-in-constructor": { description: "Enforces the state initialization style to be either in a constructor or with a class property." },
1759
+ "react/static-components": { description: "Validates that components are static — defined at module scope rather than recreated on every render — because dynamically recreated components reset state and cause excessive re-rendering." },
1713
1760
  "react/style-prop-object": {
1714
1761
  defaultOptions: { allow: [] },
1715
1762
  description: "Require that the value of the prop style be an object or a variable that is an object."
1716
1763
  },
1764
+ "react/syntax": { description: "Reports invalid JavaScript encountered by React Compiler while analyzing a component or hook, such as reassigning a const binding." },
1765
+ "react/todo": { description: "Reports code that React Compiler cannot yet analyze because it uses features the compiler has not implemented. These are skipped optimizations (bail-outs), not rule violations." },
1766
+ "react/unsupported-syntax": { description: "Warns on syntax that React Compiler does not plan to support, such as eval; components and hooks using it are skipped, not optimized." },
1767
+ "react/use-memo": { description: "Validates usage of the useMemo() hook against common mistakes, such as passing an async or generator callback or misusing its arguments." },
1717
1768
  "react/void-dom-elements-no-children": { description: "Disallow void DOM elements (e.g. <img />, <br />) from receiving children." },
1769
+ "react/void-use-memo": { description: "Validates that useMemo() callbacks return a value and that the memoized result is actually used by the component or hook." },
1718
1770
  "react-perf/jsx-no-jsx-as-prop": { description: "Prevent JSX elements that are local to the current method from being used as values of JSX props." },
1719
1771
  "react-perf/jsx-no-new-array-as-prop": { description: "Prevent arrays that are local to the current method from being used as values of JSX props." },
1720
1772
  "react-perf/jsx-no-new-function-as-prop": { description: "Prevent functions that are local to the current method from being used as values of JSX props." },
@@ -1753,7 +1805,7 @@ const builtinRuleDocs = {
1753
1805
  fixStyle: "\"separate-type-imports\"",
1754
1806
  prefer: "\"type-imports\""
1755
1807
  },
1756
- description: "Enforce consistent usage of type imports."
1808
+ description: "Enforce consistent usage of type imports by adding or removing the type keyword from imports."
1757
1809
  },
1758
1810
  "typescript/dot-notation": {
1759
1811
  defaultOptions: {
@@ -1918,10 +1970,7 @@ const builtinRuleDocs = {
1918
1970
  "typescript/no-non-null-assertion": { description: "Disallow non-null assertions using the ! postfix operator." },
1919
1971
  "typescript/no-redundant-type-constituents": { description: "This rule disallows type constituents of unions and intersections that are redundant." },
1920
1972
  "typescript/no-require-imports": {
1921
- defaultOptions: {
1922
- allow: [],
1923
- allowAsImport: false
1924
- },
1973
+ defaultOptions: { allowAsImport: false },
1925
1974
  description: "Forbids the use of CommonJS require calls."
1926
1975
  },
1927
1976
  "typescript/no-restricted-types": {
@@ -2179,6 +2228,7 @@ const builtinRuleDocs = {
2179
2228
  defaultOptions: { "non-zero": "\"greater-than\"" },
2180
2229
  description: "Enforce explicitly comparing the length or size property of a value."
2181
2230
  },
2231
+ "unicorn/explicit-timer-delay": { description: "Enforce or disallow explicit delay argument for setTimeout() and setInterval()." },
2182
2232
  "unicorn/filename-case": {
2183
2233
  defaultOptions: {
2184
2234
  case: null,
@@ -2202,7 +2252,7 @@ const builtinRuleDocs = {
2202
2252
  defaultOptions: { max: 3 },
2203
2253
  description: "Limit the depth of nested calls."
2204
2254
  },
2205
- "unicorn/new-for-builtins": { description: "Enforces the use of new for the following builtins: Object, Array, ArrayBuffer, BigInt64Array, BigUint64Array, DataView, Date, Error, Float32Array, Float64Array, Function, Int8Array, Int16Array, Int32Array, Map, WeakMap, Set, WeakSet, Promise, RegExp, Uint8Array, Uint16Array, Uint32Array, Uint8ClampedArray, SharedArrayBuffer, Proxy, WeakRef, FinalizationRegistry." },
2255
+ "unicorn/new-for-builtins": { description: "Enforces the use of new for the following builtins: Object, Array, ArrayBuffer, BigInt64Array, BigUint64Array, DataView, Date, Error, Float16Array, Float32Array, Float64Array, Function, Int8Array, Int16Array, Int32Array, Map, WeakMap, Set, WeakSet, Promise, RegExp, Uint8Array, Uint16Array, Uint32Array, Uint8ClampedArray, SharedArrayBuffer, Proxy, WeakRef, FinalizationRegistry." },
2206
2256
  "unicorn/no-abusive-eslint-disable": { description: "Disallows oxlint-disable or eslint-disable comments without specifying rules." },
2207
2257
  "unicorn/no-accessor-recursion": { description: "Disallow recursive access to this within getters and setters." },
2208
2258
  "unicorn/no-anonymous-default-export": { description: "Disallows anonymous functions and classes as default exports." },
@@ -2219,11 +2269,15 @@ const builtinRuleDocs = {
2219
2269
  description: "Prefer using Array#toReversed() over Array#reverse()."
2220
2270
  },
2221
2271
  "unicorn/no-array-sort": {
2222
- defaultOptions: { allowExpressionStatement: true },
2272
+ defaultOptions: {
2273
+ allowAfterSpread: false,
2274
+ allowExpressionStatement: true
2275
+ },
2223
2276
  description: "Prefer using Array#toSorted() over Array#sort()."
2224
2277
  },
2225
2278
  "unicorn/no-await-expression-member": { description: "Disallows member access from await expressions." },
2226
2279
  "unicorn/no-await-in-promise-methods": { description: "Disallow using await in Promise method parameters." },
2280
+ "unicorn/no-confusing-array-with": { description: "Disallows confusing uses of Array#with()." },
2227
2281
  "unicorn/no-console-spaces": { description: "Disallows leading/trailing space inside console.log() and similar methods." },
2228
2282
  "unicorn/no-document-cookie": { description: "Disallows direct use of document.cookie." },
2229
2283
  "unicorn/no-empty-file": { description: "Disallows files that do not contain any meaningful code." },
@@ -2316,7 +2370,7 @@ const builtinRuleDocs = {
2316
2370
  description: "Enforces a convention of grouping digits using numeric separators."
2317
2371
  },
2318
2372
  "unicorn/prefer-add-event-listener": { description: "Enforces the use of .addEventListener() and .removeEventListener() over their on-function counterparts." },
2319
- "unicorn/prefer-array-find": { description: "Encourages using Array.prototype.find instead of filter(...)[0] or similar patterns when only the first matching element is needed." },
2373
+ "unicorn/prefer-array-find": { description: "Encourages using Array.prototype.find and Array.prototype.findLast instead of taking the first or last matching element from filter(...)." },
2320
2374
  "unicorn/prefer-array-flat": { description: "Prefers Array#flat() over legacy techniques to flatten arrays." },
2321
2375
  "unicorn/prefer-array-flat-map": { description: "Prefers the use of .flatMap() when map().flat() are used together." },
2322
2376
  "unicorn/prefer-array-index-of": { description: "Enforces using indexOf or lastIndexOf instead of findIndex or findLastIndex when the callback is a simple strict equality comparison." },
@@ -2455,7 +2509,7 @@ const builtinRuleDocs = {
2455
2509
  "vitest/no-large-snapshots": {
2456
2510
  defaultOptions: {
2457
2511
  allowedSnapshots: {},
2458
- inlineMaxSize: 50,
2512
+ inlineMaxSize: null,
2459
2513
  maxSize: 50
2460
2514
  },
2461
2515
  description: "Disallow large snapshots."
@@ -2471,6 +2525,7 @@ const builtinRuleDocs = {
2471
2525
  "vitest/no-test-return-statement": { description: "Disallow explicitly returning from tests." },
2472
2526
  "vitest/no-unneeded-async-expect-function": { description: "Disallows unnecessary async function wrapper for expected promises." },
2473
2527
  "vitest/padding-around-after-all-blocks": { description: "This rule enforces a line of padding before and after 1 or more afterAll statements." },
2528
+ "vitest/padding-around-test-blocks": { description: "This rule enforces a line of padding before and after 1 or more test/it statements." },
2474
2529
  "vitest/prefer-called-exactly-once-with": { description: "It checks when a target is asserted with both toHaveBeenCalledOnce and toHaveBeenCalledWith instead of toHaveBeenCalledExactlyOnceWith." },
2475
2530
  "vitest/prefer-called-once": { description: "Substitute toBeCalledTimes(1) and toHaveBeenCalledTimes(1) with toBeCalledOnce() and toHaveBeenCalledOnce() respectively." },
2476
2531
  "vitest/prefer-called-times": { description: "This rule aims to enforce the use of toBeCalledTimes(1) or toHaveBeenCalledTimes(1) over toBeCalledOnce() or toHaveBeenCalledOnce()." },
@@ -2607,10 +2662,7 @@ const builtinRuleDocs = {
2607
2662
  "vue/no-this-in-before-route-enter": { description: "Disallow this usage in a beforeRouteEnter method." },
2608
2663
  "vue/no-watch-after-await": { description: "Disallow asynchronously-registered watch." },
2609
2664
  "vue/prefer-import-from-vue": { description: "Enforce imports from vue instead of @vue/." },
2610
- "vue/prop-name-casing": {
2611
- defaultOptions: { "The 2nd option": { ignoreProps: [] } },
2612
- description: "Enforce a specific casing (camelCase or snake\\_case) for Vue component prop names."
2613
- },
2665
+ "vue/prop-name-casing": { description: "Enforce a specific casing (camelCase or snake\\_case) for Vue component prop names." },
2614
2666
  "vue/require-default-export": { description: "Require components to be the default export." },
2615
2667
  "vue/require-default-prop": { description: "Requires default value to be set for props that are not marked as required." },
2616
2668
  "vue/require-direct-export": {
@@ -2677,6 +2729,25 @@ function getPluginEntries(config) {
2677
2729
  return [...entries.values()];
2678
2730
  }
2679
2731
  /**
2732
+ * Resolves display names for JS plugin entries declared in a single config block.
2733
+ *
2734
+ * Entries are matched to loaded plugins by their deduplication key so that the
2735
+ * same specifier loaded under multiple aliases resolves deterministically. Entries
2736
+ * that failed to load fall back to their alias or specifier.
2737
+ *
2738
+ * @param entries - JS plugin entries from a root or override config block.
2739
+ * @param plugins - Successfully loaded plugins used to normalize names.
2740
+ * @returns Display names in declaration order.
2741
+ */
2742
+ function getPluginEntryNames(entries, plugins) {
2743
+ const namesByKey = new Map(plugins.map((plugin) => [plugin.entryKey, plugin.name]));
2744
+ return entries.map((entry) => {
2745
+ const loadedName = namesByKey.get(getPluginEntryKey(entry));
2746
+ if (loadedName) return loadedName;
2747
+ return typeof entry === "string" ? entry : entry.name;
2748
+ });
2749
+ }
2750
+ /**
2680
2751
  * Computes a deduplication key for a plugin entry.
2681
2752
  *
2682
2753
  * String entries use the specifier itself as the key. Object entries use
@@ -2714,10 +2785,12 @@ async function loadPlugin(entry, configFilepath, pluginLoader) {
2714
2785
  const resolvedPath = resolvePluginPath(specifier, configFilepath, pluginLoader);
2715
2786
  const plugin = await importPlugin(resolvedPath, pluginLoader);
2716
2787
  const name = getPluginName$1(entry, specifier, plugin);
2788
+ const rules = getPluginRules(name, plugin);
2717
2789
  return {
2790
+ entryKey: getPluginEntryKey(entry),
2718
2791
  name,
2719
2792
  resolvedPath,
2720
- rules: getPluginRules(name, plugin),
2793
+ rules,
2721
2794
  specifier
2722
2795
  };
2723
2796
  }
@@ -2820,7 +2893,9 @@ let oxlintBinaryAvailability;
2820
2893
  * @returns The parsed rules, or an empty array if the binary is unavailable or the invocation fails.
2821
2894
  */
2822
2895
  async function getOxlintRules(options) {
2823
- if (options?.useVitePlus) return getVitePlusRules();
2896
+ const cwd = path.resolve(options?.cwd ?? process$1.cwd());
2897
+ const entry = resolveVitePlusEntry(cwd);
2898
+ if (options?.useVitePlus ?? Boolean(entry)) return getVitePlusRules(cwd, entry);
2824
2899
  if (!await isOxlintBinaryAvailable()) {
2825
2900
  console.error("Unable to inspect builtin Oxlint rules because the `oxlint` binary is not available on PATH.");
2826
2901
  return [];
@@ -2833,13 +2908,23 @@ async function getOxlintRules(options) {
2833
2908
  return [];
2834
2909
  }
2835
2910
  }
2836
- async function getVitePlusRules() {
2911
+ function resolveVitePlusEntry(cwd) {
2912
+ const require = createRequire(path.join(cwd, "package.json"));
2913
+ for (let directory = cwd;; directory = path.dirname(directory)) try {
2914
+ const packagePath = require.resolve(path.join(directory, "node_modules/vite-plus/package.json"));
2915
+ return path.join(path.dirname(packagePath), "bin/vp");
2916
+ } catch {
2917
+ if (path.dirname(directory) === directory) return;
2918
+ }
2919
+ }
2920
+ async function getVitePlusRules(cwd, entry) {
2837
2921
  try {
2838
- const rules = await x("vp", [
2922
+ const args = [
2839
2923
  "lint",
2840
2924
  "--rules",
2841
2925
  "--format=json"
2842
- ]);
2926
+ ];
2927
+ const rules = await x(entry ? process$1.execPath : "vp", entry ? [entry, ...args] : args, { nodeOptions: { cwd } });
2843
2928
  return JSON.parse(rules.stdout);
2844
2929
  } catch (error) {
2845
2930
  console.error("Error fetching Vite+ rules:", error);
@@ -2952,7 +3037,10 @@ async function inspectConfig(options = {}) {
2952
3037
  const config = await getConfig(options);
2953
3038
  if (!config) return null;
2954
3039
  const isVitePlus = config.filepath.endsWith("vite.config.ts");
2955
- const [builtinRules, loadedPlugins] = await Promise.all([getOxlintRules({ useVitePlus: isVitePlus }), getPlugins(config)]);
3040
+ const [builtinRules, loadedPlugins] = await Promise.all([getOxlintRules({
3041
+ useVitePlus: isVitePlus ? true : void 0,
3042
+ cwd: options.cwd
3043
+ }), getPlugins(config)]);
2956
3044
  return inspectLoadedConfig(config, builtinRules, loadedPlugins.plugins, loadedPlugins.errors);
2957
3045
  }
2958
3046
  /**
@@ -2967,7 +3055,7 @@ async function inspectConfig(options = {}) {
2967
3055
  function inspectLoadedConfig(config, builtinRules, plugins, pluginErrors) {
2968
3056
  const catalog = createRuleCatalog(builtinRules, plugins, [...config.config.plugins ?? DEFAULT_ENABLED_PLUGIN_NAMES, ...config.config.overrides?.flatMap((o) => o.plugins ?? []) ?? []], config.config.categories);
2969
3057
  applyConfiguredRules(catalog, config.config.rules);
2970
- const overrideGroups = createInspectedOverrideGroups(catalog, config.config.overrides);
3058
+ const overrideGroups = createInspectedOverrideGroups(catalog, config.config.overrides, plugins);
2971
3059
  const overrideSeveritiesByRuleId = createOverrideSeveritiesByRuleId(overrideGroups);
2972
3060
  const rules = [...catalog.rulesById.values()].map((rule) => {
2973
3061
  const usage = createRuleUsageSummary(rule, overrideSeveritiesByRuleId.get(rule.ruleId) ?? []);
@@ -3011,13 +3099,14 @@ function createRulePluginFilters(rules) {
3011
3099
  for (const rule of rules) if (rule.pluginName) pluginNames.add(rule.pluginName);
3012
3100
  return ["all", ...[...pluginNames].toSorted((left, right) => left.localeCompare(right))];
3013
3101
  }
3014
- function createInspectedOverrideGroups(catalog, overrides) {
3102
+ function createInspectedOverrideGroups(catalog, overrides, plugins) {
3015
3103
  const groups = [];
3016
3104
  for (const [index, override] of overrides?.entries() ?? []) {
3017
3105
  const group = {
3018
3106
  excludeFiles: override.excludeFiles,
3019
3107
  files: override.files,
3020
3108
  index,
3109
+ jsPlugins: override.jsPlugins?.length ? getPluginEntryNames(override.jsPlugins, plugins) : void 0,
3021
3110
  plugins: override.plugins,
3022
3111
  rules: []
3023
3112
  };