Skip to content

Commit d5c286b

Browse files
committed
docs(linter/plugins): improve JSDoc comments for definePlugin and defineRule
1 parent 52db331 commit d5c286b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/oxlint/src-js/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ const dummyOptions: unknown[] = [],
1010
/**
1111
* Define a plugin.
1212
*
13-
* Converts any rules with `createOnce` method to have an ESLint-compatible `create` method.
13+
* If any of the plugin's rules use the Oxlint alternative `createOnce` API,
14+
* add ESLint-compatible `create` methods to those rules, which delegate to `createOnce`.
15+
* This makes the plugin compatible with ESLint.
1416
*
1517
* The `plugin` object passed in is mutated in-place.
1618
*
@@ -38,8 +40,9 @@ export function definePlugin(plugin: Plugin): Plugin {
3840
/**
3941
* Define a rule.
4042
*
41-
* If rules does not already have a `create` method, create an ESLint-compatible `create` method
42-
* which delegates to `createOnce`.
43+
* If `rule` uses the Oxlint alternative `createOnce` API, add an ESLint-compatible
44+
* `create` method to the rule, which delegates to `createOnce`.
45+
* This makes the rule compatible with ESLint.
4346
*
4447
* The `rule` object passed in is mutated in-place.
4548
*

0 commit comments

Comments
 (0)