-
Notifications
You must be signed in to change notification settings - Fork 35
在 Atom 中使用 ESlint #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
2017.03.11 更新快速使用在 Atom 上安装 在项目的 "devDependencies": {
"webpack": "^2.2.1",
"babel-eslint": "^7.1.1",
"eslint": "^3.14.0",
"eslint-config-airbnb": "^14.0.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^3.0.2",
"eslint-plugin-react": "^6.9.0"
} 添加完成之后,整个 {
"name": "node-translate-cli",
"version": "1.0.0",
"description": "node-translate-cli",
"repository": "https://github.com/nodejh/node-translate-cli.git",
"main": "index.js",
"directories": {
"doc": "doc"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"webpack": "^2.2.1",
"babel-eslint": "^7.1.1",
"eslint": "^3.14.0",
"eslint-config-airbnb": "^14.0.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^3.0.2",
"eslint-plugin-react": "^6.9.0"
},
"author": "nodejh",
"license": "ISC"
} 然后执行 安装完成之后,再创建一个
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ESlint 主要是用来帮助我们规范书写 JavaScript 代码。通过使用 Atom 的 ESLit 插件,并配合 Airbnb 的 ESLint 规则,我们可以一边编码一边检测语法。关于 ESLint 的详细介绍可看官方文档。
1. 在 Atom 中安装 ESLint
2. 在项目中使用 eslint-config-airbnb
[eslint-config-airbnb](https://www.npmjs.com/package/eslint-config-airbnb#improving-this-config)是一个基于 Airbnb's Javascript styleguide 的 ESLint 配置。安装方法如下:
然后在项目根目录添加一个
.eslintrc
文件,并在其中添加如下代码:3. 自定义 ESLint 规则
eslint-config-airbnb 中的规则,可能并不完全符合自己的编码习惯,我们还可以在
.eslintrc
中添加一些自定义的规则。4. ESLint 规则说明
The text was updated successfully, but these errors were encountered: