From b728bc5d55ab6f847662c8ef3b29454acfb56f20 Mon Sep 17 00:00:00 2001 From: YangQi Date: Mon, 1 Aug 2022 19:59:36 +0800 Subject: [PATCH] chore: add an eslint configuration file (#164) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 从 package.json 中抽离规则为单独的配置文件 --- .eslintrc.js | 25 +++++++++++++++++++++++++ package.json | 37 ------------------------------------- 2 files changed, 25 insertions(+), 37 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..6eeefe8 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,25 @@ +module.exports = { + root: true, + env: { + node: true, + }, + extends: [`plugin:vue/essential`, `eslint:recommended`, `@vue/prettier`], + parserOptions: { + parser: `babel-eslint`, + }, + ignorePatterns: [`src/assets/scripts/renderers`], + rules: { + 'prettier/prettier': [ + `error`, + { + singleQuote: true, + semi: false, + }, + ], + semi: [`error`, `never`], + quotes: [`error`, `backtick`], + 'no-unused-vars': `off`, + 'no-console': `off`, + 'no-debugger': `off`, + }, +} diff --git a/package.json b/package.json index 426b5e1..4176855 100644 --- a/package.json +++ b/package.json @@ -12,43 +12,6 @@ "build-cli": "npm run build && npx shx rm -rf md-cli/dist && npx shx rm -rf dist/**/*.map && npx shx cp -r dist md-cli/ && cd md-cli && npm pack", "mm": "npx mockm --cwd=mm" }, - "eslintConfig": { - "root": true, - "env": { - "node": true - }, - "extends": [ - "plugin:vue/essential", - "eslint:recommended", - "@vue/prettier" - ], - "parserOptions": { - "parser": "babel-eslint" - }, - "ignorePatterns": [ - "src/assets/scripts/renderers" - ], - "rules": { - "prettier/prettier": [ - "error", - { - "singleQuote": true, - "semi": false - } - ], - "semi": [ - "error", - "never" - ], - "quotes": [ - "error", - "backtick" - ], - "no-unused-vars": "off", - "no-console": "off", - "no-debugger": "off" - } - }, "dependencies": { "@vue/shared": "^3.2.26", "ali-oss": "^6.16.0",