Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Sep 23, 2025

Previously defineRule, when passed a rule with a createOnce method, would call createOnce immediately.

When the rule is used in Oxlint, this resulted in createOnce being called twice. createOnce might do some fairly expensive set-up work, so we only want to call it once (as the name suggests!).

Instead, defineRule don't call createOnce immediately. Call it the first time the create method which defineRule creates is called.

This means that, when using Oxlint:

  1. createOnce is only called once.
  2. defineRule call is cheaper.

i.e. the cost of making the rule ESLint-compatible is only paid when the user is running the rule in ESLint, not in Oxlint.

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 the C-bug Category - Bug label Sep 23, 2025
@overlookmotel overlookmotel marked this pull request as ready for review September 23, 2025 22:16
@overlookmotel overlookmotel self-assigned this Sep 23, 2025
@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, 10:29 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 23, 10:29 PM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Sep 23, 10:33 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #14060.
  • Sep 23, 10:33 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #14060.
  • Sep 23, 11:40 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 23, 11:40 PM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Sep 23, 11:47 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #14061.
  • Sep 23, 11:47 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #14061.
  • 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:03 AM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Sep 24, 12:09 AM UTC: Merged by the Graphite merge queue.

@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 23, 2025
@overlookmotel overlookmotel force-pushed the 09-23-fix_linter_plugins_definerule_call_createonce_lazily branch from f3cd2f8 to 6717384 Compare September 23, 2025 23:31
@overlookmotel overlookmotel force-pushed the 09-23-test_linter_plugins_test_returning_false_from_before_hook_skips_visitation_in_eslint branch from da57153 to 92e264d Compare September 23, 2025 23:31
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Sep 23, 2025
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 23, 2025
@overlookmotel overlookmotel force-pushed the 09-23-fix_linter_plugins_definerule_call_createonce_lazily branch from 6717384 to 547b20e Compare September 23, 2025 23:58
@overlookmotel overlookmotel force-pushed the 09-23-test_linter_plugins_test_returning_false_from_before_hook_skips_visitation_in_eslint branch from 92e264d to b605733 Compare September 23, 2025 23:58
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Sep 23, 2025
Previously `defineRule`, when passed a rule with a `createOnce` method, would call `createOnce` immediately.

When the rule is used in Oxlint, this resulted in `createOnce` being called twice. `createOnce` might do some fairly expensive set-up work, so we only want to call it once (as the name suggests!).

Instead, `defineRule` don't call `createOnce` immediately. Call it the first time the `create` method which `defineRule` creates is called.

This means that, when using Oxlint:

1. `createOnce` is only called once.
2. `defineRule` call is cheaper.

i.e. the cost of making the rule ESLint-compatible is only paid when the user is running the rule in ESLint, not in Oxlint.
@graphite-app graphite-app bot force-pushed the 09-23-test_linter_plugins_test_returning_false_from_before_hook_skips_visitation_in_eslint branch from b605733 to f2b3934 Compare September 24, 2025 00:03
@graphite-app graphite-app bot force-pushed the 09-23-fix_linter_plugins_definerule_call_createonce_lazily branch from 547b20e to 7bd01ed Compare September 24, 2025 00:04
Base automatically changed from 09-23-test_linter_plugins_test_returning_false_from_before_hook_skips_visitation_in_eslint to main September 24, 2025 00:08
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 24, 2025
@graphite-app graphite-app bot merged commit 7bd01ed into main Sep 24, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 09-23-fix_linter_plugins_definerule_call_createonce_lazily branch September 24, 2025 00:09
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.

1 participant