Files
cypress/scripts/decaff/__testfixtures__/switch-false.input.js
Kukhyeon Heo 994ab326a0 Decaff helper jscodemods. (#5732)
* Added a file that removes comments that start with #.

* Added .eslintrc to silence ts errors in codemods.

* Convert switch (false) to if-else.

* Add disable-eslint no-empty by default after empty catch.

* Reserve comments when converting switch-case.

* Added new codemods to bulk-decaffeinate.

* Preserve comments.

* Ignored lint rules for test fixtures.

* Move comments between arrow and block to the top.

* Merged tests into one file.

* Turned off no-undef for test fixtures.

* No-cond-assign

* Added jscodemods to decaff config.

* Fixed typo.

* Make CI test codemods

* Added test-no-return.

* Revert "Added test-no-return."

This reverts commit d610829e957e38a6d56c19ba2219681e3f6c65ec.

* fix arrow-comment


Co-authored-by: Ben Kucera <14625260+Bkucera@users.noreply.github.com>
Co-authored-by: Zach Bloomquist <github@chary.us>
2019-12-06 17:43:20 -05:00

34 lines
554 B
JavaScript

function f () {
switch (false) {
// Comment should be reserved
case !a.subject(a):
let x = 30
b.doSomething(x)
break
// Multi line comment
// should be reserved
case c.isGood:
c.checkThisOut()
findThings()
break
case isBad:
c.neverCheck()
break
case !isAwesome:
a.subject(a)
break
case hi:
// This should be reserved, too
return 3
case you:
// This comment is preserved
break
default:
b.goToNext()
break
}
}
f()