Skip to content

script-indent broke after updating #407

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

Closed
donnysim opened this issue Feb 24, 2018 · 3 comments
Closed

script-indent broke after updating #407

donnysim opened this issue Feb 24, 2018 · 3 comments

Comments

@donnysim
Copy link

Tell us about your environment

  • ESLint Version: 4.18.1
  • eslint-plugin-vue Version: 4.2.2, 4.3.0
  • Node Version: 8.7.0

Please show your full configuration:

module.exports = {
    parserOptions: {
        parser: 'babel-eslint',
        ecmaVersion: 6,
        sourceType: 'module',
        ecmaFeatures: {
            experimentalObjectRestSpread: true,
        },
    },
    env: {
        browser: true,
    },
    plugins: [
        'vue'
    ],
    extends: [
        'plugin:vue/base',
    ],
    rules: {

    },
    overrides: [
        {
            files: ['*.vue'],
            rules: {
                'indent': 'off',
                'vue/script-indent': ['error', 4, {
                    baseIndent: 1,
                    switchCase: 2,
                }],
            },
        },
    ],
};

What did you do? Please include the actual source code causing the issue.

<script>
    function test() {
        const variable = 0;

        if (variable === 0) {
            console.info('wrong indentation reported');
        }
    }

    test();
</script>

What did you expect to happen?
No errors.

What actually happened? Please include the actual, raw output from ESLint.
On the if line it throws Expected indentation of 26 spaces but found 8 spaces. Everything worked fine until today after updating the package. After downgrading to 4.2.2 the problem still exists so it's a dependency problem?

@qkdreyer
Copy link
Contributor

Using eslint v4.17.0 or v4.18.1

test.js

export default {
  x() {
    const x = 1;
    return x;
  },
};

output :

SublimeLinter: eslint: test.js ['/usr/local/bin/eslint', '--format', 'compact', '--stdin', '--stdin-filename', '@'] 
SublimeLinter: eslint output:
/private/tmp/test.js: line 4, col 1, Error - Expected indentation of 15 spaces but found 4 spaces. (vue/script-indent)

@qkdreyer
Copy link
Contributor

qkdreyer commented Feb 25, 2018

@qkdreyer
Copy link
Contributor

@mysticatea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants