From 8045242d9ca6bf962e3de579a8e9634ce0dfa5ba Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 19 Jun 2020 23:38:38 +0200 Subject: viewer: autoformat using eslint-prettier instead of VSC's integrated formatters --- viewer/.eslintrc.js | 9 ++++----- viewer/package.json | 2 ++ viewer/visualstudio.code-workspace | 19 +++++++++++++++---- 3 files changed, 21 insertions(+), 9 deletions(-) (limited to 'viewer') diff --git a/viewer/.eslintrc.js b/viewer/.eslintrc.js index a67de5e..9d3fbbc 100644 --- a/viewer/.eslintrc.js +++ b/viewer/.eslintrc.js @@ -5,14 +5,14 @@ module.exports = { node: true, }, - extends: [ - "plugin:vue/essential", - "@vue/typescript" - ], + plugins: ["prettier"], + + extends: ["plugin:vue/essential", "plugin:prettier/recommended", "@vue/typescript"], rules: { "no-console": "off", "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off", + "prettier/prettier": "warn", "eol-last": ["warn", "always"], "object-curly-spacing": ["warn", "always"], "quote-props": ["warn", "as-needed"], @@ -36,5 +36,4 @@ module.exports = { sourceType: "module", parser: "@typescript-eslint/parser", }, - }; diff --git a/viewer/package.json b/viewer/package.json index d1bb5a2..cd5191d 100644 --- a/viewer/package.json +++ b/viewer/package.json @@ -43,6 +43,8 @@ "@vue/cli-service": "^4.2.3", "@vue/eslint-config-typescript": "^5.0.2", "eslint": "^6.8.0", + "eslint-config-prettier": "^6.11.0", + "eslint-plugin-prettier": "^3.1.4", "eslint-plugin-vue": "^6.2.2", "node-sass": "^4.13.1", "sass-loader": "^8.0.2", diff --git a/viewer/visualstudio.code-workspace b/viewer/visualstudio.code-workspace index 8315cbb..fb23e99 100644 --- a/viewer/visualstudio.code-workspace +++ b/viewer/visualstudio.code-workspace @@ -6,22 +6,33 @@ ], "settings": { "editor.tabSize": 2, - "editor.formatOnSave": true, "editor.wordBasedSuggestions": false, "editor.detectIndentation": false, "files.insertFinalNewline": true, "files.trimFinalNewlines": true, "javascript.format.semicolons": "insert", "typescript.disableAutomaticTypeAcquisition": true, - "vue-i18n-ally.keystyle": "flat", - "vue-i18n-ally.localesPaths": "src/locales", "i18n-ally.localesPaths": "src/locales", + // --- + // Autoformating is done with eslint-prettier + "eslint.enable": true, + "eslint.onIgnoredFiles": "warn", + "vetur.format.enable": false, + "javascript.format.enable": false, + "typescript.format.enable": false, + "html.format.enable": false, + "eslint.format.enable": false, + "editor.formatOnSave": false, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true, + }, + // --- }, } // Recommended Visual Studio Code extensions: // - Vetur // - ESLint -// - Vue i18n Ally +// - i18n Ally // - SCSS Everywhere // - SCSS Formatter // - Debugger for Chrome -- cgit v1.2.3