Skip to content

[no-base-to-string] doesn't catch toLocaleString #2440

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

Closed
danielnixon opened this issue Aug 30, 2020 · 1 comment · Fixed by #10138
Closed

[no-base-to-string] doesn't catch toLocaleString #2440

danielnixon opened this issue Aug 30, 2020 · 1 comment · Fixed by #10138
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: plugin rule option New rule option for an existing eslint-plugin rule locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@danielnixon
Copy link
Contributor

[no-base-to-string] doesn't catch toLocaleString

Repro

const foo = {};

console.log(foo.toLocaleString());

Expected Result

toLocaleString banned alongside toString

Actual Result

no lint error

@danielnixon danielnixon added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Aug 30, 2020
@bradzacher bradzacher added enhancement: plugin rule option New rule option for an existing eslint-plugin rule and removed triage Waiting for team members to take a look labels Aug 31, 2020
@bradzacher
Copy link
Member

bradzacher commented Aug 31, 2020

This was just never added to the rule.
Happy to accept a PR!

This will need some thorough testing as I'm not sure how good the type definitions are with this method - there are already mis-defined cases for toString, so I'd assume there are more gaps for toLocaleString

@JoshuaKGoldberg JoshuaKGoldberg added the accepting prs Go ahead, send a pull request that resolves this issue label Oct 25, 2021
@github-actions github-actions bot added the locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. label Oct 29, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 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 enhancement: plugin rule option New rule option for an existing eslint-plugin rule locked due to age Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing. package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
3 participants