-
-
Notifications
You must be signed in to change notification settings - Fork 764
refactor(linter): rename GlobalValue::Writeable to Writable
#16609
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
refactor(linter): rename GlobalValue::Writeable to Writable
#16609
Conversation
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. |
CodSpeed Performance ReportMerging #16609 will not alter performanceComparing Summary
Footnotes
|
There was a problem hiding this 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 corrects the spelling of the GlobalValue enum variant from Writeable to Writable, aligning with ESLint's canonical spelling. The change ensures that globals are serialized with the correct spelling ("writable" instead of "writeable"), while maintaining full backward compatibility by continuing to accept "writeable" as input through the TryFrom<&str> implementation.
Key Changes
- Renamed
GlobalValue::WriteabletoGlobalValue::Writablein the Rust enum - Updated serialization to use "writable" as the canonical form
- Maintained backward compatibility by accepting both "writable" and "writeable" in deserialization
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
crates/oxc_linter/src/config/globals.rs |
Renamed enum variant from Writeable to Writable, updated as_str() method, and updated From<bool> implementation while preserving backward compatibility in TryFrom<&str> |
crates/oxc_linter/src/config/config_store.rs |
Updated test cases to use "writable" instead of "writeable" in JSON test data |
apps/oxlint/fixtures/overrides_env_globals/.oxlintrc.json |
Updated fixture configuration file to use canonical "writable" spelling |
npm/oxlint/configuration_schema.json |
Updated schema enum to list "writable" instead of "writeable" as the canonical value |
crates/oxc_linter/src/snapshots/schema_json.snap |
Updated snapshot to reflect schema changes |
editors/vscode/tests/test-helpers.ts |
Updated TypeScript type definition to use "writable" instead of "writeable" |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
"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
00c5614 to
913b1b3
Compare
After #16609, the value of globals is serialized correctly ("writable" not "writeable"), so this workaround is no longer required. Remove it.
"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
After #16609, the value of globals is serialized correctly ("writable" not "writeable"), so this workaround is no longer required. Remove it.
…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
…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.

"Writeable" is a mis-spelling. In addition:
Oxlint docs say:
ESLint's docs 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.
oxc/crates/oxc_linter/src/config/globals.rs
Lines 161 to 168 in 00c5614