vue class component props: Expected indentation of 8 spaces but found 4 indent

440 Views Asked by At

I have vue class component like this

export default class MyText extends Vue {
    @Prop({ type: String, default: 'id-rt' })
    id!: string; // ERROR: Expected indentation of 8 spaces but found 4  indent
}

Should't the @Props and id! have the same indentention???

my eslint.cjs file

"extends": [
    "plugin:vue/essential",
    "eslint:recommended",
    "@vue/eslint-config-typescript/recommended",
],

Whats causing that issue?

Note: If I remove @vue/eslint-config-typescript/recommended from extends then it worked. But I don't want to remove it, only want to disable the indentation issue for @Props

1

There are 1 best solutions below

0
stanko On

You can disable checking for the indentation for the next line with:

// eslint-disable-next-line indent

Or for the whole file:

// eslint-disable indent