Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Dec 8, 2025

After #16609, the value of globals is serialized correctly ("writable" not "writeable"), so this workaround is no longer required. Remove it.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins labels Dec 8, 2025
Copy link
Member Author

overlookmotel commented Dec 8, 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-performance Category - Solution not expected to change functional behavior, only performance label Dec 8, 2025
@overlookmotel overlookmotel marked this pull request as ready for review December 8, 2025 15:12
Copilot AI review requested due to automatic review settings December 8, 2025 15:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes a workaround in the TypeScript plugin code that was previously needed to rename misspelled global values from "writeable" to "writable". After PR #16609 fixed the serialization in the Rust code (using #[serde(rename_all = "lowercase")] on the GlobalValue enum), the JSON now correctly contains "writable" instead of "writeable", making this TypeScript workaround obsolete.

Key Changes

  • Removed the loop that renamed "writeable" to "writable" in deserialized globals
  • Simplified control flow by using if-else instead of early return pattern
  • Removed unused Writable type import from type-fest
  • Enhanced debug assertions to include array type check

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@graphite-app graphite-app bot changed the base branch from 12-08-refactor_linter_rename_globalvalue_writeable_to_writable_ to graphite-base/16610 December 8, 2025 15:20
graphite-app bot pushed a commit that referenced this pull request Dec 8, 2025
"Writeable" is a mis-spelling. In addition:

Oxlint docs say:

> You may also use `"writeable"` or `true` to represent `"writable"`.

[ESLint's docs](https://eslint.org/docs/v8.x/use/configure/language-options#using-configuration-files-1) state "writable" (without an "e") as the name of the option.

This suggests that "writable" is the "real" name of this option, and "writeable" (with an "e") is an alias provided for backwards compat.

Therefore, I think it makes more sense to call the enum variant `GlobalValue::Writable` (with the correct spelling).

Main motivation is that it means globals get serialized with the right spelling, allowing removing a JS-side workaround from JS plugins code (#16610).

For consistency, I've changed "writeable" to "writable" in all test cases, except for 1 test which specifically aims to check that that "legacy" spelling is accepted.

https://github.com/oxc-project/oxc/blob/00c5614d1f1bb3465ba7aa5ad668a936b8ec1266/crates/oxc_linter/src/config/globals.rs#L161-L168
@graphite-app graphite-app bot force-pushed the graphite-base/16610 branch from 00c5614 to 913b1b3 Compare December 8, 2025 15:27
@graphite-app graphite-app bot force-pushed the 12-08-perf_linter_plugins_remove_code_for_renaming_global_values branch from 4f65b42 to 74641bb Compare December 8, 2025 15:27
@graphite-app graphite-app bot changed the base branch from graphite-base/16610 to main December 8, 2025 15:27
@graphite-app graphite-app bot force-pushed the 12-08-perf_linter_plugins_remove_code_for_renaming_global_values branch from 74641bb to 91d17e3 Compare December 8, 2025 15:28
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Dec 8, 2025
Copy link
Contributor

camc314 commented Dec 8, 2025

Merge activity

After #16609, the value of globals is serialized correctly ("writable" not "writeable"), so this workaround is no longer required. Remove it.
@graphite-app graphite-app bot force-pushed the 12-08-perf_linter_plugins_remove_code_for_renaming_global_values branch from 91d17e3 to 0241b9a Compare December 8, 2025 17:08
@graphite-app graphite-app bot merged commit 0241b9a into main Dec 8, 2025
18 checks passed
@graphite-app graphite-app bot deleted the 12-08-perf_linter_plugins_remove_code_for_renaming_global_values branch December 8, 2025 17:14
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 8, 2025
Copilot AI pushed a commit that referenced this pull request Dec 10, 2025
"Writeable" is a mis-spelling. In addition:

Oxlint docs say:

> You may also use `"writeable"` or `true` to represent `"writable"`.

[ESLint's docs](https://eslint.org/docs/v8.x/use/configure/language-options#using-configuration-files-1) state "writable" (without an "e") as the name of the option.

This suggests that "writable" is the "real" name of this option, and "writeable" (with an "e") is an alias provided for backwards compat.

Therefore, I think it makes more sense to call the enum variant `GlobalValue::Writable` (with the correct spelling).

Main motivation is that it means globals get serialized with the right spelling, allowing removing a JS-side workaround from JS plugins code (#16610).

For consistency, I've changed "writeable" to "writable" in all test cases, except for 1 test which specifically aims to check that that "legacy" spelling is accepted.

https://github.com/oxc-project/oxc/blob/00c5614d1f1bb3465ba7aa5ad668a936b8ec1266/crates/oxc_linter/src/config/globals.rs#L161-L168
Copilot AI pushed a commit that referenced this pull request Dec 10, 2025
After #16609, the value of globals is serialized correctly ("writable" not "writeable"), so this workaround is no longer required. Remove it.
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
…project#16609)

"Writeable" is a mis-spelling. In addition:

Oxlint docs say:

> You may also use `"writeable"` or `true` to represent `"writable"`.

[ESLint's docs](https://eslint.org/docs/v8.x/use/configure/language-options#using-configuration-files-1) state "writable" (without an "e") as the name of the option.

This suggests that "writable" is the "real" name of this option, and "writeable" (with an "e") is an alias provided for backwards compat.

Therefore, I think it makes more sense to call the enum variant `GlobalValue::Writable` (with the correct spelling).

Main motivation is that it means globals get serialized with the right spelling, allowing removing a JS-side workaround from JS plugins code (oxc-project#16610).

For consistency, I've changed "writeable" to "writable" in all test cases, except for 1 test which specifically aims to check that that "legacy" spelling is accepted.

https://github.com/oxc-project/oxc/blob/00c5614d1f1bb3465ba7aa5ad668a936b8ec1266/crates/oxc_linter/src/config/globals.rs#L161-L168
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
…ject#16610)

After oxc-project#16609, the value of globals is serialized correctly ("writable" not "writeable"), so this workaround is no longer required. Remove it.
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 A-linter-plugins Area - Linter JS plugins C-performance Category - Solution not expected to change functional behavior, only performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants