把平时自己用的 eslint 代码规范整合到这个项目中,方便其他项目直接使用
1 进入到你的项目运行下面命令
npm install -save eslint-config-sh
npx install-peerdeps --dev eslint-config-sh
npm install --save-dev eslint babel-eslint eslint-plugin-babel eslint-plugin-import eslint-config-sh
{
"root": true,
"extends": "sh"
}
npm install --save-dev eslint typescript eslint-plugin-babel eslint-plugin-import @typescript-eslint/eslint-plugin eslint-config-sh
{
"root": true,
"extends": "sh/typescript"
}
npm install --save-dev eslint babel-eslint eslint-plugin-babel eslint-plugin-import eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y eslint-config-sh
{
"root": true,
"extends": "sh/react"
}
npm install --save-dev eslint babel-eslint eslint-plugin-babel eslint-plugin-import eslint-plugin-vue eslint-config-sh
{
"root": true,
"extends": "sh/vue"
}
- "babel-eslint": "^10.1.0",
- "eslint": "^7.23.0",
- "eslint-config-airbnb": "^18.2.1",
- "eslint-config-prettier": "^8.1.0",
- "eslint-plugin-import": "^2.22.1",
- "eslint-plugin-jsx": "^0.1.0",
- "eslint-plugin-jsx-a11y": "^6.4.1",
- "eslint-plugin-prettier": "^3.3.1",
- "eslint-plugin-react": "^7.23.1",
- "eslint-plugin-react-hooks": "^4.2.0",
- "@typescript-eslint/eslint-plugin": "^5.10.1",
- "@typescript-eslint/parser": "^5.10.1",
- "eslint-plugin-vue": "^8.3.0",
- "typescript": "^4.5.5"