0.0.4 • Published 4 years ago

eslint-config-hl0 v0.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

eslint-plugin-hl2

这是一个公司内部定制化插件:

how to use

  1. 环境准备 yarn add eslint-plugin-hl2 -D yarn add @typescript-eslint/eslint-plugin -D yarn add @typescript-eslint/eslint-plugin-tslint -D yarn add @typescript-eslint/parser -D yarn add eslint -D yarn add eslint-plugin-react -D

  2. 添加配置

add : .eslintrc.js

module.exports = {
  extends: ['hl0/base',"hl0/react"]
}

hl0/react规则: 参考 alloy 团队

  1. 添加package.json
package.json
{
  ...
  "eslint": "eslint --ext .jsx,.js,.tsx,.ts ./src"
}
  1. 移除package.json 里的配置文件

  2. 关于prettier配置

prettierrc 规则

prettierrc 自动格式化代码 项目中使用prettierrc.js / prettierrc规则

全局安装: yarn add prettier -g

package.json
{
  ...
  "fix:prettier": "prettier --single-quote --write 'src/**/*.{js,jsx,ts,tsx,json,css}'",
  "fix:lint": "fix:prettier && yarn eslint",
}

roadmap

roadmap / roadmap opensourse / opensourse