Skip to content

Commit

Permalink
feat: add peerDependencies and peerDependenciesMeta, off no-duplicate…
Browse files Browse the repository at this point in the history
…-imports
  • Loading branch information
xcatliu committed Jul 3, 2022
1 parent 7091196 commit 6e5f50c
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 80 deletions.
2 changes: 1 addition & 1 deletion base.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ module.exports = {
/**
* 禁止重复导入模块
*/
'no-duplicate-imports': 'error',
'no-duplicate-imports': 'off',
/**
* 禁止在 else 内使用 return,必须改为提前结束
* @reason else 中使用 return 可以使代码结构更清晰
Expand Down
6 changes: 3 additions & 3 deletions config/rules/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -705,11 +705,11 @@
},
"no-duplicate-imports": {
"name": "no-duplicate-imports",
"value": "error",
"value": "off",
"description": "禁止重复导入模块",
"reason": "",
"badExample": "<span class=\"token keyword\">import</span> <span class=\"token punctuation\">{</span> readFile <span class=\"token punctuation\">}</span> <span class=\"token keyword\">from</span> <span class=\"token string\">'fs'</span><span class=\"token punctuation\">;</span>\n<mark class=\"eslint-error\" data-tip=\"&amp;apos;fs&amp;apos; import is duplicated.&lt;br/&gt;&lt;span class='eslint-error-rule-id'&gt;eslint(no-duplicate-imports)&lt;/span&gt;\"><span class=\"token keyword\">import</span> <span class=\"token punctuation\">{</span> writeFile <span class=\"token punctuation\">}</span> <span class=\"token keyword\">from</span> <span class=\"token string\">'fs'</span><span class=\"token punctuation\">;</span></mark>",
"goodExample": "<span class=\"token keyword\">import</span> <span class=\"token punctuation\">{</span> readFile<span class=\"token punctuation\">,</span> writeFile <span class=\"token punctuation\">}</span> <span class=\"token keyword\">from</span> <span class=\"token string\">'fs'</span><span class=\"token punctuation\">;</span>",
"badExample": "",
"goodExample": "",
"fixable": false,
"extendsBaseRule": "",
"requiresTypeChecking": false
Expand Down
97 changes: 66 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,6 @@
"name": "eslint-config-alloy",
"version": "4.6.0",
"description": "AlloyTeam ESLint 规则",
"main": "index.js",
"scripts": {
"start": "pnpm dev",
"dev": "run-p dev:*",
"dev:eslintrc": "nodemon",
"dev:copyfiles": "pnpm build:copyfiles && chokidar \"site/public/**/*\" -c \"pnpm build:copyfiles\"",
"dev:webpack-dev-server": "webpack serve --open",
"build": "run-s build:*",
"build:eslintrc": "ts-node scripts/build.ts",
"build:clean": "rimraf ./dist",
"build:copyfiles": "copyfiles -u 2 \"site/public/**/*\" dist/public",
"build:site": "webpack",
"test": "pnpm lint && ts-node ./test/index.ts",
"lint": "run-s eslint prettier",
"eslint": "eslint --ext .js,.jsx,.ts,.tsx,.vue --ignore-pattern \"bad.*\" .",
"prettier": "prettier -l \"./**/*\"",
"prettier:fix": "prettier --write -l \"./**/*\"",
"prepare": "husky install",
"update": "pnpm up --latest",
"rulesCoverage": "ts-node ./scripts/rulesCoverage.ts"
},
"repository": {
"type": "git",
"url": "git+https://github.com/AlloyTeam/eslint-config-alloy.git"
},
"keywords": [
"eslint",
"eslintrc",
Expand All @@ -40,6 +15,11 @@
"vue",
"typescript"
],
"homepage": "https://alloyteam.github.io/eslint-config-alloy/",
"bugs": {
"url": "https://github.com/AlloyTeam/eslint-config-alloy/issues"
},
"license": "MIT",
"author": "xcatliu <[email protected]>",
"contributors": [
"heyli <[email protected]>",
Expand All @@ -54,13 +34,31 @@
"sunhui04 <[email protected]>",
"zoubingwu <[email protected]>"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/AlloyTeam/eslint-config-alloy/issues"
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/AlloyTeam/eslint-config-alloy.git"
},
"homepage": "https://alloyteam.github.io/eslint-config-alloy/",
"publishConfig": {
"access": "public"
"scripts": {
"start": "pnpm dev",
"dev": "run-p dev:*",
"dev:eslintrc": "nodemon",
"dev:copyfiles": "pnpm build:copyfiles && chokidar \"site/public/**/*\" -c \"pnpm build:copyfiles\"",
"dev:webpack-dev-server": "webpack serve --open",
"build": "run-s build:*",
"build:eslintrc": "ts-node scripts/build.ts",
"build:clean": "rimraf dist",
"build:copyfiles": "copyfiles -u 2 \"site/public/**/*\" dist/public",
"build:site": "webpack",
"clean": "rimraf dist node_modules",
"test": "pnpm lint && ts-node ./test/index.ts",
"lint": "run-s eslint prettier",
"eslint": "eslint --ext .js,.jsx,.ts,.tsx,.vue --ignore-pattern \"bad.*\" .",
"prettier": "prettier -l \"./**/*\"",
"prettier:fix": "prettier --write -l \"./**/*\"",
"prepare": "husky install",
"update": "pnpm up --latest",
"rulesCoverage": "ts-node ./scripts/rulesCoverage.ts"
},
"devDependencies": {
"@babel/core": "^7.18.5",
Expand Down Expand Up @@ -107,5 +105,42 @@
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.2",
"xml-escape": "^1.1.0"
},
"peerDependencies": {
"@babel/eslint-parser": "7.x",
"@babel/preset-react": "7.x",
"@typescript-eslint/eslint-plugin": "5.x",
"@typescript-eslint/parser": "5.x",
"eslint": ">=8.18.0",
"eslint-plugin-react": ">=7.30.1",
"eslint-plugin-vue": ">=9.1.1",
"typescript": "4.x",
"vue-eslint-parser": "9.x"
},
"peerDependenciesMeta": {
"@babel/eslint-parser": {
"optional": true
},
"@babel/preset-react": {
"optional": true
},
"@typescript-eslint/eslint-plugin": {
"optional": true
},
"@typescript-eslint/parser": {
"optional": true
},
"eslint-plugin-react": {
"optional": true
},
"eslint-plugin-vue": {
"optional": true
},
"typescript": {
"optional": true
},
"vue-eslint-parser": {
"optional": true
}
}
}
Loading

0 comments on commit 6e5f50c

Please sign in to comment.