Skip to content

Commit

Permalink
Merge pull request #5785 from pedrottimark/fixable-rules
Browse files Browse the repository at this point in the history
Docs: Update sentence in fixable rules
  • Loading branch information
ilyavolodin committed Apr 4, 2016
2 parents b437524 + 7e80867 commit d2ff1af
Show file tree
Hide file tree
Showing 31 changed files with 64 additions and 64 deletions.
2 changes: 1 addition & 1 deletion docs/rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ These rules are purely matters of style and are quite subjective.
* [space-in-parens](space-in-parens.md): require or disallow spaces inside parentheses (fixable)
* [space-infix-ops](space-infix-ops.md): require spaces around operators (fixable)
* [space-unary-ops](space-unary-ops.md): require or disallow spaces before/after unary operators (fixable)
* [spaced-comment](spaced-comment.md): require or disallow a space immediately following the `//` or `/*` in a comment
* [spaced-comment](spaced-comment.md): require or disallow a space immediately following the `//` or `/*` in a comment (fixable)
* [wrap-regex](wrap-regex.md): require regex literals to be wrapped in parentheses

## ECMAScript 6
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/array-bracket-spacing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Disallow or enforce spaces inside of brackets. (array-bracket-spacing)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

A number of style guides require or disallow spaces between array brackets. This rule
applies to both array literals and destructuring assignment (EcmaScript 6) using arrays.

Expand All @@ -13,8 +15,6 @@ var arr = ['foo', 'bar'];
var [x,y] = z;
```

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule aims to maintain consistency around the spacing inside of array brackets, either by disallowing
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/arrow-spacing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Require space before/after arrow function's arrow (arrow-spacing)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

This rule normalize style of spacing before/after an arrow function's arrow(`=>`).

```js
Expand All @@ -12,8 +14,6 @@ This rule normalize style of spacing before/after an arrow function's arrow(`=>`
(a)=>{}
```

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule takes an object argument with `before` and `after` properties, each with a Boolean value.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/block-spacing.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Disallow or enforce spaces inside of single line blocks. (block-spacing)

This rule is for spacing style within single line blocks.
(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.
This rule is for spacing style within single line blocks.

## Rule Details

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/comma-spacing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Enforces spacing around commas (comma-spacing)

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.
(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

Spacing around commas improve readability of a list of items. Although most of the style guidelines for languages prescribe adding a space after a comma and not before it, it is subjective to the preferences of a project.

Expand Down
4 changes: 2 additions & 2 deletions docs/rules/computed-property-spacing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Disallow or enforce spaces inside of computed properties. (computed-property-spacing)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

While formatting preferences are very personal, a number of style guides require
or disallow spaces between computed properties in the following situations:

Expand All @@ -16,8 +18,6 @@ var a = "prop";
var obj = { [a]: "value" };
```

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule aims to maintain consistency around the spacing inside of computed properties.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/eol-last.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Require file to end with single newline (eol-last)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

Trailing newlines in non-empty files are a common UNIX idiom. Benefits of
trailing newlines include the ability to concatenate or append to files as well
as output files to the terminal without interfering with shell prompts. This
Expand All @@ -10,8 +12,6 @@ the end of the file. If you still want this behaviour, consider enabling
[no-multiple-empty-lines](no-multiple-empty-lines.md) with `maxEOF` and/or
[no-trailing-spaces](no-trailing-spaces.md).

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

The following patterns are considered problems:
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/generator-star-spacing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Enforce spacing around the * in generator functions (generator-star-spacing)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

Generators are a new type of function in ECMAScript 6 that can return multiple values over time.
These special functions are indicated by placing an `*` after the `function` keyword.

