-
-
Notifications
You must be signed in to change notification settings - Fork 689
Closed
Labels
Description
Checklist
- I have tried restarting my IDE and the issue persists.
- I have read the FAQ and my problem is not listed.
Tell us about your environment
- ESLint version: ^8
- eslint-plugin-vue version: ^9
- Vue version: ^3.4
- Node version: ^20
- Operating System: macos
Please show your full configuration:
module.exports = {
root: true,
plugins: ["eslint-plugin-vue"],
extends: [
"plugin:@typescript-eslint/recommended",
"@vue/typescript/recommended",
"@vue/eslint-config-typescript/recommended",
"@vue/eslint-config-prettier",
"@vue/eslint-config-prettier/skip-formatting",
],
env: {
browser: true,
es6: true,
},
parser: "vue-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
ecmaVersion: "latest",
sourceType: "module",
},
}
module.exports = {
extends: ["plugin:vue/vue3-recommended"]
};
What did you do?
Trying to rid off the warning: Expected indentation of 32 spaces but found 30 spaces.eslint[vue/html-indent](https://eslint.vuejs.org/rules/html-indent.html)
VSCode + Prettier version
<a
:href="
!currentAccount && currentVenue.device_id
? '/' + currentVenue.device_id
: !currentAccount && currentVenue.display_device_id
? '/' + currentVenue.display_device_id
: '/' + currentVenue.venue_id
"
>
ESLint + vue/html-indent version:
<a
:href="
!currentAccount && currentVenue.device_id
? '/' + currentVenue.device_id
: !currentAccount && currentVenue.display_device_id
? '/' + currentVenue.display_device_id
: '/' + currentVenue.venue_id
"
>
Another Sample:
Prettier:
<span
v-if="
newClipForm?.approved_log.user_id &&
newClipForm.clip_status === TVClipStatus.TVClipStatusApproved
"
>
vs ESLint
<span
v-if="
newClipForm?.approved_log.user_id &&
newClipForm.clip_status === TVClipStatus.TVClipStatusApproved
"
>
What did you expect to happen?
- add option to force them work the same way
- add this useCase to documentation of this rule and describe how to fix it or go around
- remove from recommended rules, since everybody uses prettier today
And two additional questions:
- If I need to choose for prettier vs html-indent - which you advise me?
- What is the best to make them work together? I don;t know how to partially disable prettier without inlint-comments