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.

Add validateIndentation

See original GitHub issue

My team uses 4 spaces per indentation. It would be nice to have a linter to check that indentation is correct. Something along the lines of the following (with suggested defaults):

validateIndentation

syntax

"validateIndentation": {
  "enabled": true,
  "style": "spaces",
  "quantity": 4
}

options

style (string)

  • spaces (default)
  • tabs

quantity (integer) number of spaces/tabs per indentation

  • 2 (default)
  • user defined value

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:9
  • Comments:17 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
kokarncommented, Sep 23, 2015

I recently got a file that looks something like this

.class {
    property: value;

    next-property: value;

    .otherClass {
          property: value;
    }

    third-property: value;
}

Maybe newlines and all properties on top should be in this linter as well? Or separate?

0reactions
jwilssoncommented, Oct 24, 2017

@kaiyoma Yes, I’m afraid this is the closest we are. If you got the time and are willing, a PR for this would be greatly appreciated!

Read more comments on GitHub >

github_iconTop Results From Across the Web

validateIndentation rule - JSCS
validateIndentation. Validates indentation for switch statements and block statements. Types: Integer , String or Object. Values:.
Read more >
validateIndentation doesn't expect indentation on method ...
fix incoming tomorrow. Basically, all callExpression indentation validation is being removed and added to a separate rule. It was tacked on to ...
Read more >
Expected indentation of 4 characters - node.js - Stack Overflow
If you want to have an indentation of 2 spaces, you should change "validateIndentation": 4, to "validateIndentation": 2,.
Read more >
jscs | Yarn - Package Manager
... jQuery : add validateIndentation rule (Oleg Gaidarenko) ... Preset: Add validate indentation rule for Yandex (Gunnar Lium); Preset: node-style-guide ...
Read more >
Perfect code, zero effort - Gleb Bahmutov
Here is how to have perfectly styled JavaScript code with zero effort. Add JavaScript Code Style to your project npm install --save-dev jscs ......
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