Skip to content

Comments

refactor(linter): rename visitor.d.ts to visitor.ts#16473

Closed
camc314 wants to merge 2 commits intomainfrom
c/12-03-refactor_linter_rename_visitor.d.ts_to_visitor.ts
Closed

refactor(linter): rename visitor.d.ts to visitor.ts#16473
camc314 wants to merge 2 commits intomainfrom
c/12-03-refactor_linter_rename_visitor.d.ts_to_visitor.ts

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Dec 3, 2025

Changes visitor.d.ts from a typescript declaration file to a normal typescript file. This allows the typescript type checker to actuall check for issues in this file.

e.g. before #16471: we had tons of errors that were supressed because this wasn't being type checked.

Screenshot 2025-12-03 at 22 59 40

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

camc314 commented Dec 3, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


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.

@camc314 camc314 assigned camc314 and overlookmotel and unassigned camc314 Dec 3, 2025
@camc314 camc314 marked this pull request as ready for review December 3, 2025 23:00
Copy link
Member

@overlookmotel overlookmotel left a comment

Choose a reason for hiding this comment

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

Ah ha! I didn't know that .d.ts files didn't get type-checked. Thank you, teacher!

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Dec 3, 2025
Copy link
Member

overlookmotel commented Dec 3, 2025

Merge activity

  • Dec 3, 11:06 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 3, 11:06 PM UTC: overlookmotel added this pull request to the Graphite merge queue.
  • Dec 3, 11:06 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #16471.
  • Dec 3, 11:07 PM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #16471.

@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 3, 2025
@camc314 camc314 changed the base branch from c/12-03-fix_linter_use_import_type_for_estree_in_visitor.d.ts to graphite-base/16473 December 7, 2025 14:44
@camc314 camc314 marked this pull request as draft December 7, 2025 14:45
graphite-app bot pushed a commit that referenced this pull request Dec 7, 2025
Use `import type` instead of `import` for type-only imports to follow, TypeScript best practices.

This is also in prepartation for #16473 which converts this file to a `.ts` file rather than a declaration file. Using a `.ts` file is an advantage as it means that typescript will actually check it rather than skipping it ([skipLibCheck](https://www.typescriptlang.org/tsconfig/#skipLibCheck))

🤖 generated with help from Claude Opus 4.5
…ith index signature

Use intersection type instead of interface to avoid TypeScript strict mode errors
when using defineRule with specific visitor methods like Program().

Closes #14745
@graphite-app graphite-app bot force-pushed the graphite-base/16473 branch from cbec81d to a806d74 Compare December 7, 2025 14:57
@graphite-app graphite-app bot force-pushed the c/12-03-refactor_linter_rename_visitor.d.ts_to_visitor.ts branch from 64d9644 to 2a5f6e8 Compare December 7, 2025 14:57
@graphite-app graphite-app bot changed the base branch from graphite-base/16473 to main December 7, 2025 14:58
Rename from declaration file to regular TypeScript file since it only
contains type exports and is not accompanying a JavaScript file.

Closes #14745
@graphite-app graphite-app bot force-pushed the c/12-03-refactor_linter_rename_visitor.d.ts_to_visitor.ts branch from 2a5f6e8 to 1d2b03d Compare December 7, 2025 14:58
@camc314
Copy link
Contributor Author

camc314 commented Dec 10, 2025

Closing for now, need to think about this more

@camc314 camc314 closed this Dec 10, 2025
@camc314 camc314 deleted the c/12-03-refactor_linter_rename_visitor.d.ts_to_visitor.ts branch December 10, 2025 12:19
taearls pushed a commit to taearls/oxc that referenced this pull request Dec 11, 2025
…16472)

Use `import type` instead of `import` for type-only imports to follow, TypeScript best practices.

This is also in prepartation for oxc-project#16473 which converts this file to a `.ts` file rather than a declaration file. Using a `.ts` file is an advantage as it means that typescript will actually check it rather than skipping it ([skipLibCheck](https://www.typescriptlang.org/tsconfig/#skipLibCheck))

🤖 generated with help from Claude Opus 4.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST tools 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.

2 participants