Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Suggestion: New rule categories #2759

Closed
andy-hanson opened this issue May 14, 2017 · 2 comments
Closed

Suggestion: New rule categories #2759

andy-hanson opened this issue May 14, 2017 · 2 comments

Comments

@andy-hanson
Copy link
Contributor

The current rule categories are "typescript", "functionality", "maintainability", and "style".

I would propose two new categories:

ban-syntax

These are rules that just ban a particular type of syntax (e.g. the null keyword). I listed these in #2497.

format

These are rules that just affect the layout of code (the many whitespace rules) or particular choice of tokens used (e.g. single or double quotes). If someone were already using a code formatter, they could turn off all of these rules.

These are:

  • typedef-whitespace
  • eofline
  • indent
  • linebreak-style
  • max-line-length
  • trailing-comma
  • align
  • arrow-parens
  • import-spacing
  • jsdoc-format
  • newline-before-return
  • new-parens
  • no-consecutive-blank-lines
  • no-irregular-whitespace
  • no-trailing-whitespace
  • number-literal-format
  • one-line
  • quotemark
  • semicolon
  • whitespace
@andy-hanson
Copy link
Contributor Author

andy-hanson commented May 27, 2017

Instead of ban-syntax I'm thinking there should just be ban, which would include rules like "ban", "ban-type" and "import-blacklist". Whether the banned thing is "syntax" is relevant only to the implementation, and calling it "ban-syntax" would make people think "quotemark" belongs there (which bans a single-quote "syntax").
On the other hand, a rule like "switch-case-fall-through" would "ban" fallthrough, but wouldn't belong in that category. Only rules that ban a particular feature would count, not rules that ban certain ways of using features.

@JoshuaKGoldberg
Copy link
Contributor

It's been quite a while without activity here. Per #4534, closing as aged away.

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

No branches or pull requests

3 participants