-
-
Notifications
You must be signed in to change notification settings - Fork 722
fix(linter/plugins): definePlugin apply defineRule to rules
#14065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
graphite-app
merged 1 commit into
main
from
09-23-fix_linter_plugins_defineplugin_apply_definerule_to_rules
Sep 24, 2025
Merged
fix(linter/plugins): definePlugin apply defineRule to rules
#14065
graphite-app
merged 1 commit into
main
from
09-23-fix_linter_plugins_defineplugin_apply_definerule_to_rules
Sep 24, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Sep 23, 2025
Merged
Member
Author
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
d5643a1 to
366db08
Compare
4f35132 to
62928ed
Compare
Member
Author
Merge activity
|
graphite-app bot
pushed a commit
that referenced
this pull request
Sep 24, 2025
Pure refactor. Just rename a test. Makes for a less messy diff on following PR #14065.
62928ed to
53198a5
Compare
`definePlugin` previously passed the input through unchanged. This necessitated wrapping every rule in `defineRule` too.
Instead, make `definePlugin` call `defineRule` for every rule.
Before:
```js
import { definePlugin, defineRule } from 'oxlint';
export default definePlugin({
meta: { name: 'my-plugin' },
rules: {
'my-rule': defineRule({
createOnce: (context) => ({ /* visitor */ }),
}),
'my-other-rule': defineRule({
createOnce: (context) => ({ /* visitor */ }),
}),
},
});
```
After:
```js
import { definePlugin } from 'oxlint';
export default definePlugin({
meta: { name: 'my-plugin' },
rules: {
'my-rule': {
createOnce: (context) => ({ /* visitor */ }),
},
'my-other-rule': {
createOnce: (context) => ({ /* visitor */ }),
},
},
});
```
53198a5 to
314c27d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

definePluginpreviously passed the input through unchanged. This necessitated wrapping every rule indefineRuletoo.Instead, make
definePlugincalldefineRulefor every rule.Before:
After: