eslint-config-cloudinsight
这是 CloudInsight 用到的基于 Airbnb 的 eslint 配置,它能够很好的统一前端的编码风格。
新手指南
安装 eslint 和相关的模块
npm install eslint-config-cloudinsight@1 eslint@2 babel-eslint@6 eslint-config-airbnb@6 eslint-plugin-react@4 --save-dev
在项目目录下新建 .eslintrc.json, 这是 eslint 的默认配置文件
在项目 package.json 的 scripts 新加一项
运行 eslint 检查
npm run-script eslint
加到你的 CI 环境里
node_modules/.bin/eslint --ext es6,jsx,js --format checkstyle -o checkstyle.xml ./src || true
参考资料
http://eslint.org/docs/developer-guide/shareable-configs
更新历史
- v1.0.1