From 4e46e5a15ae2b275e96718021cdcce5d15915ca7 Mon Sep 17 00:00:00 2001 From: Fritz Lin Date: Mon, 8 Aug 2022 21:15:56 +0800 Subject: [PATCH] fix bug: At.vue insertHtml 'suffix' is not defined !! also other eslint warnings -- #137 bug regression commit: https://github.com/fritx/vue-at/commit/725d7a1470e9cc309ae2b7d04deddf8ccf9ceb05#diff-11090ff0a927c36112fd70be4c32aa3841151637c37309ea0f8c429f00c9ed61L335 --- .eslintrc.js | 33 +++++++++++++++++++++++++++++++++ package.json | 6 ++++++ src/App.vue | 14 +++++++------- src/At.vue | 31 ++++++++++++++++--------------- src/AtTemplate.vue | 28 ++++++++++++++++++++-------- src/AtTextarea.vue | 1 + src/util.js | 8 ++++---- 7 files changed, 87 insertions(+), 34 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..af76aae --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,33 @@ +module.exports = { + root: true, + env: {}, + extends: [ + 'plugin:vue/vue3-recommended', + '@vue/standard' + ], + parserOptions: { + }, + rules: { + 'vue/multiline-html-element-content-newline': 'off', + 'vue/first-attribute-linebreak': 'off', + 'vue/max-attributes-per-line': 'off', + 'vue/component-tags-order': 'off', + 'vue/order-in-components': 'off', + 'vue/html-self-closing': 'off', + 'vue/attributes-order': 'off', + 'vue/html-indent': 'off', + 'space-before-function-paren': ['error', { + anonymous: 'always', + named: 'always', + asyncArrow: 'always' + }], + 'no-irregular-whitespace': 'off', + 'no-mixed-operators': 'off', + 'no-unused-vars': 'off', + 'prefer-const': 'off', + 'comma-dangle': 'off', + 'max-len': 'off', + 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off' + } +} diff --git a/package.json b/package.json index 2506845..75f43fc 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,8 @@ "author": "Fritz Lin ", "repository": "https://github.com/fritx/vue-at", "scripts": { + "lint:fix": "vue-cli-service lint", + "lint": "vue-cli-service lint --no-fix", "dev": "vue-cli-service serve", "demo": "vue-cli-service build", "build:at": "vue-cli-service build ./src/At.vue --target lib --name vue-at", @@ -21,9 +23,13 @@ }, "devDependencies": { "@babel/core": "^7.18.9", + "@vue/cli-plugin-eslint": "^5.0.8", "@vue/cli-service": "^5.0.8", "@vue/compat": "^3.1.0", "@vue/compiler-sfc": "^3.1.0", + "@vue/eslint-config-standard": "^8.0.1", + "eslint": "^8.21.0", + "eslint-plugin-vue": "^9.3.0", "npm-run-all": "^4.1.5", "rimraf": "^3.0.2", "sass": "^1.53.0", diff --git a/src/App.vue b/src/App.vue index 01014dc..bd25b3b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,7 +13,7 @@ --> -