Files
overlookmotel 88f30e0b4a feat(linter/plugins): move eslint compatible plugin conversion to eslintCompatPlugin function (#18791)
Closes #18611.

Previously `definePlugin` and `defineRule` were doing double duty:

1. Providing type safety (standard `defineConfig` pattern).
2. Converting a plugin/rule to be ESLint compatible

Combining the two duties is probably confusing to users. Users are familiar with the `defineConfig` pattern and these functions generally don't do anything at runtime - just require a specific type as param and return the input untouched.

This PR adds a separate function `eslintCompatPlugin` which does the conversion to an ESLint-compatible plugin.

`definePlugin` and `defineRule` are now no-ops at runtime - they just pass through the plugin/rule unchanged.
2026-02-01 12:37:48 +00:00

1.3 KiB

Exit code

1

stdout

  x define-plugin-plugin(create): ident visit fn "a":
  | filename: <fixture>/files/1.js
   ,-[files/1.js:1:5]
 1 | let a, b;
   :     ^
   `----

  x define-plugin-plugin(create-once): ident visit fn "a":
  | filename: <fixture>/files/1.js
   ,-[files/1.js:1:5]
 1 | let a, b;
   :     ^
   `----

  x define-plugin-plugin(create): ident visit fn "b":
  | filename: <fixture>/files/1.js
   ,-[files/1.js:1:8]
 1 | let a, b;
   :        ^
   `----

  x define-plugin-plugin(create-once): ident visit fn "b":
  | filename: <fixture>/files/1.js
   ,-[files/1.js:1:8]
 1 | let a, b;
   :        ^
   `----

  x define-plugin-plugin(create): ident visit fn "c":
  | filename: <fixture>/files/2.js
   ,-[files/2.js:1:5]
 1 | let c, d;
   :     ^
   `----

  x define-plugin-plugin(create-once): ident visit fn "c":
  | filename: <fixture>/files/2.js
   ,-[files/2.js:1:5]
 1 | let c, d;
   :     ^
   `----

  x define-plugin-plugin(create): ident visit fn "d":
  | filename: <fixture>/files/2.js
   ,-[files/2.js:1:8]
 1 | let c, d;
   :        ^
   `----

  x define-plugin-plugin(create-once): ident visit fn "d":
  | filename: <fixture>/files/2.js
   ,-[files/2.js:1:8]
 1 | let c, d;
   :        ^
   `----

Found 0 warnings and 8 errors.
Finished in Xms on 2 files with 2 rules using X threads.

stderr