Simplify expression call inside falling through case
Open
enhancement
- Dominant language
- JavaScript
- Stars
- 4.4k
- Forks
- 217
- PR merge metrics
- No merged PRs in 30d
Description
It is a feature request.
Currently this code sample
```js
function bar(foo) {
switch (foo) {
case 'foo':
log(a);
log(b);
log(c);
case 'bar':
return 2;
default:
return 0;
}
}
```
converted to
```js
function bar(foo) {
switch (foo) {
case 'foo':
log(a), log(b), log(c);
case 'bar':
return 2;
default:
return 0;
}
}
```
that could rather be converted to
```js
function bar(foo) {
return foo === 'foo' || foo === 'bar' ? (log(a), log(b), log(c), 2) : 0;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.