Skip to content

Commit

Permalink
Add plugin:yml/standard config
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Jan 12, 2021
1 parent fcf8a35 commit c06d103
Show file tree
Hide file tree
Showing 48 changed files with 149 additions and 98 deletions.
59 changes: 30 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports = {
extends: [
// add more generic rulesets here, such as:
// 'eslint:recommended',
'plugin:yml/recommended'
'plugin:yml/standard'
],
rules: {
// override/add rules settings here, such as:
Expand All @@ -73,7 +73,8 @@ module.exports = {
This plugin provides configs:

- `plugin:yml/base` ... Configuration to enable correct YAML parsing.
- `plugin:yml/recommended` ... Recommended configuration.
- `plugin:yml/recommended` ... Above, plus rules to prevent errors or unintended behavior.
- `plugin:yml/standard` ... Above, plus rules to enforce the common stylistic conventions.

See [the rule list](https://ota-meshi.github.io/eslint-plugin-yml/rules/) to get the `rules` that this plugin provides.

Expand Down Expand Up @@ -122,36 +123,36 @@ The rules with the following star :star: are included in the config.

### YAML Rules

| Rule ID | Description | Fixable | RECOMMENDED |
|:--------|:------------|:-------:|:-----------:|
| [yml/block-mapping-question-indicator-newline](https://ota-meshi.github.io/eslint-plugin-yml/rules/block-mapping-question-indicator-newline.html) | enforce consistent line breaks after `?` indicator | :wrench: | |
| [yml/block-mapping](https://ota-meshi.github.io/eslint-plugin-yml/rules/block-mapping.html) | require or disallow block style mappings. | :wrench: | |
| [yml/block-sequence-hyphen-indicator-newline](https://ota-meshi.github.io/eslint-plugin-yml/rules/block-sequence-hyphen-indicator-newline.html) | enforce consistent line breaks after `-` indicator | :wrench: | |
| [yml/block-sequence](https://ota-meshi.github.io/eslint-plugin-yml/rules/block-sequence.html) | require or disallow block style sequences. | :wrench: | |
| [yml/indent](https://ota-meshi.github.io/eslint-plugin-yml/rules/indent.html) | enforce consistent indentation | :wrench: | |
| [yml/key-name-casing](https://ota-meshi.github.io/eslint-plugin-yml/rules/key-name-casing.html) | enforce naming convention to key names | | |
| [yml/no-empty-document](https://ota-meshi.github.io/eslint-plugin-yml/rules/no-empty-document.html) | disallow empty document | | :star: |
| [yml/no-empty-key](https://ota-meshi.github.io/eslint-plugin-yml/rules/no-empty-key.html) | disallow empty mapping keys | | :star: |
| [yml/no-empty-mapping-value](https://ota-meshi.github.io/eslint-plugin-yml/rules/no-empty-mapping-value.html) | disallow empty mapping values | | :star: |
| [yml/no-empty-sequence-entry](https://ota-meshi.github.io/eslint-plugin-yml/rules/no-empty-sequence-entry.html) | disallow empty sequence entries | | :star: |
| [yml/no-tab-indent](https://ota-meshi.github.io/eslint-plugin-yml/rules/no-tab-indent.html) | disallow tabs for indentation. | | :star: |
| [yml/plain-scalar](https://ota-meshi.github.io/eslint-plugin-yml/rules/plain-scalar.html) | require or disallow plain style scalar. | :wrench: | |
| [yml/quotes](https://ota-meshi.github.io/eslint-plugin-yml/rules/quotes.html) | enforce the consistent use of either double, or single quotes | :wrench: | |
| [yml/require-string-key](https://ota-meshi.github.io/eslint-plugin-yml/rules/require-string-key.html) | disallow mapping keys other than strings | | |
| [yml/vue-custom-block/no-parsing-error](https://ota-meshi.github.io/eslint-plugin-yml/rules/vue-custom-block/no-parsing-error.html) | disallow parsing errors in Vue custom blocks | | :star: |
| Rule ID | Description | Fixable | RECOMMENDED | STANDARD |
|:--------|:------------|:-------:|:-----------:|:--------:|
| [yml/block-mapping-question-indicator-newline](https://ota-meshi.github.io/eslint-plugin-yml/rules/block-mapping-question-indicator-newline.html) | enforce consistent line breaks after `?` indicator | :wrench: | | :star: |
| [yml/block-mapping](https://ota-meshi.github.io/eslint-plugin-yml/rules/block-mapping.html) | require or disallow block style mappings. | :wrench: | | :star: |
| [yml/block-sequence-hyphen-indicator-newline](https://ota-meshi.github.io/eslint-plugin-yml/rules/block-sequence-hyphen-indicator-newline.html) | enforce consistent line breaks after `-` indicator | :wrench: | | :star: |
| [yml/block-sequence](https://ota-meshi.github.io/eslint-plugin-yml/rules/block-sequence.html) | require or disallow block style sequences. | :wrench: | | :star: |
| [yml/indent](https://ota-meshi.github.io/eslint-plugin-yml/rules/indent.html) | enforce consistent indentation | :wrench: | | :star: |
| [yml/key-name-casing](https://ota-meshi.github.io/eslint-plugin-yml/rules/key-name-casing.html) | enforce naming convention to key names | | | |
| [yml/no-empty-document](https://ota-meshi.github.io/eslint-plugin-yml/rules/no-empty-document.html) | disallow empty document | | :star: | :star: |
| [yml/no-empty-key](https://ota-meshi.github.io/eslint-plugin-yml/rules/no-empty-key.html) | disallow empty mapping keys | | :star: | :star: |
| [yml/no-empty-mapping-value](https://ota-meshi.github.io/eslint-plugin-yml/rules/no-empty-mapping-value.html) | disallow empty mapping values | | :star: | :star: |
| [yml/no-empty-sequence-entry](https://ota-meshi.github.io/eslint-plugin-yml/rules/no-empty-sequence-entry.html) | disallow empty sequence entries | | :star: | :star: |
| [yml/no-tab-indent](https://ota-meshi.github.io/eslint-plugin-yml/rules/no-tab-indent.html) | disallow tabs for indentation. | | :star: | :star: |
| [yml/plain-scalar](https://ota-meshi.github.io/eslint-plugin-yml/rules/plain-scalar.html) | require or disallow plain style scalar. | :wrench: | | :star: |
| [yml/quotes](https://ota-meshi.github.io/eslint-plugin-yml/rules/quotes.html) | enforce the consistent use of either double, or single quotes | :wrench: | | :star: |
| [yml/require-string-key](https://ota-meshi.github.io/eslint-plugin-yml/rules/require-string-key.html) | disallow mapping keys other than strings | | | |
| [yml/vue-custom-block/no-parsing-error](https://ota-meshi.github.io/eslint-plugin-yml/rules/vue-custom-block/no-parsing-error.html) | disallow parsing errors in Vue custom blocks | | :star: | :star: |

### Extension Rules

| Rule ID | Description | Fixable | RECOMMENDED |
|:--------|:------------|:-------:|:-----------:|
| [yml/flow-mapping-curly-newline](https://ota-meshi.github.io/eslint-plugin-yml/rules/flow-mapping-curly-newline.html) | enforce consistent line breaks inside braces | :wrench: | |
| [yml/flow-mapping-curly-spacing](https://ota-meshi.github.io/eslint-plugin-yml/rules/flow-mapping-curly-spacing.html) | enforce consistent spacing inside braces | :wrench: | |
| [yml/flow-sequence-bracket-newline](https://ota-meshi.github.io/eslint-plugin-yml/rules/flow-sequence-bracket-newline.html) | enforce linebreaks after opening and before closing flow sequence brackets | :wrench: | |
| [yml/flow-sequence-bracket-spacing](https://ota-meshi.github.io/eslint-plugin-yml/rules/flow-sequence-bracket-spacing.html) | enforce consistent spacing inside flow sequence brackets | :wrench: | |
| [yml/key-spacing](https://ota-meshi.github.io/eslint-plugin-yml/rules/key-spacing.html) | enforce consistent spacing between keys and values in mapping pairs | :wrench: | |
| [yml/no-irregular-whitespace](https://ota-meshi.github.io/eslint-plugin-yml/rules/no-irregular-whitespace.html) | disallow irregular whitespace | | :star: |
| [yml/sort-keys](https://ota-meshi.github.io/eslint-plugin-yml/rules/sort-keys.html) | require mapping keys to be sorted | :wrench: | |
| [yml/spaced-comment](https://ota-meshi.github.io/eslint-plugin-yml/rules/spaced-comment.html) | enforce consistent spacing after the `#` in a comment | :wrench: | |
| Rule ID | Description | Fixable | RECOMMENDED | STANDARD |
|:--------|:------------|:-------:|:-----------:|:--------:|
| [yml/flow-mapping-curly-newline](https://ota-meshi.github.io/eslint-plugin-yml/rules/flow-mapping-curly-newline.html) | enforce consistent line breaks inside braces | :wrench: | | :star: |
| [yml/flow-mapping-curly-spacing](https://ota-meshi.github.io/eslint-plugin-yml/rules/flow-mapping-curly-spacing.html) | enforce consistent spacing inside braces | :wrench: | | :star: |
| [yml/flow-sequence-bracket-newline](https://ota-meshi.github.io/eslint-plugin-yml/rules/flow-sequence-bracket-newline.html) | enforce linebreaks after opening and before closing flow sequence brackets | :wrench: | | :star: |
| [yml/flow-sequence-bracket-spacing](https://ota-meshi.github.io/eslint-plugin-yml/rules/flow-sequence-bracket-spacing.html) | enforce consistent spacing inside flow sequence brackets | :wrench: | | :star: |
| [yml/key-spacing](https://ota-meshi.github.io/eslint-plugin-yml/rules/key-spacing.html) | enforce consistent spacing between keys and values in mapping pairs | :wrench: | | :star: |
| [yml/no-irregular-whitespace](https://ota-meshi.github.io/eslint-plugin-yml/rules/no-irregular-whitespace.html) | disallow irregular whitespace | | :star: | :star: |
| [yml/sort-keys](https://ota-meshi.github.io/eslint-plugin-yml/rules/sort-keys.html) | require mapping keys to be sorted | :wrench: | | |
| [yml/spaced-comment](https://ota-meshi.github.io/eslint-plugin-yml/rules/spaced-comment.html) | enforce consistent spacing after the `#` in a comment | :wrench: | | :star: |

<!--RULES_TABLE_END-->
<!--RULES_SECTION_END-->
Expand Down
54 changes: 27 additions & 27 deletions docs/rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,33 @@ The rules with the following star :star: are included in the `plugin:yml/recomme

## YAML Rules

| Rule ID | Description | Fixable | RECOMMENDED |
|:--------|:------------|:-------:|:-----------:|
| [yml/block-mapping-question-indicator-newline](./block-mapping-question-indicator-newline.md) | enforce consistent line breaks after `?` indicator | :wrench: | |
| [yml/block-mapping](./block-mapping.md) | require or disallow block style mappings. | :wrench: | |
| [yml/block-sequence-hyphen-indicator-newline](./block-sequence-hyphen-indicator-newline.md) | enforce consistent line breaks after `-` indicator | :wrench: | |
| [yml/block-sequence](./block-sequence.md) | require or disallow block style sequences. | :wrench: | |
| [yml/indent](./indent.md) | enforce consistent indentation | :wrench: | |
| [yml/key-name-casing](./key-name-casing.md) | enforce naming convention to key names | | |
| [yml/no-empty-document](./no-empty-document.md) | disallow empty document | | :star: |
| [yml/no-empty-key](./no-empty-key.md) | disallow empty mapping keys | | :star: |
| [yml/no-empty-mapping-value](./no-empty-mapping-value.md) | disallow empty mapping values | | :star: |
| [yml/no-empty-sequence-entry](./no-empty-sequence-entry.md) | disallow empty sequence entries | | :star: |
| [yml/no-tab-indent](./no-tab-indent.md) | disallow tabs for indentation. | | :star: |
| [yml/plain-scalar](./plain-scalar.md) | require or disallow plain style scalar. | :wrench: | |
| [yml/quotes](./quotes.md) | enforce the consistent use of either double, or single quotes | :wrench: | |
| [yml/require-string-key](./require-string-key.md) | disallow mapping keys other than strings | | |
| [yml/vue-custom-block/no-parsing-error](./vue-custom-block/no-parsing-error.md) | disallow parsing errors in Vue custom blocks | | :star: |
| Rule ID | Description | Fixable | RECOMMENDED | STANDARD |
|:--------|:------------|:-------:|:-----------:|:--------:|
| [yml/block-mapping-question-indicator-newline](./block-mapping-question-indicator-newline.md) | enforce consistent line breaks after `?` indicator | :wrench: | | :star: |
| [yml/block-mapping](./block-mapping.md) | require or disallow block style mappings. | :wrench: | | :star: |
| [yml/block-sequence-hyphen-indicator-newline](./block-sequence-hyphen-indicator-newline.md) | enforce consistent line breaks after `-` indicator | :wrench: | | :star: |
| [yml/block-sequence](./block-sequence.md) | require or disallow block style sequences. | :wrench: | | :star: |
| [yml/indent](./indent.md) | enforce consistent indentation | :wrench: | | :star: |
| [yml/key-name-casing](./key-name-casing.md) | enforce naming convention to key names | | | |
| [yml/no-empty-document](./no-empty-document.md) | disallow empty document | | :star: | :star: |
| [yml/no-empty-key](./no-empty-key.md) | disallow empty mapping keys | | :star: | :star: |
| [yml/no-empty-mapping-value](./no-empty-mapping-value.md) | disallow empty mapping values | | :star: | :star: |
| [yml/no-empty-sequence-entry](./no-empty-sequence-entry.md) | disallow empty sequence entries | | :star: | :star: |
| [yml/no-tab-indent](./no-tab-indent.md) | disallow tabs for indentation. | | :star: | :star: |
| [yml/plain-scalar](./plain-scalar.md) | require or disallow plain style scalar. | :wrench: | | :star: |
| [yml/quotes](./quotes.md) | enforce the consistent use of either double, or single quotes | :wrench: | | :star: |
| [yml/require-string-key](./require-string-key.md) | disallow mapping keys other than strings | | | |
| [yml/vue-custom-block/no-parsing-error](./vue-custom-block/no-parsing-error.md) | disallow parsing errors in Vue custom blocks | | :star: | :star: |

## Extension Rules

| Rule ID | Description | Fixable | RECOMMENDED |
|:--------|:------------|:-------:|:-----------:|
| [yml/flow-mapping-curly-newline](./flow-mapping-curly-newline.md) | enforce consistent line breaks inside braces | :wrench: | |
| [yml/flow-mapping-curly-spacing](./flow-mapping-curly-spacing.md) | enforce consistent spacing inside braces | :wrench: | |
| [yml/flow-sequence-bracket-newline](./flow-sequence-bracket-newline.md) | enforce linebreaks after opening and before closing flow sequence brackets | :wrench: | |
| [yml/flow-sequence-bracket-spacing](./flow-sequence-bracket-spacing.md) | enforce consistent spacing inside flow sequence brackets | :wrench: | |
| [yml/key-spacing](./key-spacing.md) | enforce consistent spacing between keys and values in mapping pairs | :wrench: | |
| [yml/no-irregular-whitespace](./no-irregular-whitespace.md) | disallow irregular whitespace | | :star: |
| [yml/sort-keys](./sort-keys.md) | require mapping keys to be sorted | :wrench: | |
| [yml/spaced-comment](./spaced-comment.md) | enforce consistent spacing after the `#` in a comment | :wrench: | |
| Rule ID | Description | Fixable | RECOMMENDED | STANDARD |
|:--------|:------------|:-------:|:-----------:|:--------:|
| [yml/flow-mapping-curly-newline](./flow-mapping-curly-newline.md) | enforce consistent line breaks inside braces | :wrench: | | :star: |
| [yml/flow-mapping-curly-spacing](./flow-mapping-curly-spacing.md) | enforce consistent spacing inside braces | :wrench: | | :star: |
| [yml/flow-sequence-bracket-newline](./flow-sequence-bracket-newline.md) | enforce linebreaks after opening and before closing flow sequence brackets | :wrench: | | :star: |
| [yml/flow-sequence-bracket-spacing](./flow-sequence-bracket-spacing.md) | enforce consistent spacing inside flow sequence brackets | :wrench: | | :star: |
| [yml/key-spacing](./key-spacing.md) | enforce consistent spacing between keys and values in mapping pairs | :wrench: | | :star: |
| [yml/no-irregular-whitespace](./no-irregular-whitespace.md) | disallow irregular whitespace | | :star: | :star: |
| [yml/sort-keys](./sort-keys.md) | require mapping keys to be sorted | :wrench: | | |
| [yml/spaced-comment](./spaced-comment.md) | enforce consistent spacing after the `#` in a comment | :wrench: | | :star: |
1 change: 1 addition & 0 deletions docs/rules/block-mapping-question-indicator-newline.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: "enforce consistent line breaks after `?` indicator"

> enforce consistent line breaks after `?` indicator
- :gear: This rule is included in `"plugin:yml/standard"`.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions docs/rules/block-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: "require or disallow block style mappings."

> require or disallow block style mappings.
- :gear: This rule is included in `"plugin:yml/standard"`.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions docs/rules/block-sequence-hyphen-indicator-newline.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: "enforce consistent line breaks after `-` indicator"

> enforce consistent line breaks after `-` indicator
- :gear: This rule is included in `"plugin:yml/standard"`.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions docs/rules/block-sequence.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: "require or disallow block style sequences."

> require or disallow block style sequences.
- :gear: This rule is included in `"plugin:yml/standard"`.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions docs/rules/flow-mapping-curly-newline.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: "enforce consistent line breaks inside braces"

> enforce consistent line breaks inside braces
- :gear: This rule is included in `"plugin:yml/standard"`.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions docs/rules/flow-mapping-curly-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: "enforce consistent spacing inside braces"

> enforce consistent spacing inside braces
- :gear: This rule is included in `"plugin:yml/standard"`.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions docs/rules/flow-sequence-bracket-newline.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: "enforce linebreaks after opening and before closing flow sequence

> enforce linebreaks after opening and before closing flow sequence brackets
- :gear: This rule is included in `"plugin:yml/standard"`.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions docs/rules/flow-sequence-bracket-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: "enforce consistent spacing inside flow sequence brackets"

> enforce consistent spacing inside flow sequence brackets
- :gear: This rule is included in `"plugin:yml/standard"`.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions docs/rules/indent.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: "enforce consistent indentation"

> enforce consistent indentation
- :gear: This rule is included in `"plugin:yml/standard"`.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions docs/rules/key-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description: "enforce consistent spacing between keys and values in mapping pair

> enforce consistent spacing between keys and values in mapping pairs
- :gear: This rule is included in `"plugin:yml/standard"`.
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-empty-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: "disallow empty document"

> disallow empty document
- :gear: This rule is included in `"plugin:yml/recommended"`.
- :gear: This rule is included in `"plugin:yml/recommended"` and `"plugin:yml/standard"`.

## :book: Rule Details

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-empty-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: "disallow empty mapping keys"

> disallow empty mapping keys
- :gear: This rule is included in `"plugin:yml/recommended"`.
- :gear: This rule is included in `"plugin:yml/recommended"` and `"plugin:yml/standard"`.

## :book: Rule Details

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-empty-mapping-value.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: "disallow empty mapping values"

> disallow empty mapping values
- :gear: This rule is included in `"plugin:yml/recommended"`.
- :gear: This rule is included in `"plugin:yml/recommended"` and `"plugin:yml/standard"`.

## :book: Rule Details

Expand Down

0 comments on commit c06d103

Please sign in to comment.