Skip to content

fix(no-deprecated): avoid infinite loop on circular alias chains - #1309

Merged
camc314 merged 1 commit into
oxc-project:mainfrom
magurotuna:fix/no-deprecated-circular-alias
Oct 21, 2026
Merged

camc314 merged 1 commit into
oxc-project:mainfrom
magurotuna:fix/no-deprecated-circular-alias

Conversation

@magurotuna

Copy link
Copy Markdown
Member

no-deprecated never finishes when it checks a name whose alias chain is circular. For example:

// a.ts
export { x } from './a'
oxlint --type-aware -D typescript/no-deprecated a.ts   # hangs forever

The following cases hang too:

  • two files that re-export default from each other
  • a file outside the cycle that imports a name from the cycle

This PR fixes this issue by stopping the alias walk at the first repeated alias, in the same way as isSymbolTypeBased in consistent-type-exports.

typescript-eslint

typescript-eslint has the same loop in packages/eslint-plugin/src/rules/no-deprecated.ts. Version 8.72.0 also hangs on the file above (with a tsconfig.json of {}). I have not reported it there yet.

AI disclosure

I used an AI coding assistant to find the bug, write the change and the tests, run the checks, and draft this description. I reviewed the change, the results, and this text.

@camc314

camc314 commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

typescript-eslint has the same loop in packages/eslint-plugin/src/rules/no-deprecated.ts. Version 8.72.0 also hangs on the file above (with a tsconfig.json of {}). I have not reported it there yet.

please send an issue/PR upstream.

Thanks!

@camc314
camc314 merged commit 086f19a into oxc-project:main Oct 21, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants