[prefer-nullish-coalescing] request for ternary support #4905
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
enhancement: plugin rule option
New rule option for an existing eslint-plugin rule
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
The following cases can all be converted to
foo ?? 'a string'
.This is even hinted at in the docs, but sadly currently not covered.
typescript-eslint/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md
Lines 9 to 17 in da48527
Supporting
foo ? foo : 'a string'
would create conflicts withno-unneeded-ternary
which is why I'm against doing so.I can have a look at creating a PR if there is interest for this.
The text was updated successfully, but these errors were encountered: