SonarTS icon indicating copy to clipboard operation
SonarTS copied to clipboard

Rule idea: enforce enum properties' name format

Open stas-vilchik opened this issue 5 years ago • 0 comments

When defining a enum, its properties can be defined using any format, some examples

enum UpperCamelCase {
  FooBar,
  Baz
}

enum CamelCase {
  fooBar,
  Baz
}

enum Caps {
  FOO_BAR,
  BAZ
}

You can imagine even more possible format.

I suggest a rule to enforce a consistent format across the project.

As default value, I suggest to use UpperCamelCase, because it is used in the TypeScript handbook.

stas-vilchik avatar Sep 19 '18 13:09 stas-vilchik