Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unwanted constant comparisons potentially causing bugs #61654

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

Open
1 task done
ulrichstark opened this issue May 4, 2025 · 0 comments · May be fixed by #61655
Open
1 task done

Unwanted constant comparisons potentially causing bugs #61654

ulrichstark opened this issue May 4, 2025 · 0 comments · May be fixed by #61655
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@ulrichstark
Copy link

Acknowledgement

  • I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.

Comment

I was running npx oxlint src -A all -D const-comparisons to test oxlint and unintentionally discovered some unwanted constant comparisons potentially causing bugs:

if (fileOrDirComponents.length < fileOrDirComponents.length) return false;

: (q1.marker.fileName > q1.marker.fileName ? 1 : -1)

Both conditions will always be false.

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this labels May 6, 2025
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants