-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Update: Implement IndentOuterIIFE option for indent rule (fixes #6259) #6382
Conversation
Thanks for the pull request, @davidshepherd7! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
Thanks for the pull request, @davidshepherd7! I took a look to make sure it's ready for merging and found some changes are needed:
Can you please update the pull request to address these? (More information can be found in our pull request guide.) |
LGTM |
Hi @davidshepherd7, thanks for the pull request! For this change, the commit summary prefix should be "Update:" (we only use "New:" for completely new functionality and we consider a new option in an existing feature an enhancement). Thanks! |
LGTM |
@@ -72,6 +72,7 @@ This rule has an object option: | |||
|
|||
* `"SwitchCase"` (default: 0) enforces indentation level for `case` clauses in `switch` statements | |||
* `"VariableDeclarator"` (default: 1) enforces indentation level for `var` declarators; can also take an object to define separate rules for `var`, `let` and `const` declarations. | |||
* `"IndentOuterIIFE"` (default: true) when false enforces no indentation level increase for file-level IIFEs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need something different here. The other options are all node types, and this is not. Also, we are really talking about indenting the IIFE body, not the IIFE itself, so we need to work on this naming a bit.
LGTM |
@davidshepherd7 can you add some invalid tests, too? |
LGTM |
Ok I've added some invalid tests (and also renamed a function of mine that was inconsistent and rebased onto the current master). |
LGTM |
Lgtm. Thanks @davidshepherd7 for your patience. |
Partly fixes #6259. I've only added support for IIFEs and not for the other forms of full-file closures described here because I don't know much about the other forms.
Some questions for people who know a bit more about eslint:
indent-valid-fixture-1.js
orindent-invalid-fixture-1.js
test files?