Skip to content
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

no-extra-parens: nested ternaries and ternaryOperandBinaryExpressions #310

Open
3 of 4 tasks
erosman opened this issue Apr 2, 2024 · 0 comments
Open
3 of 4 tasks
Labels
enhancement New feature or request

Comments

@erosman
Copy link

erosman commented Apr 2, 2024

Clear and concise description of the problem

ternaryOperandBinaryExpressions: false does not prevent error generation in the following nested ternaries:

/* eslint @stylistic/js/no-extra-parens: ["error", "all", { "ternaryOperandBinaryExpressions": false }] */

const type = item.isSocks ? (item.socks === '5' ? 'socks5' : 'socks4') :
        (item.type === 'auto' ? 'pac' : 'http'); 

Suggested solution

Either of:

  • Update ternaryOperandBinaryExpressions
  • Add a new option

Alternative

No response

Additional context

No response

Validations

Contributes

  • If this feature request is accepted, I am willing to submit a PR to fix this issue
@erosman erosman added the enhancement New feature or request label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant