Skip to content

explicit-length-check: add autofix for .length <= 0 to .length === 0 #2659

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
Alex-Sokolov opened this issue May 27, 2025 · 0 comments
Open

Comments

@Alex-Sokolov
Copy link

Alex-Sokolov commented May 27, 2025

Description

explicit-length-check currently doesn't suggest autofix for .length <= 0 which could be simplified to .length === 0. Faced with this cases when start using https://github.com/azat-io/eslint-plugin-de-morgan

Examples

// ❌
if (array.length <= 0) {

// ✅
if (array.length === 0) {

Additional Info

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant