question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`outerIIFEBody` option of `indent` for amd style definition

See original GitHub issue

What version of ESLint are you using? 3.1.0 What parser (default, Babel-ESLint, etc.) are you using? default

Please show your full configuration:

{
 "rules": { "indent": ["error", "tab", { "outerIIFEBody": 0 }] }
}

What did you do? Please include the actual source code causing the issue.

define( [
    "foo",
    "bar",
    "baz"
], function( foo, bar, baz ) {

test();

} );

What did you expect to happen? Allow test() to not get indented

What actually happened? Please include the actual, raw output from ESLint. It doesn’t allow test() to not get indented

7:1  error  Expected indentation of 1 tab character but found 0  indent

Needed for jQuery style see https://contribute.jquery.org/style-guide/js/#full-file-closures

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:19 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
TheCycoONEcommented, Jul 18, 2016

This is identical to the goog.scope case, where a particular function executes it’s argument automatically. As far as I know, the only way to detect it would be to have a list of such functions.

1reaction
platinumazurecommented, Sep 19, 2016

Why the first? Seems to me like it should parallel outerIIFEBody and just be about “outermost” function expression assignments.

My suggestion would be to have two options:

  • outerFunctionExpressionAssignment (covers goog.scope and module.exports and similar)
  • outerFunctionExpressionCallParameter (covers define() and similar)

Open to suggestions on the names, of course.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`indent`: `outerIIFEBody` option not using a multiplier, warning ...
indent : outerIIFEBody option not using a multiplier, warning on non-IIFEs? #6585 ... and sometimes means number of indentation levels.
Read more >
indent - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Hanging Indents and Microsoft Word - MLA Style Center
In that settings window is a section titled “Indentation,” which has an option labeled “Special.” Click the drop-down menu beneath Special and ...
Read more >
Formatting a Hanging Indent - Citing Your Sources
Hanging indents are used in the works cited or bibliography of MLA, APA, Chicago, and various other citation styles.
Read more >
Formatting Template Styles changes to indent and numbering
MS Office Professional Plus 2013 MS Word I am setting up ... You must set the indenting for numbered heading styles in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found