-
I am using prettier + eslint and it keeps deleting zeros from double digits float numbers ending in 0 (10000.00 -> 10000.0). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
👋 @25Das! The suggested way of integrating Prettier and ESLint is via https://www.npmjs.com/package/eslint-plugin-prettier. This essentially turns off all ESLint rules that may conflict with Prettier output. If you do need to format decimals somewhere (e.g. in a list of test cases or in seed data), adding // prettier-ignore
const myValue = 10000.00; If you want to keep double digits in the entire codebase, Prettier might not be the right option for you (unless you want to fork it). See also: #5287 |
Beta Was this translation helpful? Give feedback.
👋 @25Das! The suggested way of integrating Prettier and ESLint is via https://www.npmjs.com/package/eslint-plugin-prettier. This essentially turns off all ESLint rules that may conflict with Prettier output.
If you do need to format decimals somewhere (e.g. in a list of test cases or in seed data), adding
// prettier-ignore
is the way to go:Playground
If you want to keep double digits in the entire codebase, Prettier might not be the right option for you (unless you want to fork it). See also: #5287