Skip to content

Instantly share code, notes, and snippets.

@kconde2
Forked from onlime/.eslintrc.js
Created January 30, 2023 01:23
Show Gist options
  • Save kconde2/e411f62ddbc7b861eda717b9200067f3 to your computer and use it in GitHub Desktop.
Save kconde2/e411f62ddbc7b861eda717b9200067f3 to your computer and use it in GitHub Desktop.
Configure ESLint and Prettier for Vue/Nuxt.js project in VS Code
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,
},
}
# Ignore artifacts:
build
coverage
{
"semi": false,
"singleQuote": true,
"tabWidth": 4,
"printWidth": 120
}
{
"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"
}
}
{
"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