Expand Down Expand Up @@ -38,8 +40,6 @@ function * generator() {

To keep a sense of consistency when using generators this rule enforces a single position for the `*`.

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule aims to enforce spacing around the `*` of generator functions.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/indent.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Validate Indentation (indent)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

This option validates a specific tab width for your code in block statements.

There are several common guidelines which require specific indentation of nested blocks and statements, like:
Expand All @@ -18,8 +20,6 @@ This is the most common scenarios recommended in different style guides:
* Tabs: jQuery
* Four spaces: Crockford

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule is aimed to enforce consistent indentation style. The default style is `4 spaces`.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/jsx-quotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Enforce JSX Quote Style (jsx-quotes)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

JSX attribute values can contain string literals, which are delimited with single or double quotes.

```xml
Expand All @@ -15,8 +17,6 @@ If you want to have e.g. a double quote within a JSX attribute value, you have t
<a b='"' />
```

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule takes one argument.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/keyword-spacing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Enforce spacing before and after keywords (keyword-spacing)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

Keywords are syntax elements of JavaScript, such as `function` and `if`.
These identifiers have special meaning to the language and so often appear in a different color in code editors.
As an important part of the language, style guides often refer to the spacing that should be used around keywords.
Expand All @@ -15,8 +17,6 @@ if (foo) {

Of course, you could also have a style guide that disallows spaces around keywords.

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule will enforce consistency of spacing around keywords and keyword-like tokens: `as` (in module declarations), `break`, `case`, `catch`, `class`, `const`, `continue`, `debugger`, `default`, `delete`, `do`, `else`, `export`, `extends`, `finally`, `for`, `from` (in module declarations), `function`, `get` (of getters), `if`, `import`, `in`, `instanceof`, `let`, `new`, `of` (in for-of statements), `return`, `set` (of setters), `static`, `super`, `switch`, `this`, `throw`, `try`, `typeof`, `var`, `void`, `while`, `with`, and `yield`.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/linebreak-style.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Enforce linebreak style (linebreak-style)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

When developing with a lot of people all having different editors, VCS applications and operating systems it may occur that
different line endings are written by either of the mentioned (might especially happen when using the windows and mac versions of SourceTree together).

Expand All @@ -8,8 +10,6 @@ whereas Linux and Unix use a simple _line feed_ (LF). The corresponding _control

Many versioning systems (like git and subversion) can automatically ensure the correct ending. However to cover all contingencies you can activate this rule.

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule aims to ensure having consistent line endings independent of operating system, VCS or editor used across your codebase.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/no-extra-semi.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Disallow Extra Semicolons (no-extra-semi)

JavaScript will more or less let you put semicolons after any statement without complaining. Typos and misunderstandings about where semicolons are required can lead to extra semicolons that are unnecessary.
(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.
JavaScript will more or less let you put semicolons after any statement without complaining. Typos and misunderstandings about where semicolons are required can lead to extra semicolons that are unnecessary.

## Rule Details

Expand Down
4 changes: 2 additions & 2 deletions docs/rules/no-multi-spaces.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Disallow multiple spaces (no-multi-spaces)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

Multiple spaces in a row that are not used for indentation are typically mistakes. For example:

```js
Expand All @@ -16,8 +18,6 @@ if(foo === "bar") {}

```

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule aims to disallow multiple whitespace around logical expressions, conditional expressions, declarations, array elements, object properties, sequences and function parameters.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/no-spaced-func.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Disallow Spaces in Function Calls (no-spaced-func)

While it's possible to have whitespace between the name of a function and the parentheses that execute it, such patterns tend to look more like errors.
(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.
While it's possible to have whitespace between the name of a function and the parentheses that execute it, such patterns tend to look more like errors.

## Rule Details

Expand Down
4 changes: 2 additions & 2 deletions docs/rules/no-trailing-spaces.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Disallow trailing spaces at the end of lines (no-trailing-spaces)

Sometimes in the course of editing files, you can end up with extra whitespace at the end of lines. These whitespace differences can be picked up by source control systems and flagged as diffs, causing frustration for developers. While this extra whitespace causes no functional issues, many code conventions require that trailing spaces be removed before checkin.
(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.
Sometimes in the course of editing files, you can end up with extra whitespace at the end of lines. These whitespace differences can be picked up by source control systems and flagged as diffs, causing frustration for developers. While this extra whitespace causes no functional issues, many code conventions require that trailing spaces be removed before checkin.

## Rule Details

Expand Down
14 changes: 7 additions & 7 deletions docs/rules/object-curly-spacing.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Disallow or enforce spaces inside of curly braces in objects. (object-curly-spacing)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

While formatting preferences are very personal, a number of style guides require
or disallow spaces between curly braces in the following situations:

```
```js
// simple object literals
var obj = { foo: "bar" };

Expand All @@ -18,8 +20,6 @@ import { foo } from "bar";
export { foo };
```

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule aims to maintain consistency around the spacing inside of object literals. It also
Expand All @@ -45,7 +45,7 @@ Depending on your coding conventions, you can choose either option by specifying

When `"never"` is set, the following patterns are considered problems:

```
```js
/*eslint object-curly-spacing: ["error", "never"]*/

var obj = { 'foo': 'bar' };
Expand All @@ -58,7 +58,7 @@ import { foo } from 'bar';

The following patterns are not considered problems:

```
```js
/*eslint object-curly-spacing: ["error", "never"]*/

var obj = {'foo': 'bar'};
Expand All @@ -79,7 +79,7 @@ import {foo} from 'bar';

When `"always"` is used, the following patterns are considered problems:

```
```js
/*eslint object-curly-spacing: ["error", "always"]*/

var obj = {'foo': 'bar'};
Expand All @@ -96,7 +96,7 @@ import {foo } from 'bar';

The following patterns are not considered problems:

```
```js
/*eslint object-curly-spacing: ["error", "always"]*/

var obj = {};
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/quotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Enforce Quote Style (quotes)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

JavaScript allows you to define strings in one of three ways: double quotes, single quotes, and backticks (as of ECMAScript 6). For example:

```js
Expand All @@ -18,8 +20,6 @@ Many codebases require strings to be defined in a consistent manner.

This rule is aimed at ensuring consistency of string quotes and as such will report a problem when an inconsistent style is found.

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

The rule configuration takes up to two options:

1. The first option is `"double"`, `"single"` or `"backtick"` for double-quotes, single-quotes or backticks respectively. The default is `"double"`.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/semi-spacing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Enforce spacing before and after semicolons (semi-spacing)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

JavaScript allows you to place unnecessary spaces before or after a semicolon.

Disallowing or enforcing space around a semicolon can improve the readability of your program.
Expand All @@ -10,8 +12,6 @@ var a = "b" ;
var c = "d";var e = "f";
```

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule aims to enforce spacing around a semicolon. This rule prevents the use of spaces before a semicolon in expressions.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/semi.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Enforce or Disallow Semicolons (semi)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

JavaScript is unique amongst the C-like languages in that it doesn't require semicolons at the end of each statement. In many cases, the JavaScript engine can determine that a semicolon should be in a certain spot and will automatically add it. This feature is known as **automatic semicolon insertion (ASI)** and is considered one of the more controversial features of JavaScript. For example, the following lines are both valid:

```js
Expand Down Expand Up @@ -57,8 +59,6 @@ Although ASI allows for more freedom over your coding style, it can also make yo

This rule is aimed at ensuring consistent use of semicolons. You can decide whether or not to require semicolons at the end of statements.

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Options

The rule takes one or two options. The first one is a string, which could be `"always"` or `"never"`. The default is `"always"`. The second one is an object for more fine-grained configuration when the first option is `"always"`.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/space-after-keywords.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

**Replacement notice**: This rule was removed in ESLint v2.0 and replaced by [keyword-spacing](keyword-spacing.md) rule.

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixed problems reported by this rule.

Some style guides will require or disallow spaces following the certain keywords.

```js
Expand All @@ -18,8 +20,6 @@ if(condition) {
}
```

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule will enforce consistency of spacing after the keywords `if`, `else`, `for`, `while`, `do`, `switch`, `try`, `catch`, `finally`, and `with`.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/space-before-blocks.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Require Or Disallow Space Before Blocks (space-before-blocks)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

Consistency is an important part of any style guide.
While it is a personal preference where to put the opening brace of blocks,
it should be consistent across a whole project.
Having an inconsistent style distracts the reader from seeing the important parts of the code.

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule will enforce consistency of spacing before blocks. It is only applied on blocks that don’t begin on a new line.
Expand Down
4 changes: 2 additions & 2 deletions docs/rules/space-before-function-paren.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Require or disallow a space before function parenthesis (space-before-function-paren)

(fixable) The --fix option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems reported by this rule.

When formatting a function, whitespace is allowed between the function name or `function` keyword and the opening paren. Named functions also require a space between the `function` keyword and the function name, but anonymous functions require no whitespace. For example:

```js
Expand All @@ -18,8 +20,6 @@ var anonymousWithSpace = function () {};

Style guides may require a space after the `function` keyword for anonymous functions, while others specify no whitespace. Similarly, the space after a function name may or may not be required.

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule aims to enforce consistent spacing before function parentheses and as such, will warn whenever whitespace doesn't match the preferences specified.
Expand Down

0 comments on commit d2ff1af

Please sign in to comment.