• Stars
    star
    161
  • Rank 233,470 (Top 5 %)
  • Language
  • Created almost 9 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🇨🇳A translation of ESLint Documents, including configration and rules.

ESLint 配置及规则说明

一、项目中包含:

**Rules:**该文件夹中包含了ESLint Rules的中文翻译(暂不包含v2.0.0新增Rules)。

Configration: 该文件夹内包含一个ESLint配置说明文件。

.eslintrc: 该文件是可以是你项目中有且仅有ESLint的配置文件,不包含规则简要解释。

eslintrc.json: 该文件可以是你项目中有且仅有ESLint的配置文件,包含简要的规则解释。

Migrating-to-v2.0.0: ESLint迁移至v2.0.0手册,和Rules和Configration相关部分进行了翻译。

二、配置文件使用说明

1. 安装依赖:

package.json文件中添加如下依赖(如果没有package.son文件需首先通过npm init 创建package.son 文件):

"devDependencies": {
    "babel-core": "^6.5.2",
    "babel-eslint": "^4.1.8",
    "eslint": "^2.1.0",
    "eslint-plugin-promise": "^1.0.8",
    "eslint-plugin-standard": "^1.3.2"
  }

运行如下命令:

npm install

2. 将文件夹中的eslintrc.json文件放置在项目根目录

并将eslintrc.json重命名为.eslintrc(或者直接使用文件夹中的.eslintrc文件)

3. 修改配置文件

根据自己项目需要,在配置文件中globals配置项中添加项目所需全局变量:举个栗子:

"globals": {
    "document": true,
    "navigator": true,
    "window": true,
    "angular":true //添加项目所需没有申明的全局变量
  },

4. 让ESLint运行起来

修改package.json文件。在script 配置项中添加如下代码:举个栗子:

  "scripts": {
    "lint": "eslint app.jsx test" //其中app.jsx test需要替换成你项目需要检测的文件或文件夹
  },

命令行运行如下代码:

npm run lint

好了,现在就可以在终端看检测结果了。

More Repositories

1

jocs.github.io

💯 This is my blog, I will update the latest articles and resumes on it, and feel free to contact me
Astro
961
star
2

node_mongodb_blog_system

♠️NodeJs Socket.io Mongoose Express jQuery BootStrap
JavaScript
61
star
3

webpack-HMR-demo

A minimum webpack hot module replacement example
JavaScript
29
star
4

muya-example

https://jocs.github.io/muya-example/
JavaScript
22
star
5

promise

✋Polyfill of ES2015's Promise
JavaScript
11
star
6

loader-count-webpack-plugin

Do you know how many files have been processed by a special webpack loader? Let me tell you!
JavaScript
10
star
7

LeetCode-js

Solve LeetCode problems with JavaScript
JavaScript
6
star
8

Jocs

Who am I?
6
star
9

view-image

An image viewer to zoom in and zoom out images.
JavaScript
6
star
10

sponsor.me

Thank you to all those who support me, let me do open source easily
5
star
11

easy-weex

a weex application for beginer
Vue
5
star
12

jo-i18n

A i18n library, you can use it set dictionary and format message base on the standard BCP 47 and ICU.
JavaScript
5
star
13

etrack

eTrack.Js 是一个JavaScript错误监测和报告的应用,旨在帮助您构建更好的JavaScript应用
4
star
14

reading-notes

Read books and take notes.
HTML
4
star
15

awesome-stars

A list of my GitHub stars!
4
star
16

Chat_room_socket.io

A chat room with socket.io
JavaScript
3
star
17

EditorConfig_guideline

JavaScript
3
star
18

Fullstack-React-Redux

A simple, full-stack JavaScript single page app featuring React, Redux, Webpack, and Falcor
JavaScript
3
star
19

LeetCode-c

Solve LeetCode problem with c language
C
2
star
20

snake

JavaScript
2
star
21

ReactiveProgramingwithRXJS

JavaScript
2
star
22

ilikezu-issue

乐租生活在线商城提 issue 专属仓库
2
star
23

etrack.embed

JavaScript
2
star
24

rxjs-beginer

JavaScript
2
star
25

kata

kata everyday
JavaScript
2
star
26

packup

module bundler
JavaScript
2
star
27

LeetCode-go

Go
2
star
28

eTrack.js

JavaScript
2
star
29

angular-rxjs-example

JavaScript
2
star
30

ilikezu-web

vue application, ilikezu web application
Vue
2
star
31

realtime-markdown

a AngularJs markdown components
JavaScript
1
star
32

async_demo_with_redux

JavaScript
1
star
33

cherry

Cherry is CSS Selctor
JavaScript
1
star
34

ECMAScript2015

1
star
35

HTML5_WebSocket

JavaScript
1
star
36

HTMLHint-Guideline

Basic use of HTMLHint and learn its rules
HTML
1
star
37

coder-chat

Angular Application
JavaScript
1
star
38

React_examples_demo

The Rep is a collection of React example, enjoy it!
JavaScript
1
star
39

CSSLint-Guideline

Basic use of CSSLint
CSS
1
star
40

leetcode-rust

Solve leetcode problem by Rust
Rust
1
star
41

MyPromise

Add Native Promise a nitify method
JavaScript
1
star
42

rm-npm

Use this package you can remove your node_modules and bower_components directory
JavaScript
1
star