Last active
February 21, 2022 03:26
-
-
Save azliabdullah/c558460db243049d1d16a88665906750 to your computer and use it in GitHub Desktop.
Vue/Nuxt Visual Studio Code config to autoformat and autofix without the changes reverted back and produce lint error
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', | |
}, | |
extends: [ | |
'@nuxtjs', | |
'prettier', | |
'prettier/vue', | |
'plugin:prettier/recommended', | |
'plugin:nuxt/recommended', | |
], | |
plugins: ['prettier'], | |
// add your custom rules here | |
rules: { | |
'vue/component-name-in-template-casing': ['error', 'PascalCase'], | |
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', | |
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', | |
}, | |
} |
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
yarn add eslint babel-eslint eslint-config-prettier eslint-plugin-prettier eslint-plugin-vue eslint-loader prettier -D |
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
bare minimum: | |
- vetur | |
- eslint | |
- prettier | |
- stylelint | |
extras: | |
- auto close tag | |
- auto rename tag | |
- vue vscode snippets | |
- tailwind css intellisense | |
applicable to all projects: | |
- material icon theme | |
- bracket pair colorizer 2 | |
- markdown preview enhanced | |
- reveal |
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
// .vscode/settings.json | |
{ | |
"editor.formatOnSave": true, | |
"eslint.alwaysShowStatus": true, | |
"eslint.options": { | |
"extensions": [ | |
".html", | |
".js", | |
".vue", | |
".jsx" | |
] | |
}, | |
"eslint.validate": [ | |
"html", | |
"vue", | |
"javascript", | |
"javascriptreact", | |
], | |
"editor.codeActionsOnSave": { | |
"source.fixAll.eslint": true | |
}, | |
"[javascript]": { | |
"editor.formatOnSave": false | |
}, | |
"eslint.format.enable": true, | |
"css.validate": false, | |
} |
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 = { | |
rules: { | |
'at-rule-no-unknown': [ | |
true, | |
{ | |
ignoreAtRules: [ | |
'tailwind', | |
'apply', | |
'variants', | |
'responsive', | |
'screen', | |
], | |
}, | |
], | |
'declaration-block-trailing-semicolon': null, | |
'no-descending-specificity': null, | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment