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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent-abbreviations: Ignore i18n and l10n #1445

Merged
merged 4 commits into from
Jul 31, 2021
Merged

prevent-abbreviations: Ignore i18n and l10n #1445

merged 4 commits into from
Jul 31, 2021

Conversation

theoludwig
Copy link
Contributor

Hey 馃憢,

This PR fixes #1188
It ignores the i18n keyword for the prevent-abbreviations rule, as it is well-known and popular enough.

I also like the idea of, explicit > implicit, but sometimes, things are done like that, so we can relax a bit the rule.

@@ -96,6 +96,10 @@ const getNameReplacements = (name, options, limit = 3) => {
return {total: 0};
}

if (name.includes('i18n')) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not be hard-coded directly here. There should be an internal list like allowList that is checked in the above if-statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!
I added i18n and l10n to defaultAllowList.

But we should probably move it to defaultReplacements, because something like const i18nData = {} will not work, and it will still suggests to refactor it to index18nData but that's wrong.

What do you think ? 馃槃

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's known #752, you'll have to use ignore option for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, so I added defaultIgnore, should we also, add a new option, extendDefaultIgnore ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, so I added defaultIgnore, should we also, add a new option, extendDefaultIgnore ?

Nah. We can add it when it's needed. I see no reason to not want these ignores.

@fisker
Copy link
Collaborator

fisker commented Jul 26, 2021

Let's ignore l10n too?

@sindresorhus sindresorhus changed the title fix(prevent-abbreviations): relax rule, ignore i18n prevent-abbreviations: Ignore i18n and l10n Jul 29, 2021
@sindresorhus sindresorhus requested a review from fisker July 29, 2021 12:17
@sindresorhus sindresorhus merged commit efdd90e into sindresorhus:main Jul 31, 2021
@theoludwig theoludwig deleted the fix/ignore-i18n-prevent-abbrevations branch August 11, 2021 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

prevent-abbrevations and i18n
3 participants