From 513a51fb73b2a8b87dca6e1a6a95f522c8b645c6 Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Tue, 8 Feb 2022 12:03:53 +0100 Subject: [PATCH] feat: move eslint config to external file to support comments --- .eslintrc.js | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 46 ---------------------------------------------- 2 files changed, 51 insertions(+), 46 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..01274e10 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,51 @@ +module.exports = { + 'root': true, + 'env': { + 'browser': true, + 'es2021': true, + 'node': true, + 'vue/setup-compiler-macros': true, + }, + 'extends': [ + 'eslint:recommended', + 'plugin:vue/vue3-essential', + '@vue/typescript', + ], + 'rules': { + 'vue/html-quotes': [ + 'error', + 'double', + ], + 'quotes': [ + 'error', + 'single', + ], + 'comma-dangle': [ + 'error', + 'always-multiline', + ], + 'semi': [ + 'error', + 'never', + ], + 'vue/script-setup-uses-vars': 'error', + + // see https://segmentfault.com/q/1010000040813116/a-1020000041134455 (original in chinese) + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }], + + 'vue/multi-word-component-names': 0, + }, + 'parser': 'vue-eslint-parser', + 'parserOptions': { + 'parser': '@typescript-eslint/parser', + 'ecmaVersion': 2022, + }, + 'ignorePatterns': [ + '*.test.*', + 'cypress/*', + ], + 'globals': { + 'defineProps': 'readonly', + }, +} \ No newline at end of file diff --git a/package.json b/package.json index c77c5fa2..ca76b782 100644 --- a/package.json +++ b/package.json @@ -92,52 +92,6 @@ "wait-on": "6.0.1", "workbox-cli": "6.5.3" }, - "eslintConfig": { - "root": true, - "env": { - "browser": true, - "es2021": true, - "node": true, - "vue/setup-compiler-macros": true - }, - "extends": [ - "eslint:recommended", - "plugin:vue/vue3-essential", - "@vue/typescript" - ], - "rules": { - "vue/html-quotes": [ - "error", - "double" - ], - "quotes": [ - "error", - "single" - ], - "comma-dangle": [ - "error", - "always-multiline" - ], - "semi": [ - "error", - "never" - ], - "vue/script-setup-uses-vars": "error", - "vue/multi-word-component-names": 0 - }, - "parser": "vue-eslint-parser", - "parserOptions": { - "parser": "@typescript-eslint/parser", - "ecmaVersion": 2022 - }, - "ignorePatterns": [ - "*.test.*", - "cypress/*" - ], - "globals": { - "defineProps": "readonly" - } - }, "postcss": { "plugins": { "autoprefixer": {}