-
-
Notifications
You must be signed in to change notification settings - Fork 736
refactor(linter/plugins): move assertions into own file #15945
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/plugins): move assertions into own file #15945
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 plugins/utils.ts file by splitting it into three focused files within a new utils directory: asserts.ts for assertion functions, types.ts for type utilities, and utils.ts for general utility functions. This reorganization improves code organization and prepares for future changes mentioned in PR #15946.
Key Changes:
- Split
plugins/utils.tsinto three separate files:utils/asserts.ts,utils/types.ts, andutils/utils.ts - Updated 12 import statements across the codebase to reference the new file locations
- Removed unnecessary
// oxlint-disable-next-line no-unused-varscomment fromassertIsNonNullfunction
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
apps/oxlint/src-js/utils/utils.ts |
New file containing getErrorMessage utility function moved from plugins/utils.ts |
apps/oxlint/src-js/utils/types.ts |
New file containing SetNullable type utility moved from plugins/utils.ts |
apps/oxlint/src-js/utils/asserts.ts |
New file containing assertion functions (assertIs, assertIsNonNull) moved from plugins/utils.ts |
apps/oxlint/src-js/plugins/visitor.ts |
Updated import path for assertion functions to ../utils/asserts.js |
apps/oxlint/src-js/plugins/utils.ts |
File deleted - content split into three new files |
apps/oxlint/src-js/plugins/tokens.ts |
Updated import path for assertIsNonNull to ../utils/asserts.js |
apps/oxlint/src-js/plugins/source_code.ts |
Updated import path for assertIsNonNull to ../utils/asserts.js |
apps/oxlint/src-js/plugins/settings.ts |
Updated import path for assertIsNonNull to ../utils/asserts.js |
apps/oxlint/src-js/plugins/scope.ts |
Updated import paths for assertions to ../utils/asserts.js and types to ../utils/types.ts |
apps/oxlint/src-js/plugins/location.ts |
Updated import path for assertIsNonNull to ../utils/asserts.js |
apps/oxlint/src-js/plugins/load.ts |
Updated import paths for getErrorMessage and SetNullable type to new locations |
apps/oxlint/src-js/plugins/lint.ts |
Split imports to reference both ../utils/asserts.js and ../utils/utils.js |
apps/oxlint/src-js/plugins/fix.ts |
Updated import path for assertIs to ../utils/asserts.js |
apps/oxlint/src-js/plugins/context.ts |
Updated import path for assertIsNonNull to ../utils/asserts.js |
apps/oxlint/src-js/plugins/comments.ts |
Updated import path for assertIsNonNull to ../utils/asserts.js |
apps/oxlint/src-js/index.ts |
Updated import paths for assertions and types to reference new utils/ directory |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
Pure refactor. Split up `plugins/utils.ts` into 3 files in `utils` directory. Most importantly, assertion functions are by themselves in an `asserts.ts` file. This paves the way for the next PR (#15946).
c16cca7 to
512e43a
Compare
Pure refactor. Split up `plugins/utils.ts` into 3 files in `utils` directory. Most importantly, assertion functions are by themselves in an `asserts.ts` file. This paves the way for the next PR (#15946).

Pure refactor. Split up
plugins/utils.tsinto 3 files inutilsdirectory.Most importantly, assertion functions are by themselves in an
asserts.tsfile. This paves the way for the next PR (#15946).