Enhance padding-line-between-statements with "iife" statement type #10853
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
enhancement
This change enhances an existing feature of ESLint
rule
Relates to ESLint's core rules
What rule do you want to change?
padding-line-between-statements
Does this change cause the rule to produce more or fewer warnings?
Either way, depending on configuration. Does not produce more warnings by default as it is a new option.
How will the change be implemented? (New option, new default behavior, etc.)?
New statement type option: "iife".
Please provide some example code that this change will affect:
What does the rule currently do for this code?
Nothing (well, schema error).
Currently, it is possible to use the "block-like" statement type, but that will also cover IfStatement, WhileStatement, DoWhileStatement, ForStatement, other function declarations, etc., meaning the second example would also be enforced. It is not possible to target just IIFEs.
What will the rule do after it's changed?
Users can target IIFEs as previous or next statements in the rule.
N.B. The rule already detects IIFEs as part of "block-like", so this addition will be pretty trivial-- the new statement type's "test" would simply be to call the internal IIFE checker.
Inspired by #10843.
I'll champion this.
The text was updated successfully, but these errors were encountered: