prettier / eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with Prettier.
MIT License
5.46k stars 255 forks source link

Does no-floating-decimal still need to be turned off? #138

Closed astorije closed 4 years ago

astorije commented 4 years ago

I see that no-floating-decimal was disabled in v2.6.0 (a while ago!): https://github.com/prettier/eslint-config-prettier/commit/e47c6a6de6c3fae40f561759cb9fab79453db816

However, it seems to me that it doesn't affect Prettier in any way. Do you recall why you turned it off and marked it as conflicting in the checker CLI tool? Is it something we can re-enable nowadays, e.g. it was breaking the parser before?

lydell commented 4 years ago

It doesn’t conflict with Prettier – it’s unnecessary when using Prettier, isn’t it?

astorije commented 4 years ago

Gotcha. Why is it unnecessary? It seems to me Prettier doesn't do anything about those, but I might be missing something.

lydell commented 4 years ago

Here are the examples from https://eslint.org/docs/rules/no-floating-decimal:

Prettier 1.19.1 Playground link

--parser babel

Input:

var num = .5;
var num = 2.;
var num = -.7;

Output:

var num = 0.5;
var num = 2;
var num = -0.7;
astorije commented 4 years ago

Oh wow you are totally right and I am totally wrong ahah. I guess I was testing on a file that had a parsing error or something, and Prettier was not running. Apologies for the noise and thanks for the responses!