Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔪 Deprecate no-loss-of-precision rule extension #7277

Closed
JoshuaKGoldberg opened this issue Jul 20, 2023 · 4 comments
Closed

🔪 Deprecate no-loss-of-precision rule extension #7277

JoshuaKGoldberg opened this issue Jul 20, 2023 · 4 comments
Labels
accepting prs Go ahead, send a pull request that resolves this issue package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin repo maintenance things to do with maintenance of the repo, and not with code/docs
Milestone

Comments

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Jul 20, 2023

Overview

https://typescript-eslint.io/rules/no-loss-of-precision states that it exists to add support for numeric separators to the base eslint/no-loss-of-precision rule. But, numeric separators have passed stage 3 and are natively supported in ESLint I believe. [Example ESLint playground with the rule working on a number with a numeric separator]

tl;dr: I propose we remove the rule extension because the base rule contains all its features.

👉 I'm not proposing we remove the base rule (or ask ESLint to)

Whether it exists in popular configs such as eslint-config-airbnb-typescript and eslint-config-standard-with-typescript

Sourcegraph queries showing how often it appears in user configs

Sourcegraph query showing it used in <200 repos: this doesn't seem like a particularly common rule for users to explicitly specify. That makes sense to me given that it's in the base recommended config (and has been for a while).

@JoshuaKGoldberg JoshuaKGoldberg added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jul 20, 2023
@JoshuaKGoldberg JoshuaKGoldberg changed the title 🔪 Deprecate no-loss-of-precision 🔪 Deprecate no-loss-of-precision rule extension Jul 20, 2023
@Josh-Cena
Copy link
Member

Interesting—I would have expected this rule to handle numeric type literals!

const a: 9007199254740993 = 9007199254740992; // No error?

@bradzacher bradzacher added repo maintenance things to do with maintenance of the repo, and not with code/docs accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for maintainers to take a look labels Jul 20, 2023
@That-Guy977
Copy link

That-Guy977 commented Sep 24, 2023

@typescript-eslint/no-extra-semi states that it adds support for proposal-class-fields which is also stage 4 and is supported by the base rule as one of its examples.

I'm not familiar enough with the ecosystem here so I haven't made an issue for it, I wouldn't know what details to find and check 😅

@JoshuaKGoldberg
Copy link
Member Author

Ah, the nice thing about no-extra-semi is that it's going to be a part of eslint.style now. So that's less for us to worry about. Good spot!

@JoshuaKGoldberg
Copy link
Member Author

#8832 was merged into the v8 branch. ✅

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin repo maintenance things to do with maintenance of the repo, and not with code/docs
Projects
None yet
Development

No branches or pull requests

4 participants