From 113bff3c4dcc1976f24df16d4224e1871e665ae0 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Mon, 27 Apr 2020 22:23:10 +0200 Subject: viewer: tabSize, quote-props, quotes, object-curly-spacing --- viewer/.eslintrc.js | 37 +++++++++++++++++++++---------------- viewer/tsconfig.json | 2 +- viewer/visualstudio.code-workspace | 34 ++++++++++++++++++---------------- viewer/vue.config.js | 6 +++--- 4 files changed, 43 insertions(+), 36 deletions(-) diff --git a/viewer/.eslintrc.js b/viewer/.eslintrc.js index e1ad89b..113ff6a 100644 --- a/viewer/.eslintrc.js +++ b/viewer/.eslintrc.js @@ -6,30 +6,35 @@ module.exports = { }, extends: [ - 'plugin:vue/essential', - '@vue/typescript' + "plugin:vue/essential", + "@vue/typescript" ], rules: { "no-console": "off", "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off", - 'eol-last': ['warn', 'always'], - 'vue/attribute-hyphenation': 'warn', - 'vue/html-closing-bracket-spacing': 'warn', - 'vue/html-end-tags': 'error', - 'vue/html-quotes': 'warn', - 'vue/html-self-closing': 'off', - 'vue/no-multi-spaces': 'warn', - 'vue/no-spaces-around-equal-signs-in-attribute': 'warn', - 'vue/no-template-shadow': 'error', - 'vue/v-bind-style': 'warn', - 'vue/v-on-style': 'warn', - 'vue/attributes-order': 'warn', - 'vue/this-in-template': 'warn', + "eol-last": ["warn", "always"], + "object-curly-spacing": ["warn", "always"], + "indent": ["warn", 2, { "SwitchCase": 1 }], + "quote-props": ["warn", "as-needed"], + "quotes": ["warn", "double"], + "vue/attribute-hyphenation": "warn", + "vue/html-closing-bracket-spacing": "warn", + "vue/html-end-tags": "error", + "vue/html-quotes": "warn", + "vue/html-self-closing": "off", + "vue/no-multi-spaces": "warn", + "vue/no-spaces-around-equal-signs-in-attribute": "warn", + "vue/no-template-shadow": "error", + "vue/v-bind-style": "warn", + "vue/v-on-style": "warn", + "vue/attributes-order": "warn", + "vue/this-in-template": "warn", }, parserOptions: { - parser: '@typescript-eslint/parser', + sourceType: "module", + parser: "@typescript-eslint/parser", }, }; diff --git a/viewer/tsconfig.json b/viewer/tsconfig.json index 38e14fa..02d9d7f 100644 --- a/viewer/tsconfig.json +++ b/viewer/tsconfig.json @@ -38,4 +38,4 @@ "exclude": [ "node_modules" ] -} \ No newline at end of file +} diff --git a/viewer/visualstudio.code-workspace b/viewer/visualstudio.code-workspace index 8c1079e..8315cbb 100644 --- a/viewer/visualstudio.code-workspace +++ b/viewer/visualstudio.code-workspace @@ -1,20 +1,22 @@ { - "folders": [ - { - "path": "." - } - ], - "settings": { - "editor.formatOnSave": true, - "editor.wordBasedSuggestions": 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", - } + "folders": [ + { + "path": "." + } + ], + "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", + }, } // Recommended Visual Studio Code extensions: // - Vetur diff --git a/viewer/vue.config.js b/viewer/vue.config.js index 9b92dc2..f481e4f 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js @@ -28,10 +28,10 @@ module.exports = { }, }, chainWebpack: (config) => { - config.plugins.delete('prefetch'); + config.plugins.delete("prefetch"); }, configureWebpack: { - devtool: 'source-map' + devtool: "source-map" }, productionSourceMap: false, devServer: { @@ -41,7 +41,7 @@ module.exports = { app.get(`/${process.env.VUE_APP_DATA_URL}*`, (req, res) => { const fs = require("fs"); const url = req.url.slice(process.env.VUE_APP_DATA_URL.length); - const paramIdx = url.indexOf('?'); + const paramIdx = url.indexOf("?"); const filepath = paramIdx < 0 ? url : url.substring(0, paramIdx); const fullpath = `${process.env.VUE_APP_DEVSERVER_CONFIG_PATH}${decodeURIComponent(filepath)}`; const file = fs.readFileSync(fullpath); -- cgit v1.2.3