I would like that the rule includes a new type of STATEMENT_TYPE to allow a different padding between case statements that are not fallthrough vs the ones that are.
Using the suggestion from the doc [{ blankLine: "always", prev: ["case", "default"], next: "*" }] makes fallthrough cases have a blank lines while it's not always desirable and conflicts with no-fallthrough. (although it does have an option to allow empty case)
Suggested solution
Suggestions :
Adding a fallthrough-case or case-fallthrough statement that targets precisely those statements which have no children (but it could conflict with case)
Making case excluding fallthrough statements (but it would certainly change existing code)
Adding a case-like to support both cases, and then both fallthrough-case and no-fallthrough-case to distinguish
Alternative
I looked for a way to disable the error from eslint, and it was possible with the { "allowEmptyCase": true } option.
Additional context
Personally, I prefer fallthrough statements to be just above other case statements so it's very clear that it does not have an implementation by its own.
Clear and concise description of the problem
I would like that the rule includes a new type of
STATEMENT_TYPE
to allow a different padding betweencase
statements that are not fallthrough vs the ones that are.Using the suggestion from the doc
[{ blankLine: "always", prev: ["case", "default"], next: "*" }]
makes fallthrough cases have a blank lines while it's not always desirable and conflicts with no-fallthrough. (although it does have an option to allow emptycase
)Suggested solution
Suggestions :
fallthrough-case
orcase-fallthrough
statement that targets precisely those statements which have no children (but it could conflict withcase
)case
excluding fallthrough statements (but it would certainly change existing code)case-like
to support both cases, and then bothfallthrough-case
andno-fallthrough-case
to distinguishAlternative
I looked for a way to disable the error from eslint, and it was possible with the
{ "allowEmptyCase": true }
option.Additional context
Personally, I prefer fallthrough statements to be just above other
case
statements so it's very clear that it does not have an implementation by its own.Validations
Contributes