chore: add an eslint configuration file (#164)

从 package.json 中抽离规则为单独的配置文件
This commit is contained in:
YangQi 2022-08-01 19:59:36 +08:00 committed by GitHub
parent 3d26b03430
commit b728bc5d55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 37 deletions

25
.eslintrc.js Normal file
View File

@ -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`,
},
}

View File

@ -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", "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" "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": { "dependencies": {
"@vue/shared": "^3.2.26", "@vue/shared": "^3.2.26",
"ali-oss": "^6.16.0", "ali-oss": "^6.16.0",