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.

Information

eslint@1.4.3

.eslintrc

{
  "rules": {
    "indent": [2, 2]
  }
}

JavaScript code: (The first line indent error)

 'use strict';

const detector = {};
const NA_VERSION = '-1';
const rules = require('./rules');

...

eslint result:

$ ./node_modules/.bin/eslint detector.js 

/Users/hotoo/workbench/hotoo/detector/detector.js
    3:1  error  Expected indentation of 1 space character but found 0  indent
    4:1  error  Expected indentation of 1 space character but found 0  indent
    5:1  error  Expected indentation of 1 space character but found 0  indent
    ...

eslint-indent-error

right code:

2015-09-17 11 16 54

Problem

The first line indent error, but I got every following 0 indent line error.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

19reactions
grawlinsoncommented, Jan 5, 2016

Upon further investigation it seems that the problem was within my editor (Atom) entering spaces instead of tabs. Once I set tabType: "hard" in Atom’s config and changed all spaces to tabs, my problems disappeared.

Feel free to close this issue.

18reactions
viktorlarssoncommented, Aug 26, 2016

Had the same issue as @grawlinson and switched to tabType hard and now it works. There is a trick in Atom if you wanna convert spaces to tabs in your current file. Ctrl+shift+p and search for Whitespace, then select Convert spaces to tabs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Cannot fix eslint rule on indenting case statements in switch ...
I googled for a solution and saw suggestions to add both switchCase and indentSwitchCase, but my .eslintrc rules are all - spaced, not...
Read more >
EDITING: Right (after) indent of paragraph does not work in lists
Bug 83532 - EDITING: Right (after) indent of paragraph does not work in ... when the right indentation is moved on the top...
Read more >
Indentation Error in Python | How to Solve it - Edureka
As mentioned in the introduction paragraph, one of the main reasons for the indentation error is the absence of tabs and or whitespaces...
Read more >
79843 - CSS text-indent bug in editable elements - Monorail
1.a textarea or input or something else get contentEditable="true", when set a text-indent rule to it,by default the cursor will appear at 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