Skip to content

Instantly share code, notes, and snippets.

@sigwyg
Last active November 22, 2019 03:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sigwyg/d4c3ef520f3cbcd32b101d7135fd82f3 to your computer and use it in GitHub Desktop.
Save sigwyg/d4c3ef520f3cbcd32b101d7135fd82f3 to your computer and use it in GitHub Desktop.
module.exports = {
extends: [
'eslint:recommended',
'@nuxtjs/eslint-config-typescript',
'plugin:vue/recommended',
'plugin:nuxt/recommended',
'plugin:prettier/recommended',
'prettier/vue',
],
plugins: ['vue'],
rules: {
'no-console': 'off',
'prettier/prettier': ['warn'],
'vue/max-attributes-per-line': [
'warn',
{
singleline: 3,
multiline: {
max: 1,
allowFirstLine: false,
},
},
],
},
}
module.exports = {
semi: false,
singleQuote: true,
trailingComma: 'all',
printWidth: 100,
tabWidth: 2,
overrides: [
{
files: ['*.html', '*.css', '*.scss'],
options: {
tabWidth: 4,
},
},
{
files: ['*.vue'],
options: {
parser: 'vue',
},
},
],
}
{
"extends": [
"stylelint-config-standard",
],
"rules": {
"indentation": 2
}
}
{
"editor.formatOnSave": true,
"[vue]": {
"editor.defaultFormatter": "octref.vetur",
},
"vetur.validation.template": false,
"vetur.format.defaultFormatter.scss": "prettier",
"vetur.format.defaultFormatter.css": "none",
"vetur.format.defaultFormatter.js": "prettier",
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "auto"
}
},
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "vue",
"autoFix": true
}
],
"eslint.enable": true,
"eslint.alwaysShowStatus": true,
"eslint.autoFixOnSave": false,
"stylelint.enable": true,
"stylelint.autoFixOnSave": true,
}
@sigwyg
Copy link
Author

sigwyg commented Nov 7, 2019

npm i -D eslint-config-prettier eslint-plugin-prettier prettier

VSCode拡張機能いれたやつ

Required:

  • dbaeumer.vscode-eslint
  • esbenp.prettier-vscode
  • hex-ci.stylelint-plus
  • octref.vetur

Optional:

  • hollowtree.vue-snippets
  • dariofuzinato.vue-peek

@sigwyg
Copy link
Author

sigwyg commented Nov 7, 2019

Stylelintのindentationと、PrettierのtabWidthを切り分けることには失敗。
CSS/SCSSのインデントだけ4とかできなかったので、Vueプロジェクトではインデント固定での運用となる(今後の課題)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment