sindresorhus/eslint-plugin-unicorn

`no-nested-ternary` conflicts with `prettier`

Open

#2,604 创建于 2025年3月23日

在 GitHub 查看
 (1 评论) (6 反应) (0 负责人)JavaScript (5,022 star) (468 fork)user submission
docsgood for beginnerhelp wanted

描述

I started getting ESLintCircularFixesWarning in my ESLint logs after tweaking the config.

I found out it was related to unicorn/no-nested-ternary:

error Nest ternary expression should be parenthesized unicorn/no-nested-ternary

I originally thought it was a conflict with eslint/no-nested-ternary as mentionned in the documentation but while investigating it looks related to prettier:

Delete )eslint(prettier/prettier)

I could not find a way to fix this issue and found another mention os this issue in the Prettier repo which ended up disabling the Unicorn rule:

https://github.com/prettier/eslint-config-prettier/issues/110

Is there a way to fix this conflict? otherwise, should there be a mention about this conflict in the documentation to save troubleshooting time?

贡献者指南

`no-nested-ternary` conflicts with `prettier` · sindresorhus/eslint-plugin-unicorn#2604 | Good First Issue