Skip to content

rules vue/script-indent unexpected error report while force using semicolon #443

Closed
@noe132

Description

@noe132

code
tim 20180325184012
when using semicolon, it reports invalid indentation.
while remove the semi, indentation is valid, but it reports semi missing.
tim 20180325184134

minimal reproduce repo https://github.com/noe132/eslint-plugin-vue-test

Tell us about your environment

  • ESLint Version: 4.19.1
  • eslint-plugin-vue Version: 4.4.0
  • Node Version: 8.8.1

Please show your full configuration:

// http://eslint.org/docs/user-guide/configuring
module.exports = {
  parserOptions: {
    sourceType: 'module',
  },
  env: {
    browser: true,
  },
  extends: [
    'plugin:vue/essential',
  ],
  plugins: [
    'vue'
  ],
  rules: {
    'vue/script-indent': ['error', 2, {
      'baseIndent': 1,
      'switchCase': 0,
      'ignores': []
    }],
    'semi': ['error', 'always'],
  },
}

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

<template>
  <div class="">
  </div>
</template>

<script>
  export default {
    name: 'Test',
    methods: {
      testMethod() {
        Promise.resolve()
          .then(() => {
            // SOME CODE HERE
          })
      },
    },
  };
</script>

What did you expect to happen?
linting good with no error

What actually happened? Please include the actual, raw output from ESLint.

λ  yarn eslint .\index.vue
yarn run v1.3.2
$ C:\Users\noe\src\eslint-plugin-vue-test\node_modules\.bin\eslint .\index.vue

C:\Users\noe\src\eslint-plugin-vue-test\index.vue
  13:1  error  Expected indentation of 10 spaces but found 12 spaces  vue/script-indent
  14:1  error  Expected indentation of 8 spaces but found 10 spaces   vue/script-indent

✖ 2 problems (2 errors, 0 warnings)
  2 errors, 0 warnings potentially fixable with the `--fix` option.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions