prettier / eslint-plugin-prettier

ESLint plugin for Prettier formatting
https://npm.im/eslint-plugin-prettier
MIT License
3.33k stars 182 forks source link

Delete `0` eslint(prettier/prettier) #648

Closed 25Das closed 7 months ago

25Das commented 7 months ago

What version of eslint are you using? 8.57.0

What version of prettier are you using? 3.2.5

What version of eslint-plugin-prettier are you using? 5.1.3

Please paste any applicable config files that you're using (e.g. .prettierrc or .eslintrc files) "eslintConfig": { "extends": [ "plugin:adonis/typescriptApp", "plugin:prettier/recommended" ], "plugins": [ "prettier" ], "rules": { "prettier/prettier": [ "error", { "tabWidth": 1, "endOfLine": "lf", "trailingComma": "all", "semi": false, "singleQuote": true, "useTabs": false, "quoteProps": "as-needed", "bracketSpacing": true, "arrowParens": "always", "printWidth": 80 } ] } },

What source code are you linting? Double decimal digits float numbers

What did you expect to happen? Have a rule to disable and prevent my number from being sliced

What actually happened? I am using prettier + eslint and it keeps deleting zeros from double digits float numbers ending in 0 (10000.00 -> 10000.0). This totally breaks frontend input masks. How to disable this on configuration? I dont want to add a million disable eslint comments through my codebase nor do I want to parse a million different numbers everytime they are used because prettier finds it unecessary and I cant find a rule to disable.

BPScott commented 7 months ago

This formatting comes from prettier. This plugin doesn't have any opinion about formatting itself, it just passes along prettier's style. If you believe prettier's formatting should be changed then you should open an issue in the prettier repository: https://github.com/prettier/prettier