Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance padding-line-between-statements with "iife" statement type #10853

Closed
platinumazure opened this issue Sep 11, 2018 · 2 comments
Closed
Assignees
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

Comments

@platinumazure
Copy link
Member

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:

/* eslint padding-line-between-statements: [error, [{ blankLine: "always", prev: "iife", next: "*" }]] */

// IIFE example:

(function() {
}());
foo();

// Other block-like:

if (true) {
}
foo();

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.

@platinumazure platinumazure added enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Sep 11, 2018
@platinumazure platinumazure self-assigned this Sep 11, 2018
@platinumazure
Copy link
Member Author

Working on this.

@kaicataldo kaicataldo added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Oct 4, 2018
@kaicataldo
Copy link
Member

This has now been accepted.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Apr 11, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Apr 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Projects
None yet
Development

No branches or pull requests

2 participants