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 proposal: name-dialect #2520

Open
Richienb opened this issue Dec 26, 2024 · 2 comments
Open

Rule proposal: name-dialect #2520

Richienb opened this issue Dec 26, 2024 · 2 comments

Comments

@Richienb
Copy link
Contributor

Description

Enforce consistent dialect (Commonweath/British or American) for function and variable names

Fail

When ['error', 'american']:

const myColour = 'red'';

When ['error', 'commonwealth']:

const myColor = 'red'';

Pass

When ['error', 'american']:

const myColor = 'red'';

When ['error', 'commonwealth']:

const myColour = 'red'';

Proposed rule name

name-dialect

Additional Info

No response

@fisker
Copy link
Collaborator

fisker commented Dec 26, 2024

I like the idea, but may it can be done by spellcheck?

@sindresorhus
Copy link
Owner

I think a spellcheck will be too annoying for variable names. It will have too many false-positives and words it doesn't know. It's easier to manually define a list of common spelling inconsistencies. We could reuse the machinery from prevent-abbreviations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants