prettier not fixing vue/max-attributes-per-line
See original GitHub issueWhat version of eslint
are you using?
"^4.15.0"
What version of prettier
are you using?
VS Code plugin for prettier/prettier - 1.4.0
What version of eslint-plugin-prettier
are you using?
"^2.6.0"
Please paste any applicable config files that you’re using (e.g. .prettierrc
or .eslintrc
files)
/* .eslintrc */
module.exports = {
root: true,
env: {
browser: true,
node: true
},
parserOptions: {
parser: 'babel-eslint'
},
extends: [
'eslint:recommended',
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/strongly-recommended'
],
// required to lint *.vue files
plugins: [
'prettier',
'vue'
],
// add your custom rules here
rules: {}
}
What source code are you linting?
<!-- example.vue -->
<div class="Cart__top">
<button class="Cart__close t-h5" type="button" @click="closeCart">Close</button>
<div class="Cart__subtotal">
<div class="Cart__subtotalTitle t-h5">Subtotal</div>
<div class="Cart__subtotalPrice t-h1">€150</div>
</div>
</div>
What did you expect to happen?
Output after executing format document
command in vs code, line 3 would be formatted such that each attribute on the button element would be on a new line. I could be making a wrong assumption that my vs code prettier extension would make use of these settings, that prettier would ever do this, or that this is even the right place to post this??
What actually happened? No formatting of the attributes occurred.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:19 (4 by maintainers)
To fix this issue, you should disable the
vue/max-attributes-per-line
rule since it seems like it conflicts with howprettier
attempts to style your code.Disabling prettier for Vue project, tired researching on the fix…