sindresorhus/eslint-plugin-unicorn

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Comment is destroyed when autofixing via 'unicorn/prefer-ternary' #1498

Slapbox posted onGitHub

<!-- ✨ Thanks for reporting a bug! ➡️ Please don't ignore this template -->

<!-- 1️⃣ Explain here what's wrong -->

Git diff:

-    if (!bool) {
-      yield call(
-        setOnTop,
-        false
-      );
-    } else {
-      yield call(
-        setOnTop,
-        true,
-        'normal'
-      ); // To see why we include, 'normal,' see here: https://github.com/....
-    }

+    yield !bool
+      ? call(setOnTop, false)
+      : call(
+        setOnTop,
+          true,
+          'normal'
+        );

<!-- 2️⃣ Specify which rule is buggy here and in the title -->

Affected rule: unicorn/prefer-ternary


Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests