Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Sep 23, 2025

definePlugin previously passed the input through unchanged. This necessitated wrapping every rule in defineRule too.

Instead, make definePlugin call defineRule for every rule.

Before:

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:

import { definePlugin } from 'oxlint';

export default definePlugin({
  meta: { name: 'my-plugin' },
  rules: {
    'my-rule': {
      createOnce: (context) => ({ /* visitor */ }),
    },
    'my-other-rule': {
      createOnce: (context) => ({ /* visitor */ }),
    },
  },
});

Copy link
Member Author

overlookmotel commented Sep 23, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI C-bug Category - Bug labels Sep 23, 2025
@overlookmotel overlookmotel marked this pull request as ready for review September 23, 2025 23:39
@overlookmotel overlookmotel self-assigned this Sep 23, 2025
@overlookmotel overlookmotel marked this pull request as draft September 23, 2025 23:40
@overlookmotel overlookmotel force-pushed the 09-23-test_linter_plugins_rename_test branch from d5643a1 to 366db08 Compare September 23, 2025 23:58
@overlookmotel overlookmotel force-pushed the 09-23-fix_linter_plugins_defineplugin_apply_definerule_to_rules branch from 4f35132 to 62928ed Compare September 23, 2025 23:58
@overlookmotel overlookmotel marked this pull request as ready for review September 23, 2025 23:58
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Sep 23, 2025
Copy link
Member Author

overlookmotel commented Sep 23, 2025

Merge activity

  • Sep 23, 11:58 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 24, 12:06 AM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Sep 24, 12:11 AM UTC: The Graphite merge queue couldn't merge this PR because it had merge conflicts.
  • Sep 24, 12:20 AM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Sep 24, 12:24 AM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Sep 24, 12:29 AM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot changed the base branch from 09-23-test_linter_plugins_rename_test to graphite-base/14065 September 24, 2025 00:04
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.
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 24, 2025
@graphite-app graphite-app bot changed the base branch from graphite-base/14065 to main September 24, 2025 00:11
@overlookmotel overlookmotel force-pushed the 09-23-fix_linter_plugins_defineplugin_apply_definerule_to_rules branch from 62928ed to 53198a5 Compare September 24, 2025 00:20
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Sep 24, 2025
`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 */ }),
    },
  },
});
```
@graphite-app graphite-app bot force-pushed the 09-23-fix_linter_plugins_defineplugin_apply_definerule_to_rules branch from 53198a5 to 314c27d Compare September 24, 2025 00:25
@graphite-app graphite-app bot merged commit 314c27d into main Sep 24, 2025
17 checks passed
@graphite-app graphite-app bot deleted the 09-23-fix_linter_plugins_defineplugin_apply_definerule_to_rules branch September 24, 2025 00:29
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants