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.

Rule change request: indent: allow "off" for "outerIIFEBody"

See original GitHub issue

What rule do you want to change? indent

Does this change cause the rule to produce more or fewer warnings? Fewer warnings when applied (but the default behavior would be the same)

How will the change be implemented? (New option, new default behavior, etc.)? New option, default behavior unchanged

Several options for the indent rule accept the string "off" to disable the check and let the user do it however they want. But a few of them do not, such as "outerIIFEBody". I would like to be able to set "outerIIFEBody" to "off". Currently I have to choose between 0 or 1 but both choices enforce something, and I don’t want to enforce anything.

Also, I find it curious that several of the options support the "off" setting but only "outerIIFEBody" and a few others don’t.

Please provide some example code that this change will affect:

// File 1
(function() {
    a();
)();

// File 2
(function() {
b();
)();

What does the rule currently do for this code? One of the files will cause a warning, depending whether I choose 0 or 1 for the "outerIIFEBody" rule.

What will the rule do after it’s changed? With the "off" option, eslint would not give a warning for any of those cases, while still checking the other indentation rules for the other options.

Are you willing to submit a pull request to implement this change? Sadly I don’t have time for this at the moment…

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
mdjermanoviccommented, Nov 6, 2019

Accepted now.

2reactions
platinumazurecommented, Feb 11, 2019

I’ll support this. Definitely makes sense to support turning off indentation enforcement in this area for consistency.

Read more comments on GitHub >

github_iconTop Results From Across the Web

indent - ESLint - Pluggable JavaScript Linter
"outerIIFEBody" (default: 1) enforces indentation level for file-level IIFEs. This can also be set to "off" to disable checking for file-level IIFEs.
Read more >
indent - Rule
Rule : indent. Enforces indentation with tabs or spaces. Rationale. Using only one of tabs or spaces for indentation leads to more consistent...
Read more >
eslint-config-ash-nazg - npm
indent - While it may take some getting used to, 2 spaces does allow more in one's field of vision. However, changed to...
Read more >
强制使用一致的缩进(indent) - ESLint
两个空格,不要tab: Google、npm、Node.js、Idiomatic、Felix; Tabs: jQuery; tab:jQuery; Four spaces: Crockford; 四个空格:Crockford. Rule Details.
Read more >
eslint | Yarn - Package Manager
"off" or 0 - turn the rule off; "warn" or 1 - turn the rule on as a warning (doesn't affect exit code);...
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