Created
August 30, 2021 21:37
-
-
Save onlime/4025b7535550b7a31c75f3ff89f926c5 to your computer and use it in GitHub Desktop.
Configure ESLint and Prettier for Vue/Nuxt.js project 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, | |
}, | |
parserOptions: { | |
parser: '@babel/eslint-parser', | |
requireConfigFile: false, | |
}, | |
extends: [ | |
'@nuxtjs', | |
'plugin:nuxt/recommended', | |
'prettier' | |
], | |
plugins: ['prettier'], | |
rules: { | |
'prettier/prettier': ['error'], | |
'vue/html-indent': ['error', 4], | |
'vue/singleline-html-element-content-newline': 0, | |
'vue/component-name-in-template-casing': ['error', 'PascalCase'], | |
'vue/valid-v-slot': [ | |
'error', | |
{ | |
allowModifiers: true, | |
}, | |
], | |
}, | |
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
# Ignore artifacts: | |
build | |
coverage |
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
{ | |
"devDependencies": { | |
"@babel/eslint-parser": "^7.15.0", | |
"@nuxtjs/eslint-config": "^6.0.1", | |
"@nuxtjs/eslint-module": "^3.0.2", | |
"eslint": "^7.32.0", | |
"eslint-config-prettier": "^8.3.0", | |
"eslint-plugin-nuxt": "^2.0.0", | |
"eslint-plugin-prettier": "^3.4.0", | |
"eslint-plugin-vue": "^7.15.1", | |
"prettier": "^2.3.2" | |
} | |
} |
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.format.defaultFormatter.html": "none", | |
// Set the default | |
"editor.formatOnSave": false, | |
// Enable per-language | |
"[javascript]": { | |
"editor.formatOnSave": true | |
}, | |
"[vue]": { | |
"editor.formatOnSave": true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment