Skip to content

Instantly share code, notes, and snippets.

@shibbirweb
Forked from onlime/.eslintrc.js
Created July 21, 2023 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shibbirweb/529577ce5437c6a10953c81308957cc3 to your computer and use it in GitHub Desktop.
Save shibbirweb/529577ce5437c6a10953c81308957cc3 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