From 91d3148f97ca59769648f9307f3d7e65b1bd7e95 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 21 Dec 2019 11:04:14 +0100 Subject: viewer: ESLint rules --- viewer/.eslintrc.js | 24 ++++++++++++++++++++++-- viewer/src/views/Gallery.vue | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/viewer/.eslintrc.js b/viewer/.eslintrc.js index be91544..76f59fd 100644 --- a/viewer/.eslintrc.js +++ b/viewer/.eslintrc.js @@ -1,14 +1,34 @@ module.exports = { root: true, + env: { node: true, }, - extends: ["plugin:vue/essential", "@vue/typescript"], + + 'extends': [ + 'plugin:vue/essential', + '@vue/typescript' + ], + rules: { "no-console": process.env.NODE_ENV === "production" ? "error" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off", + 'vue/attribute-hyphenation': 'warn', + 'vue/html-closing-bracket-spacing': 'warn', + 'vue/html-end-tags': 'error', + 'vue/html-quotes': 'warn', + 'vue/html-self-closing': 'warn', + '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", + parser: '@typescript-eslint/parser', }, + }; diff --git a/viewer/src/views/Gallery.vue b/viewer/src/views/Gallery.vue index 3625838..55b93db 100644 --- a/viewer/src/views/Gallery.vue +++ b/viewer/src/views/Gallery.vue @@ -44,7 +44,7 @@ export default class Root extends Vue { return null; } - private checkType(type: string) { + private checkType(type: string): boolean { return (this.currentItem && this.currentItem.properties.type === type) || false; } } -- cgit v1.2.3