antfu / eslint-config

Anthony's ESLint config preset
https://eslint-config.antfu.me/
MIT License
3.41k stars 400 forks source link

no-cond-assign seems to have except-parens disabled and turning them back on throws linting errors. #467

Closed m-shum closed 2 months ago

m-shum commented 2 months ago

Describe the bug

no-cond-assign rule has an except-parens option. This appears to be disabled in this config, which means code like this: while ((m = regex.exec(str)) !== null) throws lint errors.

I have tried enabling it using'no-cond-assign': ['error', 'except-parens'], but the config auto-changes this to 'no-cond-assign': ['error', {'except-parens': true}], which also throws a lint error as it's incorrect syntax.

Reproduction

https://stackblitz.com/edit/github-lzpjei-ccwgoe?file=.vscode%2Fsettings.json,app.vue,eslint.config.js

System Info

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M2
    Memory: 101.30 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
    npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
  Browsers:
    Chrome: 124.0.6367.118
    Safari: 17.4.1

Used Package Manager

npm

Validations

antfu commented 2 months ago

Thank you for submitting the issue!

However, please also note that this is only a shared config where we can only make sure the default and recommended configs are working fine. We don't have the bandwidth to deal with custom configuration or rules conflicts. If you believe it's a bug in the rules, please create an issue to upstream plugins instead.

Thus, I am converting this to a discussion for now.