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

Rule Change: no-obj-calls should support Intl? #16393

Closed
1 task done
sosukesuzuki opened this issue Oct 7, 2022 · 4 comments · Fixed by #16543
Closed
1 task done

Rule Change: no-obj-calls should support Intl? #16393

sosukesuzuki opened this issue Oct 7, 2022 · 4 comments · Fixed by #16543
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules

Comments

@sosukesuzuki
Copy link
Contributor

What rule do you want to change?

no-obj-calls

What change to do you want to make?

Generate more warnings

How do you think the change should be implemented?

A new default behavior

Example code

Intl();
new Intl();

What does the rule currently do for this code?

No errors.

What will the rule do after it's changed?

Error: 'Intl' is not a function

Participation

  • I am willing to submit a pull request to implement this change.

Additional comments

I know Intl isn't defined in ECMA-202. But it is is defined in ECMA-402 that is internationalization API for ECMA-202.
Also it is implemented in both browsers and Node.js, so I think it make sense that no-obj-calls support Intl.

@sosukesuzuki sosukesuzuki added enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules labels Oct 7, 2022
@nzakas
Copy link
Member

nzakas commented Oct 12, 2022

I think this makes sense. Would like some feedback from the rest of the team.

@mdjermanovic
Copy link
Member

The Internationalization API is optional, so a global Intl could be something else. Though, that's unlikely. I don't have a strong opinion. If others think that core rules should treat Intl as a known built-in global, I'll agree.

@snitin315
Copy link
Contributor

This makes sense to me 👍🏻, I suppose rules treat Intl as global when the environment is the browser

@snitin315
Copy link
Contributor

We have 3 👍🏻, marking it as accepted. @sosukesuzuki feel free to send a PR if you are interested.

@snitin315 snitin315 added the accepted There is consensus among the team that this change meets the criteria for inclusion label Nov 7, 2022
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators May 13, 2023
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label May 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants