Skip to content

Commit

Permalink
Docs:fix some typos and wrong whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
molee1905 committed Apr 29, 2016
1 parent 3d1edd2 commit 2a5f1a2
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 60 deletions.
6 changes: 3 additions & 3 deletions docs/about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ESLint 的初衷是为了让程序员可以创建自己的检测规则。ESLint

ESLint is written using Node.js to provide a fast runtime environment and easy installation via [npm][].

ESLint使用Node.js编写,这样既可以有一个快速的运行环境的同时也便于安装。
ESLint 使用 Node.js 编写,这样既可以有一个快速的运行环境的同时也便于安装。

[linting]: http://en.wikipedia.org/wiki/Lint_(software)
[npm]: http://npmjs.org/
Expand All @@ -35,9 +35,9 @@ Everything is pluggable:
所有都是可拔插的

* Rule API is used both by bundled and custom rules
* 内置规则和自定义规则共用一套规则API
* 内置规则和自定义规则共用一套规则 API
* Formatter API is used both by bundled and custom formatters
* 内置的格式化方法和自定义的格式化方法共用一套格式化API
* 内置的格式化方法和自定义的格式化方法共用一套格式化 API
* Additional rules and formatters can be specified at runtime
* 额外的规则和格式化方法能够在运行时指定
* Rules and formatters don't have to be bundled to be used
Expand Down
10 changes: 5 additions & 5 deletions docs/developer-guide/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ESLint 有几个关键部分:

* `lib/eslint.js` - this is the core `eslint` object that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly.

* `lib/eslint.js` - 这个是核心的`eslint`对象,负责根据配置选项进行代码验证。这个文件没有文件I/O操作,也不与`console`打交道。对于其他需要验证 Javascript 文本的 Node.js 程序而已,它们可以直接使用这个接口。
* `lib/eslint.js` - 这个是核心的`eslint`对象,负责根据配置选项进行代码验证。这个文件没有文件 I/O 操作,也不与`console`打交道。对于其他需要验证 JavaScript 文本的 Node.js 程序而已,它们可以直接使用这个接口。

## The `cli` object

Expand Down Expand Up @@ -111,16 +111,16 @@ The main method of the `eslint` object is `verify()` and accepts two arguments:

Once the AST is available, `estraverse` is used to traverse the AST from top to bottom. At each node, the `eslint` object emits an event that has the same name as the node type (i.e., "Identifier", "WithStatement", etc.). On the way back up the subtree, an event is emitted with the AST type name and suffixed with ":after", such as "Identifier:after" - this allows rules to take action both on the way down and on the way up in the traversal. Each event is emitted with the appropriate AST node available.

一旦AST是可用的,`estraverse`被用来从上到下遍历AST。在每个节点,`eslint`对象触发与该节点类型同名的一个事件(即 "Identifier","WithStatement" 等等)。在回退到子树上时,一个带有AST类型名称和":after"后缀的事件被触发,比如"Identifier:after" - 这允许规则在正向和逆向遍历开始起作用。每个事件在恰当的AST节点可用时触发
一旦AST是可用的,`estraverse`被用来从上到下遍历 AST。在每个节点,`eslint`对象触发与该节点类型同名的一个事件(即 "Identifier", "WithStatement" 等等)。在回退到子树上时,一个带有 AST 类型名称和 ":after" 后缀的事件被触发,比如 "Identifier:after" - 这允许规则在正向和逆向遍历开始起作用。每个事件在恰当的 AST 节点可用时触发

This object's responsibilities include:

这个对象的职责包括:

* Inspecting JavaScript code strings
* 检查Javascript 代码字符串
* 检查 JavaScript 代码字符串
* Creating an AST for the code
* 为代码创建AST
* 为代码创建 AST
* Executing rules on the AST
* 在AST上执行规则
* Reporting back the results of the execution
Expand All @@ -135,7 +135,7 @@ This object may not:
* Perform any asynchronous operations
* 执行任何异步操作
* Use Node.js-specific features
* 使用 Node.js特定的功能
* 使用 Node.js 特定的功能
* Access the file system
* 访问文件系统
* Call `console.log()` or any other similar method
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide/working-with-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module.exports.schema = [

Each rule is represented by a single object with several properties. The properties are equivalent to AST node types from [ESTree](https://github.com/estree/estree). For example, if your rule wants to know when an identifier is found in the AST, then add a method called "Identifier", such as:

每个规则都表现为一个非空对象。它的属性相当于 ESTree 中的 AST 节点类型。例如,如果你的规则想知道一个标识符什么时候在 AST 中被发现,添加一个叫做 "Identifier" 的方法,比如:
每个规则都表现为一个非空对象。它的属性相当于 [ESTree](https://github.com/estree/estree) 中的 AST 节点类型。例如,如果你的规则想知道一个标识符什么时候在 AST 中被发现,添加一个叫做 "Identifier" 的方法,比如:

```js
module.exports = function(context) {
Expand Down
Loading

0 comments on commit 2a5f1a2

Please sign in to comment.