I have got an indent error with prettier in .vue files.
How can I disable prettier's indent check in .vue files?
This is my eslint config
.eslintrc.js
module.exports = {
root: true,
env: {
node: true,
},
plugins: ['prettier'],
extends: [
'plugin:vue/vue3-essential',
'plugin:prettier/recommended',
'prettier',
'eslint:recommended',
],
parserOptions: {
parser: '@babel/eslint-parser',
},
rules: {
'vue/script-indent': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
},
overrides: [
{
files: ['*.vue'],
rules: {
indent: 'off',
},
},
],
};
This is my prettier config
.prettierrc.js
module.exports = {
trailingComma: 'es5',
tabWidth: 2,
singleQuote: true,
semi: true,
};
I found an answer which works for my config.
Just need to add this code to rules of eslint's config.
'prettier/prettier': [
'error',
{
vueIndentScriptAndStyle: false,
},
],