helixbass / eslint-plugin-coffee

ESLint rules for linting Coffeescript source files
MIT License
24 stars 2 forks source link

loop invalid? #53

Closed edemaine closed 3 years ago

edemaine commented 3 years ago

loop seems to always trigger coffee/no-constant-condition. Presumably this case should be allowed?

A workaround is to use the configuration

rules:
  coffee/no-constant-condition:
    - error
    - checkLoops: false

which is what I used for no-constant-condition, but I expected the coffee/ version to do this for me.

helixbass commented 3 years ago

Ok looking at https://github.com/helixbass/eslint-plugin-coffee/blob/master/src/tests/rules/no-constant-condition.coffee#L124 I seem to have intentionally chosen for loop to get triggered by coffee/no-constant-condition (I vaguely remembering thinking about this)

But ya I buy that at least the default behavior should be that loop doesn't trigger this rule

So I will plan on putting up a fixing PR when I get a chance

helixbass commented 3 years ago

Ok updated so that loop doesn't trigger coffee/no-constant-condition

You can test this out via:

yarn add --dev github:helixbass/eslint-plugin-coffee#eslint-plugin-coffee-v0.1.15-dev.4-gitpkg

I believe that the issue you encountered with jsx-no-target-blank is the last unresolved issue from what you've posted, so per my comment in #51 if you share a snippet that causes a crash with that rule I'm happy to look into that. And then I can plan on releasing a beta/full version including these changes

edemaine commented 3 years ago

Confirming that loop no longer generates errors for me. Thanks!