Open digitalcora opened 4 years ago
Thanks for pointing this out. It was planned to have the ability to generate a config file containing all the available rules. I have to finalize a convenient design for this.
Related, #497 could provide similar introspection about the different rules config options.
@nobodywasishere That's certainly helpful, although won't resolve this issue as-is.
Unless I've missed something, right now it doesn't seem possible to get an overview of all supported rules and their default settings. This makes it difficult to discover rules that are disabled by default, and to decide ahead of time what kind of code style you want to enforce. For example, even if you're in the habit of running
ameba --all
, you might not realizeLineLength
exists.How other linters handle this:
Rubocop has a
default.yml
which defines the default values for all known rules in one place. It has an "inheritance" mechanism so user configuration can start with these settings and override them.Credo has a
gen.config
command-line task that generates a config file containing all known rules and their default settings. This is like copying Rubocop'sdefault.yml
into your project, though the config format is more concise (most rules fit on one line).ESLint has "inheritance" like Rubocop, and comes with a recommended config which is inherited by default when you set up the library with
eslint --init
(this also automatically adds overrides for rules your code currently fails). There is a nice table of all supported rules and whether they are enabled in the recommended config.