Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

number-literal-format fix strips significant zeros #4855

Closed
rgant opened this issue Sep 12, 2019 · 2 comments · Fixed by #4856
Closed

number-literal-format fix strips significant zeros #4855

rgant opened this issue Sep 12, 2019 · 2 comments · Fixed by #4856

Comments

@rgant
Copy link
Contributor

rgant commented Sep 12, 2019

Bug Report

  • TSLint version: 5.13.0
  • TypeScript version: 3.4.5
  • Running TSLint via: yarn test

Reproduction using TSLint Playground

TypeScript code being linted

const rate = 0.022000;

with tslint.json configuration:

{
    "extends": ["tslint:recommended"],
    "rules": {
        "number-literal-format": true
    } // add additional rules and their configuration
}

Actual behavior

- const rate = 0.022000;
+ const rate = 22000;

Expected behavior

- const rate = 0.022000;
+ const rate = 0.022;

Working branch for future pull request: https://github.com/rgant/tslint/tree/bugfix/number-literal-format-fix

@rgant
Copy link
Contributor Author

rgant commented Sep 12, 2019

I did confirm that the current version of tslint has the bug I mentioned in #4496

@rgant rgant changed the title number-literal-format fix fails on 0.022000 number-literal-format fix strips significant zeros Sep 12, 2019
@JoshuaKGoldberg
Copy link
Contributor

🤖 Beep boop! 👉 TSLint is deprecated 👈 and you should switch to typescript-eslint! 🤖

🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋

@palantir palantir locked and limited conversation to collaborators Sep 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants