Skip to content

Comments

refactor(linter/plugins): add TODO comments for @ts-expect-errors which need fixing#16796

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-13-refactor_linter_plugins_add_todo_comments_for_ts-expect-error_s_which_need_fixing
Dec 13, 2025
Merged

refactor(linter/plugins): add TODO comments for @ts-expect-errors which need fixing#16796
graphite-app[bot] merged 1 commit intomainfrom
12-13-refactor_linter_plugins_add_todo_comments_for_ts-expect-error_s_which_need_fixing

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Dec 13, 2025

Only alters comments.

  • Make sure all // @ts-expect-error comments include "TODO" where it's an issue we need to fix.
  • Format all the "TODO" comments consistently.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI A-linter-plugins Area - Linter JS plugins C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Dec 13, 2025
Copy link
Member Author

overlookmotel commented Dec 13, 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.

@overlookmotel overlookmotel marked this pull request as ready for review December 13, 2025 14:16
Copilot AI review requested due to automatic review settings December 13, 2025 14:16
Copy link

@charliecreates charliecreates bot left a comment

Choose a reason for hiding this comment

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

The diff meets the stated goal of adding TODO to relevant @ts-expect-error comments and making formatting more consistent. The main remaining issue is that several TODOs are still vague and may become permanent; making them actionable (e.g., TODO(#issue): ...) would significantly improve maintainability. Consider referencing a single tracked issue for repeated suppressions like “types don’t quite align yet” to avoid TODO drift.

Additional notes (3)
  • Maintainability | apps/oxlint/src-js/plugins/scope.ts:118-118
    Multiple @ts-expect-error - TODO: ... suppressions use the same generic rationale. That’s fine, but it’s still not very actionable; it doesn’t help a future maintainer know whether this is blocked on upstream @typescript-eslint/scope-manager typings, your ESTree alignment/typegen, or something else. Also, since this file has many suppressions with the same message, consider centralizing the mismatch via a typed adapter/wrapper (so you have 1-2 suppressions instead of many), but that may be outside the scope of this PR.

  • Maintainability | apps/oxlint/src-js/plugins/scope.ts:264-264
    Not all @ts-expect-error comments in this file were converted to TODOs—line 262 remains // @ts-expect-error - Don't want to create a new variable just to make it nullable. Per the PR context (“include TODO where it's an issue we need to fix”), this one is ambiguous: if it’s a deliberate and acceptable suppression, it should not be TODO (fine), but the wording currently mixes the standardized dash format with a non-TODO rationale.

To keep comment conventions consistent, consider either (a) switching to a non-TODO standard format for “intentional” suppressions (if you have one), or (b) rewording this to fit the same pattern (and optionally clarify that it’s intentional/acceptable).

  • Maintainability | apps/oxlint/test/fixtures/parent/plugin.ts:17-18
    This is a test fixture and the TODO addition aligns with the PR intent. One concern: the message "We need to fix our types" is vague; even in fixtures, vague TODOs tend to stick around indefinitely. If there’s an existing issue for fixing getAncestors() typing or the Node definition, referencing it would make this TODO meaningfully actionable.
Summary of changes

What changed

  • Standardized several // @ts-expect-error comments to include a consistent prefix: // @ts-expect-error - TODO: ....
  • Updated @ts-expect-error annotations across multiple plugin modules (lint, scope, selector, source_code) and a test fixture to clearly flag known type mismatches as TODOs.

Files touched

  • apps/oxlint/src-js/plugins/lint.ts
  • apps/oxlint/src-js/plugins/scope.ts
  • apps/oxlint/src-js/plugins/selector.ts
  • apps/oxlint/src-js/plugins/source_code.ts
  • apps/oxlint/test/fixtures/parent/plugin.ts

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 standardizes the formatting of @ts-expect-error comments to clearly distinguish type issues that need fixing from intentional suppressions. All comments representing technical debt are updated to use the format // @ts-expect-error - TODO: followed by the explanation.

  • Adds "TODO:" to @ts-expect-error comments that represent type issues requiring future fixes
  • Ensures consistent formatting across all such comments with - TODO: separator

Reviewed changes

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

Show a summary per file
File Description
apps/oxlint/test/fixtures/parent/plugin.ts Updated comment for getAncestors type issue to include TODO
apps/oxlint/src-js/plugins/source_code.ts Updated comments for missing .d.ts file and parent property type issues to include TODO
apps/oxlint/src-js/plugins/selector.ts Updated comment for missing .d.ts file to include TODO
apps/oxlint/src-js/plugins/scope.ts Updated multiple comments for type alignment issues to include TODO consistently
apps/oxlint/src-js/plugins/lint.ts Updated comment for missing .d.ts file to include TODO

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

@overlookmotel overlookmotel self-assigned this Dec 13, 2025
@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Dec 13, 2025
Copy link
Member Author

overlookmotel commented Dec 13, 2025

Merge activity

…hich need fixing (#16796)

Only alters comments.

* Make sure all `// @ts-expect-error` comments include "TODO" where it's an issue we need to fix.
* Format all the "TODO" comments consistently.
@graphite-app graphite-app bot force-pushed the 12-13-test_linter_plugins_remove_ts-expect-error_from_tests branch from 151fe2b to 26ae895 Compare December 13, 2025 14:34
@graphite-app graphite-app bot force-pushed the 12-13-refactor_linter_plugins_add_todo_comments_for_ts-expect-error_s_which_need_fixing branch from 3b1fbac to fabe6f7 Compare December 13, 2025 14:34
Base automatically changed from 12-13-test_linter_plugins_remove_ts-expect-error_from_tests to main December 13, 2025 14:39
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 13, 2025
@graphite-app graphite-app bot merged commit fabe6f7 into main Dec 13, 2025
19 checks passed
@graphite-app graphite-app bot deleted the 12-13-refactor_linter_plugins_add_todo_comments_for_ts-expect-error_s_which_need_fixing branch December 13, 2025 14:40
graphite-app bot pushed a commit that referenced this pull request Dec 13, 2025
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.

1 participant