fisker Cheung
fisker Cheung
https://github.com/DmitrySoshnikov/regexp-tree/issues/237
This kind of like short circuit ```js foo && bar(); ``` But I prefer ```js if (foo) { bar(); } ``` So I prefer the ternary version, but I use...
ONE benefit in werid JavaScript world. ```js ({...(document.all && {foo: 1})}) // VS ({...(document.all ? {foo: 1} : undefined)}) ``` Just kidding.
> this rule only work when the variable name is the same as the property name. I don't think so, the name doesn't matter. Spread any falsely value in object...
The cache feature currently only available in CLI, no api for it.
```js throw new TypeError("Expect 'text' to be a string, got 'undefined'.") ```
**Prettier pr-8647** [Playground link](https://deploy-preview-8647--prettier.netlify.app/playground/#N4Igxg9gdgLgprEAuEALARgZwAYB1fbYDcuUqMAtgDZ4HEgA0IEADjAJbSbKgCGATvwgB3AAoCE3FLyrDeAT25N0-XmADWcGAGUWa9lADmyGPwCucJnAro4AEzv2AMryNnehuADEI-CrxgOI2QQXjMYCEY0SioAdVR2eEw9MDhtSUT2ADdE+RCwTCUQA0w4fhhRVUN-ZAAzGVKmACtMAA8AIVUNLW1eCjgnAzg6hssQFtbtA0MqOABFMwh4EapGkD1+Uv4Q9F5bKiiWfgMYWPY7GFRkAA4ABiYjiFLY1RYQo7gtrOGmAEdF+CVVhSUKYAC0UDg9nsUX4cH+7DhlQ8NSQ9VWY1KFHYJnMmOmswWS2GaNGTBgezOFyuSAATOTVOwqNMAMIQCiokCfACsUTMpQAKnspOi1lkLABJKCOWDaMDHNgAQWl2hg8lmK1KAF8tUA) ```sh --parser babel ``` **Input:** ```jsx hbs`\``; html`\``; ``` **Output:** ````jsx hbs```; html`\``; ````
**Prettier pr-8647** [Playground link](https://deploy-preview-8647--prettier.netlify.app/playground/#N4Igxg9gdgLgprEAuEALARgZwAYBJgCGAvtgNwA6UqMAtgDZ6EmkgA0IEADjAJbSbJQBAE7CIAdwAKIhAJQE64ggE8B7dMIJgA1nBgBlTlp5QA5shjCArnHZwa6OABMnzgDIEzVgqbgAxCGEaAhheM2QQAisYCDY0WjoAdVQeeEwjMDh9WVSeADdU5QiwTDUQE0w4YRhJTVNg5AAzBUr2ACtMAA8AIU0dPX0CGjg3EzgmltsQDs79E1M6OABFKwh4CbpWkCNhSuEI9AJHOjjOYRMYRJ4nGFRkAA4ABnYziErEzU4Is7g9vPH2ABHVbwWpcOSRTAAWigcGczjiwjgwJ4SNqPgaSGamymlRoPAs1lx80WKzW4yxk3YMCOVxudyQACZqZoeHR5gBhCA0TEgX4AVjiVkqABUjnJsVs8jYAJJQVywfRgc7cACC8v0MGUiw2lSIRCAA) ```sh --parser babel ``` **Input:** ```jsx hbs`${a}`; html`${a}`; ``` **Output:** ```jsx hbs``; html`${a}`; ```
@axetroy I simplified the rule only check `index < 0`, `index >= 0`, `index > -1`. I think it's enough, what do you think?
I hope we have a separate rule to forbid `.reverse()`, but allow `ExpressionStatement`. ```js // Only exception array.reverse(); // ✅ [...array].reverse(); // ❌ array.reverse()[0]; // ❌ ``` Same for `.sort()`...