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

Update: Implement IndentOuterIIFE option for indent rule (fixes #6259) #6382

Merged
merged 5 commits into from
Jun 28, 2016

Conversation

davidshepherd7
Copy link
Contributor

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:

  • Do I need to add anything to the indent-valid-fixture-1.js or indent-invalid-fixture-1.js test files?
  • Any thoughts on the option name?
  • There are some crazy ways of writing IIFEs, should we support them all?

@eslintbot
Copy link

Thanks for the pull request, @davidshepherd7! I took a look to make sure it's ready for merging and found some changes are needed:

  • The commit summary needs to begin with a tag (such as Fix: or Update:). Please check out our guide for how to properly format your commit summary and update it on this pull request.
  • Pull requests with code require an issue to be mentioned at the end of the commit summary, such as (fixes #1234). Please update the commit summary with an issue (file a new issue if one doesn't already exist).

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

@eslintbot
Copy link

Thanks for the pull request, @davidshepherd7! I took a look to make sure it's ready for merging and found some changes are needed:

  • Pull requests with code require an issue to be mentioned at the end of the commit summary, such as (fixes #1234). Please update the commit summary with an issue (file a new issue if one doesn't already exist).

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

@eslintbot
Copy link

LGTM

@platinumazure
Copy link
Member

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!

@eslintbot
Copy link

LGTM

@davidshepherd7 davidshepherd7 changed the title Implement IndentOuterIIFE option for indent rule Update: Implement IndentOuterIIFE option for indent rule Jun 12, 2016
@davidshepherd7 davidshepherd7 changed the title Update: Implement IndentOuterIIFE option for indent rule Update: Implement IndentOuterIIFE option for indent rule (fixes #6259) Jun 12, 2016
@@ -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.
Copy link
Member

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.

@eslintbot
Copy link

LGTM

@nzakas
Copy link
Member

nzakas commented Jun 16, 2016

@davidshepherd7 can you add some invalid tests, too?

@eslintbot
Copy link

LGTM

@davidshepherd7
Copy link
Contributor Author

Ok I've added some invalid tests (and also renamed a function of mine that was inconsistent and rebased onto the current master).

@ilyavolodin
Copy link
Member

LGTM

@nzakas nzakas merged commit 397e51b into eslint:master Jun 28, 2016
@nzakas
Copy link
Member

nzakas commented Jun 28, 2016

Lgtm. Thanks @davidshepherd7 for your patience.

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

Successfully merging this pull request may close these issues.

Option for not indenting the body of closure that wrap entire file
6 participants