5.7.0 • Published 7 years ago

eslint-config-cloudinsight v5.7.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

eslint-config-cloudinsight

npm.io npm.io npm.io npm.io

这是 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 的默认配置文件

{
  "extends": "cloudinsight"
}

在项目 package.json 的 scripts 新加一项

{
  "scripts":{
    "eslint":"eslint --ext=js,es6,jsx ./src"
  }
  ...
}

运行 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