Skip to content

refactor(linter/plugins): remove Workspace and WorkspaceIdentifier types#18757

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/01-31-refactor_linter_plugins_remove_workspace_and_workspaceidentifier_types
Jan 31, 2026
Merged

refactor(linter/plugins): remove Workspace and WorkspaceIdentifier types#18757
graphite-app[bot] merged 1 commit intomainfrom
om/01-31-refactor_linter_plugins_remove_workspace_and_workspaceidentifier_types

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Jan 31, 2026

Pure refactor. Remove these 2 types which were both just aliases for string.

In Rust type wrappers can be useful (e.g. ScopeId) but in TS they don't add type safety, and IMO make the code less readable.

Copy link
Member Author

overlookmotel commented Jan 31, 2026

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

Removes the Workspace and WorkspaceIdentifier TypeScript type aliases (both previously string) and replaces their usage with plain string workspace IDs across the JS plugin workspace, options, and plugin-loading modules.

Changes:

  • Delete WorkspaceIdentifier / Workspace type exports from workspace/index.ts
  • Update workspace tracking and public workspace functions to use string
  • Update plugin options and plugin registry maps to use string keys and remove now-unused type imports

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
apps/oxlint/src-js/workspace/index.ts Removes workspace alias types; uses string for workspace IDs and internal workspace set.
apps/oxlint/src-js/plugins/options.ts Replaces Map<WorkspaceIdentifier, …> with Map<string, …>; removes unused type import.
apps/oxlint/src-js/plugins/load.ts Replaces Map<WorkspaceIdentifier, …> with Map<string, …>; removes unused type import and updates workspace-related APIs.

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

@overlookmotel overlookmotel force-pushed the om/01-31-refactor_linter_plugins_remove_workspace_and_workspaceidentifier_types branch from 96b68e3 to 7dbaf0f Compare January 31, 2026 13:49
@overlookmotel overlookmotel force-pushed the om/01-31-feat_linter_plugins_ruletester_take_cwd_property branch from d131a9e to a352061 Compare January 31, 2026 13:49
@overlookmotel overlookmotel force-pushed the om/01-31-refactor_linter_plugins_remove_workspace_and_workspaceidentifier_types branch from 7dbaf0f to 38e069f Compare January 31, 2026 15:14
@overlookmotel overlookmotel force-pushed the om/01-31-feat_linter_plugins_ruletester_take_cwd_property branch from a352061 to 0ada537 Compare January 31, 2026 15:14
Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

lets consider moving these to branded strings in the future

@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jan 31, 2026
Copy link
Contributor

camc314 commented Jan 31, 2026

Merge activity

@graphite-app graphite-app bot added 0-merge Merge with Graphite Merge Queue and removed 0-merge Merge with Graphite Merge Queue labels Jan 31, 2026
@graphite-app graphite-app bot changed the base branch from om/01-31-feat_linter_plugins_ruletester_take_cwd_property to graphite-base/18757 January 31, 2026 15:35
graphite-app bot pushed a commit that referenced this pull request Jan 31, 2026
…` types (#18757)

Pure refactor. Remove these 2 types which were both just aliases for `string`.

In Rust type wrappers can be useful (e.g. `ScopeId`) but in TS they don't add type safety, and IMO make the code less readable.
@graphite-app graphite-app bot force-pushed the om/01-31-refactor_linter_plugins_remove_workspace_and_workspaceidentifier_types branch from 38e069f to 3ea3ea1 Compare January 31, 2026 15:43
@graphite-app graphite-app bot changed the base branch from graphite-base/18757 to om/01-31-feat_linter_plugins_ruletester_take_cwd_property January 31, 2026 15:43
Base automatically changed from om/01-31-feat_linter_plugins_ruletester_take_cwd_property to main January 31, 2026 15:48
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 31, 2026
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Jan 31, 2026
@camc314 camc314 force-pushed the om/01-31-refactor_linter_plugins_remove_workspace_and_workspaceidentifier_types branch from 3ea3ea1 to 73a6926 Compare January 31, 2026 16:08
…` types (#18757)

Pure refactor. Remove these 2 types which were both just aliases for `string`.

In Rust type wrappers can be useful (e.g. `ScopeId`) but in TS they don't add type safety, and IMO make the code less readable.
@graphite-app graphite-app bot force-pushed the om/01-31-refactor_linter_plugins_remove_workspace_and_workspaceidentifier_types branch from 73a6926 to 6c5a09f Compare January 31, 2026 16:09
@graphite-app graphite-app bot merged commit 6c5a09f into main Jan 31, 2026
19 checks passed
@graphite-app graphite-app bot deleted the om/01-31-refactor_linter_plugins_remove_workspace_and_workspaceidentifier_types branch January 31, 2026 16:16
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 31, 2026
@overlookmotel
Copy link
Member Author

lets consider moving these to branded strings in the future

Is that possible to do in TypeScript?

@camc314
Copy link
Contributor

camc314 commented Feb 2, 2026

yes 😉

type WorkspaceIdentifier = string & { __brand: UniqueSymbol }

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-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants