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

Indent autofix does't fix everything #5078

Closed
ilyavolodin opened this issue Jan 26, 2016 · 1 comment
Closed

Indent autofix does't fix everything #5078

ilyavolodin opened this issue Jan 26, 2016 · 1 comment
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules

Comments

@ilyavolodin
Copy link
Member

Here's a small repro case:

Original code:

/* eslint indent: [2, 4] */
var a = b.extend(
{
    test: function() {
        console.log("test");
    }
});

Will report the following:

  3:1  error  Expected indentation of 4 space characters but found 0  indent
  4:2  error  Expected indentation of 8 space characters but found 0  indent
  5:3  error  Expected indentation of 4 space characters but found 0  indent
  7:1  error  Expected indentation of 4 space characters but found 0  indent

First attempt at autofixing will result in no error messages and the following code:

/* eslint indent: [2, 4] */
var a = b.extend(
    {
            test: function() {
            console.log("test");
    }
    });

If you run eslint again on the generated code you will get:

  4:10  error  Expected indentation of 8 space characters but found 0  indent
  5:7   error  Expected indentation of 4 space characters but found 0  indent

Running autofix again will result in completely screwed up code:

/* eslint indent: [2, 4] */
var a = b.extend(
    {
                    test: function() {
                console.log("test");
    }
    });

Every consecutive run from there on will only make things worse.

Using ESLint v2.0.0-beta.1

@ilyavolodin ilyavolodin added bug ESLint is working incorrectly rule Relates to ESLint's core rules evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jan 26, 2016
@ilyavolodin
Copy link
Member Author

Closing in favor of #1801

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules
Projects
None yet
Development

No branches or pull requests

1 participant