Skip to content

Add SCREAMING_SNAKE_CASE to key-format-style rule #137

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
nolde opened this issue Dec 7, 2020 · 0 comments · Fixed by #257
Closed

Add SCREAMING_SNAKE_CASE to key-format-style rule #137

nolde opened this issue Dec 7, 2020 · 0 comments · Fixed by #257
Labels
Type: Feature Includes new features

Comments

@nolde
Copy link

nolde commented Dec 7, 2020

What rule do you want to change?
@intlify/vue-i18n/key-format-style

Does this change cause the rule to produce more or fewer warnings?
Depends.

How will the change be implemented? (New option, new default behavior, etc.)?
New option, slightly changed behaviour (snake_case would stop matching SCREAMING_SNAKE_CASE).

Please provide some example code that this change will affect:
Allow SCREAMING_SNAKE_CASE as an allowed option.

<i18n>
{
  "en": {
    "states": {
      "RUNNING": "Your process is still running.",
      "COMPLETED": "The process has been completed successfully.",
      "FAILED": "The process has failed."
    }
  }
}
</i18n>

What does the rule currently do for this code?
There is no option that differentiates SCREAMING_SNAKE_CASE from common snake_case right now.

What will the rule do after it's changed?
SCREAMING_SNAKE_CASE naming pattern is pretty common for enumerations and other similar constants in JavaScript. By making it different from normal snake_case and allowing independent setting, this pattern can be supported.

Additional context
Google's JavaScript naming conventions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Includes new features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants