Skip to content

Instantly share code, notes, and snippets.

@bhaidar
Forked from onlime/.eslintrc.js
Created December 5, 2023 15:35
Show Gist options
  • Save bhaidar/d92641dea999ad437a28fdb7f61b7de7 to your computer and use it in GitHub Desktop.
Save bhaidar/d92641dea999ad437a28fdb7f61b7de7 to your computer and use it in GitHub Desktop.
ESLint/Prettier config for Vue 3 in VS Code
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,
},
}
{
"semi": false,
"singleQuote": true,
"tabWidth": 4,
"printWidth": 120
}
$ npm install --save-dev prettier @prettier/plugin-php
$ npm install --save-dev eslint eslint-plugin-vue eslint-config-prettier eslint-plugin-prettier
{
// ...
"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"
}
}
{
"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