-
-
Save bhaidar/d92641dea999ad437a28fdb7f61b7de7 to your computer and use it in GitHub Desktop.
ESLint/Prettier config for Vue 3 in VS Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
root: true, | |
env: { | |
browser: true, | |
node: true, | |
}, | |
extends: [ | |
'eslint:recommended', | |
'plugin:vue/vue3-recommended', | |
'prettier' | |
], | |
plugins: ['prettier'], | |
rules: { | |
'prettier/prettier': ['error'], | |
'vue/require-default-prop': 0, | |
'vue/html-indent': ['error', 4], | |
'vue/singleline-html-element-content-newline': 0, | |
'vue/component-name-in-template-casing': ['error', 'PascalCase'], | |
}, | |
globals: { | |
_: true, | |
}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"semi": false, | |
"singleQuote": true, | |
"tabWidth": 4, | |
"printWidth": 120 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ npm install --save-dev prettier @prettier/plugin-php | |
$ npm install --save-dev eslint eslint-plugin-vue eslint-config-prettier eslint-plugin-prettier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// ... | |
"devDependencies": { | |
"@prettier/plugin-php": "^0.17.6", | |
"eslint": "^8.6.0", | |
"eslint-config-prettier": "^8.3.0", | |
"eslint-plugin-prettier": "^4.0.0", | |
"eslint-plugin-vue": "^8.2.0", | |
"prettier": "^2.5.1" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"vetur.validation.template": false, | |
"vetur.format.defaultFormatter.html": "none", | |
// Set the default | |
"editor.formatOnSave": false, | |
// Enable per-language | |
"[javascript]": { | |
"editor.formatOnSave": true | |
}, | |
"[vue]": { | |
"editor.formatOnSave": true | |
}, | |
"[php]": { | |
"editor.formatOnSave": true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment