Skip to content

Commit

Permalink
Docs: fix typos (#9723)
Browse files Browse the repository at this point in the history
* Fix typos

* Fix capitalization manually
  • Loading branch information
tbroadley authored and platinumazure committed Dec 16, 2017
1 parent 43d4ba8 commit f819920
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/developer-guide/nodejs-api.md
Expand Up @@ -839,4 +839,4 @@ ruleTester.run("my-rule", myRule, {
## Deprecated APIs

* `cli` - the `cli` object has been deprecated in favor of `CLIEngine`. As of v1.0.0, `cli` is no longer exported and should not be used by external tools.
* `linter` - the `linter` object has has been deprecated in favor of `Linter`, as of v4.0.0
* `linter` - the `linter` object has been deprecated in favor of `Linter`, as of v4.0.0
2 changes: 1 addition & 1 deletion docs/developer-guide/selectors.md
Expand Up @@ -32,7 +32,7 @@ The following selectors are supported:
* attribute existence: `[attr]`
* attribute value: `[attr="foo"]` or `[attr=123]`
* attribute regex: `[attr=/foo.*/]`
* attribute conditons: `[attr!="foo"]`, `[attr>2]`, `[attr<3]`, `[attr>=2]`, or `[attr<=3]`
* attribute conditions: `[attr!="foo"]`, `[attr>2]`, `[attr<3]`, `[attr>=2]`, or `[attr<=3]`
* nested attribute: `[attr.level2="foo"]`
* field: `FunctionDeclaration > Identifier.id`
* First or last child: `:first-child` or `:last-child`
Expand Down
4 changes: 2 additions & 2 deletions docs/developer-guide/working-with-plugins.md
Expand Up @@ -108,7 +108,7 @@ By default, ESLint will not perform autofixes when a processor is used, even whe

The `range` property contains two indexes in the code, referring to the start and end location of a contiguous section of text that will be replaced. The `text` property refers to the text that will replace the given range.

In the initial list of problems, the `fix` property will refer refer to a fix in the processed JavaScript. The `postprocess` method should transform the object to refer to a fix in the original, unprocessed file.
In the initial list of problems, the `fix` property will refer to a fix in the processed JavaScript. The `postprocess` method should transform the object to refer to a fix in the original, unprocessed file.

2. Add a `supportsAutofix: true` property to the processor.

Expand Down Expand Up @@ -168,7 +168,7 @@ Add these keywords into your `package.json` file to make it easy for others to f

## Working with Custom Parsers

If you want to use your own parser and provide additional capabilities for your rules, you can specify your own custom parser. If a `parseForESLint` method is exposed on the parser, this method will be used to parse the code. Otherwise, the `parse` method will be used. Both methods should take in the the source code as the first argument, and an optional configuration object as the second argument (provided as `parserOptions` in a config file). The `parse` method should simply return the AST. The `parseForESLint` method should return an object that contains the required property `ast` and an optional `services` property. `ast` should contain the AST. The `services` property can contain any parser-dependent services (such as type checkers for nodes). The value of the `services` property is available to rules as `context.parserServices`.
If you want to use your own parser and provide additional capabilities for your rules, you can specify your own custom parser. If a `parseForESLint` method is exposed on the parser, this method will be used to parse the code. Otherwise, the `parse` method will be used. Both methods should take in the source code as the first argument, and an optional configuration object as the second argument (provided as `parserOptions` in a config file). The `parse` method should simply return the AST. The `parseForESLint` method should return an object that contains the required property `ast` and an optional `services` property. `ast` should contain the AST. The `services` property can contain any parser-dependent services (such as type checkers for nodes). The value of the `services` property is available to rules as `context.parserServices`.

You can find an ESLint parser project [here](https://github.com/eslint/typescript-eslint-parser).

Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide/working-with-rules.md
Expand Up @@ -117,7 +117,7 @@ Additionally, the `context` object has the following methods:
* `getDeclaredVariables(node)` - returns a list of [variables](https://estools.github.io/escope/Variable.html) declared by the given node. This information can be used to track references to variables.
* If the node is a `VariableDeclaration`, all variables declared in the declaration are returned.
* If the node is a `VariableDeclarator`, all variables declared in the declarator are returned.
* If the node is a `FunctionDeclaration` or `FunctionExpression`, the variable for the function name is returned,in addition to variables for the function parameters.
* If the node is a `FunctionDeclaration` or `FunctionExpression`, the variable for the function name is returned, in addition to variables for the function parameters.
* If the node is an `ArrowFunctionExpression`, variables for the parameters are returned.
* If the node is a `ClassDeclaration` or a `ClassExpression`, the variable for the class name is returned.
* If the node is a `CatchClause`, the variable for the exception is returned.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/lines-between-class-members.md
Expand Up @@ -39,8 +39,8 @@ This rule has a string option and an object option.

String option:

* `"always"`(default) require an empty line after after class members
* `"never"` disallows an empty line after after class members
* `"always"`(default) require an empty line after class members
* `"never"` disallows an empty line after class members

Object option:

Expand Down
4 changes: 2 additions & 2 deletions docs/rules/no-restricted-modules.md
Expand Up @@ -5,7 +5,7 @@ application. The keyword `require` is used in Node.js/CommonJS to import modules

Why would you want to restrict a module?

Disallowing usage of specific Node.js modules can be useful if you want to limit the available methods a developer can use. For example,You can block usage of the `fs` module if you want to disallow file system access.
Disallowing usage of specific Node.js modules can be useful if you want to limit the available methods a developer can use. For example, you can block usage of the `fs` module if you want to disallow file system access.

## Rule Details

Expand Down Expand Up @@ -105,4 +105,4 @@ var crypto = require('crypto');

var crypto = require('crypto');
var pick = require('lodash/pick');
```
```

0 comments on commit f819920

Please sign in to comment.