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

eslint 1.10.3 keeps bugging me about incorrect identation (but it is correct) #4739

Closed
zewish opened this Issue Dec 18, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@zewish
Copy link

zewish commented Dec 18, 2015

I'm not sure if I missed some option in .eslintrc.json, but this is what I get with the following test files:

t.js:

'use strict';

function A() {
    this.a = function() {
        'test';
        'test';
        return 'a';
    };

    this.b = function() {
        return this.a();
    };

    this.c = {
        aa: function() {
            'test1';
            'test1';
            return 'aa';
        }
        , bb: function() {
            return this.bb();
        }
    };
}

module.exports = new A();

.eslintrc.json:

{
    "rules": {
        "indent": [
            1,
            4
        ],
        "quotes": [
            2,
            "single"
        ],
        "linebreak-style": [
            2,
            "unix"
        ],
        "semi": [
            2,
            "always"
        ]
    },
    "env": {
        "es6": false,
        "node": true
    },
    "extends": "eslint:recommended"
}

output:

[wish@wish wish]$ eslint ./t.js 

/home/wish/t.js
  21:13  warning  Expected indentation of 14 space characters but found 12  indent
  22:9   warning  Expected indentation of 10 space characters but found 8   indent

✖ 2 problems (0 errors, 2 warnings)
@ilyavolodin

This comment has been minimized.

Copy link
Member

ilyavolodin commented Dec 18, 2015

Looks like an issue with multiline indent and comma-first style. @gyandeeps could you take a look? I'm sure it's a duplicate of some existing issue.

@gyandeeps

This comment has been minimized.

Copy link
Member

gyandeeps commented Dec 18, 2015

Confirmed, the issue is happening because of the comma first-style.
Somewhat related #3456

@gyandeeps gyandeeps added accepted and removed evaluating labels Dec 18, 2015

@gyandeeps gyandeeps closed this in f8a7d31 Dec 19, 2015

nzakas added a commit that referenced this issue Dec 19, 2015

Merge pull request #4746 from eslint/issue4739
Fix: Comma first issue in `indent` (fixes #4739, fixes #3456)

@eslint eslint bot locked and limited conversation to collaborators Feb 6, 2018

@eslint eslint bot added the archived due to age label Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.