Skip to content

Commit 3d4f0bd

Browse files
committed
doc: add explanation on the rule docs
1 parent cc8420e commit 3d4f0bd

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

docs/rules/charset.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
The corresponding EditorCongig property is `charset`.
44
The backend ESLint rule is [`unicode-bom`](https://eslint.org/docs/rules/unicode-bom)
55

6-
This plugin works only when `utf-8` or `utf-8-bom` is specified. If other value is specified in .editorconfig, ESLint does not verify charset.
7-
ESLint only verifies if BOM is specified or not.
6+
Unlike other rules, this plugin works only when `utf-8` or `utf-8-bom` is specified. If other value is specified in .editorconfig, ESLint does not verify charset. ESLint only verifies if BOM is specified or not.
7+
8+
If you set `charset = utf-8` in .editorconfig, the files **cannot** include a BOM.
9+
If you set `charset = utf-8-bom` in .editorconfig, the files **must** include a BOM.
10+
If you don't set `charset` in .editorconfig or set `charset = unset`, this rule is disabled.
811

912
## Options
1013

docs/rules/eol-last.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
The corresponding EditorCongig property is `insert_final_newline`.
44
The backend ESLint rule is [`eol-last`](https://eslint.org/docs/rules/eol-last)
55

6+
If you set `insert_final_newline = true` in .editorconfig, the files **must** ends with a new line.
7+
If you set `insert_final_newline = false` in .editorconfig, the files **must not** ends with a new line.
8+
If you don't set `insert_final_newline` in .editorconfig or set `insert_final_newline = unset`, this rule is disabled.
9+
610
## Options
711

812
None

docs/rules/indent.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
The corresponding EditorCongig property is `indent_style` and `indent_size`.
44
The backend ESLint rule is [`indent`](https://eslint.org/docs/rules/indent) and [`@typescript-eslint/indent`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/indent.md).
55

6+
If you set `indent_style = space` in .editorconfig, the indent size **must** be the value of `indent_size`.
7+
If you set `indent_style = tab` in .editorconfig, the indent **must** be the tabs.
8+
If you don't set `indent_style` in .editorconfig or set `indent_style = unset`, this rule is disabled.
9+
610
As documented, `@typescript-eslint/indent` is unstable currently. Please read typescript-eslint/typescript-eslint#1824 before using this rule for TypeScript.
711

812
## Options

docs/rules/linebreak-style.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
The corresponding EditorCongig property is `end_of_line`.
44
The backend ESLint rule is [`linebreak-style`](https://eslint.org/docs/rules/linebreak-style)
55

6+
If you set `end_of_line = lf` in .editorconfig, the linebreak code **must** be LF.
7+
If you set `end_of_line = crlf` in .editorconfig, the linebreak code **must** be CRLF.
8+
If you don't set `end_of_line` in .editorconfig or set `end_of_line = unset`, this rule is disabled.
9+
610
`end_of_line = cr` is not supported. When `end_of_line = cr` is specified in .editorconfig, This plugin does nothing.
711

812
## Options

docs/rules/no-trailing-spaces.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
The corresponding EditorCongig property is `trim_trailing_whitespace`.
44
The backend ESLint rule is [`no-trailing-spaces`](https://eslint.org/docs/rules/no-trailing-spaces)
55

6+
If you set `trim_trailing_whitespace = true` in .editorconfig, the trailing spaces **must** be removed.
7+
If you set `trim_trailing_whitespace = false` or `trim_trailing_whitespace = unset`, or you don't set `trim_trailing_whitespace` in .editorconfig, this rule is disabled.
8+
69
## Options
710

811
> * `"skipBlankLines": false` (default) disallows trailing whitespace on empty lines

0 commit comments

Comments
 (0)