-
-
Notifications
You must be signed in to change notification settings - Fork 573
refactor(syntax): rename NameSpaceModule
to NamespaceModule
#10917
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(syntax): rename NameSpaceModule
to NamespaceModule
#10917
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. |
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 refactors the codebase to rename the symbol flag from "NameSpaceModule" to "NamespaceModule" in order to match the naming convention used in TypeScript.
- Renames constants, functions, and flag references from NameSpaceModule to NamespaceModule.
- Updates tests and snapshot files to reflect the renaming.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
crates/oxc_transformer/src/typescript/namespace.rs | Replaces namespace checks with calls to is_namespace_module. |
crates/oxc_syntax/src/symbol.rs | Renames the constant and associated method to NamespaceModule. |
crates/oxc_semantic/tests/integration/symbols.rs | Updates expected flag values in tests. |
crates/oxc_semantic/tests/fixtures/typescript-eslint/type-declaration/interface-heritage2.snap | Adjusts snapshot to reflect new flag naming. |
crates/oxc_semantic/tests/fixtures/typescript-eslint/ts-module/declaration-merging/namespace-variable.snap | Adjusts snapshot to reflect new flag naming. |
crates/oxc_semantic/src/binder.rs | Updates symbol flags union for module declarations. |
crates/oxc_linter/src/rules/eslint/no_unused_vars/usage.rs | Updates flag union in no-unused-vars usage. |
crates/oxc_linter/src/rules/eslint/no_unused_vars/mod.rs | Updates flag union in no-unused-vars module. |
Comments suppressed due to low confidence (11)
crates/oxc_transformer/src/typescript/namespace.rs:110
- Renamed method check to 'is_namespace_module' aligns with TypeScript's naming convention. Confirm consistency across similar namespace checks.
if flags.is_namespace_module() {
crates/oxc_transformer/src/typescript/namespace.rs:152
- Updated the check to 'is_namespace_module' for clarity; ensure that similar flag checks are updated consistently.
if current_declaration_flags.is_namespace_module() {
crates/oxc_syntax/src/symbol.rs:127
- Renaming the constant from 'NameSpaceModule' to 'NamespaceModule' improves consistency with TypeScript conventions.
const NamespaceModule = 1 << 14;
crates/oxc_syntax/src/symbol.rs:261
- Renaming the method to 'is_namespace_module' accurately reflects its purpose; ensure all call sites are updated accordingly.
pub fn is_namespace_module(&self) -> bool {
crates/oxc_syntax/src/symbol.rs:273
- Updated the flag from 'NameSpaceModule' to 'NamespaceModule' in the intersection; verify that flag operations continue to work as expected.
self.intersects(Self::Type | Self::TypeImport | Self::Import | Self::NamespaceModule)
crates/oxc_semantic/tests/integration/symbols.rs:428
- Test expectation updated to 'NamespaceModule' to match the new flag naming.
.contains_flags(SymbolFlags::NamespaceModule)
crates/oxc_semantic/tests/fixtures/typescript-eslint/type-declaration/interface-heritage2.snap:58
- Snapshot updated to reflect the renaming from 'NameSpaceModule' to 'NamespaceModule'.
"flags": "SymbolFlags(NamespaceModule)",
crates/oxc_semantic/tests/fixtures/typescript-eslint/ts-module/declaration-merging/namespace-variable.snap:21
- Snapshot updated to replace 'NameSpaceModule' with 'NamespaceModule' for consistent naming.
"flags": "SymbolFlags(BlockScopedVariable | ConstVariable | NamespaceModule)",
crates/oxc_semantic/src/binder.rs:420
- The symbol flags union now uses 'NamespaceModule' to ensure consistency in module declaration handling.
(SymbolFlags::NamespaceModule, SymbolFlags::NamespaceModuleExcludes)
crates/oxc_linter/src/rules/eslint/no_unused_vars/usage.rs:37
- Updated union operation to use 'NamespaceModule' instead of the legacy 'NameSpaceModule' flag.
SymbolFlags::NamespaceModule.union(SymbolFlags::ValueModule);
crates/oxc_linter/src/rules/eslint/no_unused_vars/mod.rs:349
- Consistently updated to use 'NamespaceModule' to adhere to the new naming convention.
SymbolFlags::NamespaceModule.union(SymbolFlags::Ambient);
CodSpeed Instrumentation Performance ReportMerging #10917 will not alter performanceComparing Summary
|
51f8aaa
to
4c5b6aa
Compare
Merge activity
|
4c5b6aa
to
33ec87b
Compare
As much as possible, keep the name the same as `TypeScript` https://github.com/microsoft/TypeScript/blob/8c62e08448e0ec76203bd519dd39608dbcb31705/src/compiler/types.ts#L5915
33ec87b
to
faf0a95
Compare
## [0.16.11] - 2025-05-16 ### Features - 078bf0b language_server: Better fallback handling when passing invalid `Options` values (#10930) (Sysix) - be7f7e1 language_server/editor: Support multi workspace folders (#10875) (Sysix) - eef93b4 linter: Add import/no-unassigned-import (#10970) (yefan) - cc0112f linter: No-unused-vars add setting for `reportVarsOnlyUsedAsTypes` (#11009) (camc314) - 17e49c3 linter: Implement configuration and checking loops for `eslint/no_constant_condition` (#10949) (Ulrich Stark) - 21117ac linter: Implement react/forbid-elements (#10928) (Thomas BOCQUEZ) - 466c24a linter: Add gitlab reporter output format (#10927) (Connor Pearson) - a064082 linter: Add import/consistent-type-specifier-style rule (#10858) (yefan) - 4733b52 linter/no-extraneous-class: Add conditional fixer (#10798) (DonIsaac) ### Bug Fixes - 87bf2a8 editor: Send only `workspace/didChangeConfiguration` when some workspace configuration is effected (#11017) (Sysix) - ed5708d editor: Detect all workspaces config path changes (#11016) (Sysix) - 89cc21b language_server: Normalize oxlintrc config path (#10982) (Sysix) - c52a9ba linter: Fix plugins inside overrides not being applied (#11057) (camc314) - b12bd48 linter: Fix rule config not being correctly applied (#11055) (camc314) - 9a368be linter: False negative in no-restriced-imports with `patterns` and side effects (#11027) (camc314) - 8c2cfbc linter: False negative in no-restricted-imports (#11026) (camc314) - 8956870 linter: False positive in no-unused-vars (#11002) (camc314) - 33a60d2 linter: Skip eslint/no-redeclare when running on modules (#11004) (camc314) - 39063ce linter: Reword diagnostic message for no-control-regex (#10993) (camc314) - 9eedb58 linter: False positive with negative matches in no-restricted-imports (#10976) (camc314) - 10e77d7 linter: Improve diagnostics for no-control-regex (#10959) (camc314) - 0961296 linter: Add `gitlab` to linter `--help` docs (#10932) (camc314) - 82889ae linter/no-extraneous-class: Improve docs, reporting and code refactor (#10797) (DonIsaac) - 11c34e7 linter/no-img-element: Improve diagnostic and docs (#10908) (DonIsaac) - 584d8b9 napi: Enable mimalloc `no_opt_arch` feature on linux aarch64 (#11053) (Boshen) - 126ae75 semantic: Distinguish class private elements (#11044) (magic-akari) - 773d0de semantic: Correctly handle nested brackets in jsdoc parsing (#10922) (camc314) - b215b6c semantic: Dont parse `@` as jsdoc tags inside `[`/`]` (#10919) (camc314) ### Documentation - db6afb9 linter: Improve docs of no-debugger (#11033) (camc314) - 16541de linter: Improve docs of default-param-last (#11032) (camc314) - 2c2f3c4 linter: Improve docs of default-case-last (#11031) (camc314) - 56bb9ce linter: Improve docs of array-callback-return (#11030) (camc314) - 13dbcc6 linter: Correct docs for default config for no-redeclare (#10995) (camc314) - a86cbb3 linter: Fix incorrect backticks of fenced code blocks (#10947) (Ulrich Stark) ### Refactor - 3cc1466 language_server: New configuration structure for `initialize` and `workspace/didChangeConfiguration` (#10890) (Sysix) - bd2ef7d language_server: Use `Arc` for `diagnostic_report_map` (#10940) (Sysix) - bb999a3 language_server: Avoid cloning linter by taking reference in LintService (#10907) (Ulrich Stark) - d1b0c83 linter: Remove overrides index vec (#11058) (camc314) - 7ad6cf8 linter: Store severity separately, remove `RuleWithSeverity` (#11051) (camchenry) - e31c361 linter: Remove nested match statements in no-restricted-imports (#10975) (camc314) - 6ad9d4f linter: Tidy `eslint/func-names` (#10923) (camc314) - faf0a95 syntax: Rename `NameSpaceModule` to `NamespaceModule` (#10917) (Dunqing) ### Testing - 76b6b33 editor: Add tests for multi workspace folder setup (#10904) (Sysix) Co-authored-by: camc314 <[email protected]>
As much as possible, keep the name the same as
TypeScript
https://github.com/microsoft/TypeScript/blob/8c62e08448e0ec76203bd519dd39608dbcb31705/src/compiler/types.ts#L5915