Documentation for padded-blocks rule is out of date. #6628
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
documentation
Relates to ESLint's documentation
enhancement
This change enhances an existing feature of ESLint
rule
Relates to ESLint's core rules
Yesterday we spent quite some time figuring out how to correctly configure the
padded-blocks
rule. The problem we faced was that we wanted to disable padding (use optionnever
) for allswitches
,classes
andblocks
.But the documentation doesn't mention the option {blocks:
never
}. It only mentions:"never"
(which applies toblocks
only){switches: "never"}
{classes: "never"}
See docs: https://github.com/eslint/eslint/blob/master/docs/rules/padded-blocks.md
As it's not possible to supply both a String and an object, as parameter, this basically got us confused. :)
Edit: If needed I could make a PR and try to clarify the documentation part.
Additionally, I would have expected that passing in
never
as a String would actually setblocks
,classes
andswitches
, and then the object option should only be used when you want to mix/match the different options... but I assume it's the way it is because the additional options were added after the initial rule was already created?The text was updated successfully, but these errors were encountered: