8000 Chore: rewrite 'npm run update' by mysticatea · Pull Request #332 · vuejs/eslint-plugin-vue · GitHub
[go: up one dir, main page]

Skip to content

Chore: rewrite 'npm run update' #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules
lib/*-rules.js
coverage
.nyc_output
134 changes: 65 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,111 +103,107 @@ Rules are grouped by priority to help you understand their purpose. The `--fix`

Enforce all the rules in this category, as well as all higher priority rules, with:

``` json
"extends": "plugin:vue/base"
```json
{
"extends": "plugin:vue/base"
}
```

| | Rule ID | Description |
|:---|:--------|:------------|
| | [comment-directive](./docs/rules/comment-directive.md) | support comment-directives in `<template>` |
| | [jsx-uses-vars](./docs/rules/jsx-uses-vars.md) | prevent variables used in JSX to be marked as unused |

| | [vue/comment-directive](./docs/rules/comment-directive.md) | support comment-directives in `<template>` |
| | [vue/jsx-uses-vars](./docs/rules/jsx-uses-vars.md) | prevent variables used in JSX to be marked as unused |

### Priority A: Essential (Error Prevention)

Enforce all the rules in this category, as well as all higher priority rules, with:

``` json
"extends": "plugin:vue/essential"
```json
{
"extends": "plugin:vue/essential"
}
```

| | Rule ID | Description |
|:---|:--------|:------------|
| | [no-async-in-computed-properties](./docs/rules/no-async-in-computed-properties.md) | disallow asynchronous actions in computed properties |
| | [no-dupe-keys](./docs/rules/no-dupe-keys.md) | disallow duplication of field 9E88 names |
| | [no-duplicate-attributes](./docs/rules/no-duplicate-attributes.md) | disallow duplication of attributes |
| | [no-parsing-error](./docs/rules/no-parsing-error.md) | disallow parsing errors in `<template>` |
| | [no-reserved-keys](./docs/rules/no-reserved-keys.md) | disallow overwriting reserved keys |
| :wrench: | [no-shared-component-data](./docs/rules/no-shared-component-data.md) | enforce component's data property to be a function |
| | [no-side-effects-in-computed-properties](./docs/rules/no-side-effects-in-computed-properties.md) | disallow side effects in computed properties |
| | [no-template-key](./docs/rules/no-template-key.md) | disallow `key` attribute on `<template>` |
| | [no-textarea-mustache](./docs/rules/no-textarea-mustache.md) | disallow mustaches in `<textarea>` |
| | [no-unused-vars](./docs/rules/no-unused-vars.md) | disallow unused variable definitions of v-for directives or scope attributes |
| | [require-component-is](./docs/rules/require-component-is.md) | require `v-bind:is` of `<component>` elements |
| | [require-render-return](./docs/rules/require-render-return.md) | enforce render function to always return value |
| | [require-v-for-key](./docs/rules/require-v-for-key.md) | require `v-bind:key` with `v-for` directives |
| | [require-valid-default-prop](./docs/rules/require-valid-default-prop.md) | enforce props default values to be valid |
| | [return-in-computed-property](./docs/rules/return-in-computed-property.md) | enforce that a return statement is present in computed property |
| | [valid-template-root](./docs/rules/valid-template-root.md) | enforce valid template root |
| | [valid-v-bind](./docs/rules/valid-v-bind.md) | enforce valid `v-bind` directives |
| | [valid-v-cloak](./docs/rules/valid-v-cloak.md) | enforce valid `v-cloak` directives |
| | [valid-v-else-if](./docs/rules/valid-v-else-if.md) | enforce valid `v-else-if` directives |
| | [valid-v-else](./docs/rules/valid-v-else.md) | enforce valid `v-else` directives |
| | [valid-v-for](./docs/rules/valid-v-for.md) | enforce valid `v-for` directives |
| | [valid-v-html](./docs/rules/valid-v-html.md) | enforce valid `v-html` directives |
| | [valid-v-if](./docs/rules/valid-v-if.md) | enforce valid `v-if` directives |
| | [valid-v-model](./docs/rules/valid-v-model.md) | enforce valid `v-model` directives |
| | [valid-v-on](./docs/rules/valid-v-on.md) | enforce valid `v-on` directives |
| | [valid-v-once](./docs/rules/valid-v-once.md) | enforce valid `v-once` directives |
| | [valid-v-pre](./docs/rules/valid-v-pre.md) | enforce valid `v-pre` directives |
| | [valid-v-show](./docs/rules/valid-v-show.md) | enforce valid `v-show` directives |
| | [valid-v-text](./docs/rules/valid-v-text.md) | enforce valid `v-text` directives |

| | [vue/no-async-in-computed-properties](./docs/rules/no-async-in-computed-properties.md) | disallow asynchronous actions in computed properties |
| | [vue/no-dupe-keys](./docs/rules/no-dupe-keys.md) | disallow duplication of field names |
| | [vue/no-duplicate-attributes](./docs/rules/no-duplicate-attributes.md) | disallow duplication of attributes |
| | [vue/no-parsing-error](./docs/rules/no-parsing-error.md) | disallow parsing errors in `<template>` |
| | [vue/no-reserved-keys](./docs/rules/no-reserved-keys.md) | disallow overwriting reserved keys |
| :wrench: | [vue/no-shared-component-data](./docs/rules/no-shared-component-data.md) | enforce component's data property to be a function |
| | [vue/no-side-effects-in-computed-properties](./docs/rules/no-side-effects-in-computed-properties.md) | disallow side effects in computed properties |
| | [vue/no-template-key](./docs/rules/no-template-key.md) | disallow `key` attribute on `<template>` |
| | [vue/no-textarea-mustache](./docs/rules/no-textarea-mustache.md) | disallow mustaches in `<textarea>` |
| | [vue/no-unused-vars](./docs/rules/no-unused-vars.md) | disallow unused variable definitions of v-for directives or scope attributes |
| | [vue/require-component-is](./docs/rules/require-component-is.md) | require `v-bind:is` of `<component>` elements |
| | [vue/require-render-return](./docs/rules/require-render-return.md) | enforce render function to always return value |
| | [vue/require-v-for-key](./docs/rules/require-v-for-key.md) | require `v-bind:key` with `v-for` directives |
| | [vue/require-valid-default-prop](./docs/rules/require-valid-default-prop.md) | enforce props default values to be valid |
| | [vue/return-in-computed-property](./docs/rules/return-in-computed-property.md) | enforce that a return statement is present in computed property |
| | [vue/valid-template-root](./docs/rules/valid-template-root.md) | enforce valid template root |
| | [vue/valid-v-bind](./docs/rules/valid-v-bind.md) | enforce valid `v-bind` directives |
| | [vue/valid-v-cloak](./docs/rules/valid-v-cloak.md) | enforce valid `v-cloak` directives |
| | [vue/valid-v-else-if](./docs/rules/valid-v-else-if.md) | enforce valid `v-else-if` directives |
| | [vue/valid-v-else](./docs/rules/valid-v-else.md) | enforce valid `v-else` directives |
| | [vue/valid-v-for](./docs/rules/valid-v-for.md) | enforce valid `v-for` directives |
| | [vue/valid-v-html](./docs/rules/valid-v-html.md) | enforce valid `v-html` directives |
| | [vue/valid-v-if](./docs/rules/valid-v-if.md) | enforce valid `v-if` directives |
| | [vue/valid-v-model](./docs/rules/valid-v-model.md) | enforce valid `v-model` directives |
| | [vue/valid-v-on](./docs/rules/valid-v-on.md) | enforce valid `v-on` directives |
| | [vue/valid-v-once](./docs/rules/valid-v-once.md) | enforce valid `v-once` directives |
| | [vue/valid-v-pre](./docs/rules/valid-v-pre.md) | enforce valid `v-pre` directives |
| | [vue/valid-v-show](./docs/rules/valid-v-show.md) | enforce valid `v-show` directives |
| | [vue/valid-v-text](./docs/rules/valid-v-text.md) | enforce valid `v-text` directives |

### Priority B: Strongly Recommended (Improving Readability)

Enforce all the rules in this category, as well as all higher priority rules, with:

``` json
"extends": "plugin:vue/strongly-recommended"
```json
{
"extends": "plugin:vue/strongly-recommended"
}
```

| | Rule ID | Description |
|:---|:--------|:------------|
| :wrench: | [attribute-hyphenation](./docs/rules/attribute-hyphenation.md) | enforce attribute naming style in template |
| :wrench: | [html-end-tags](./docs/rules/html-end-tags.md) | enforce end tag style |
| :wrench: | [html-indent](./docs/rules/html-indent.md) | enforce consistent indentation in `<template>` |
| :wrench: | [html-self-closing](./docs/rules/html-self-closing.md) | enforce self-closing style |
| | [max-attributes-per-line](./docs/rules/max-attributes-per-line.md) | enforce the maximum number of attributes per line |
| :wrench: | [mustache-interpolation-spacing](./docs/rules/mustache-interpolation-spacing.md) | enforce unified spacing in mustache interpolations |
| :wrench: | [name-property-casing](./docs/rules/name-property-casing.md) | enforce specific casing for the name property in Vue components |
| :wrench: | [no-multi-spaces](./docs/rules/no-multi-spaces.md) | disallow multiple spaces |
| | [require-default-prop](./docs/rules/require-default-prop.md) | require default value for props |
| | [require-prop-types](./docs/rules/require-prop-types.md) | require type definitions in props |
| :wrench: | [v-bind-style](./docs/rules/v-bind-style.md) | enforce `v-bind` directive style |
| :wrench: | [v-on-style](./docs/rules/v-on-style.md) | enforce `v-on` directive style |

| :wrench: | [vue/attribute-hyphenation](./docs/rules/attribute-hyphenation.md) | enforce attribute naming style in template |
| :wrench: | [vue/html-end-tags](./docs/rules/html-end-tags.md) | enforce end tag style |
| :wrench: | [vue/html-indent](./docs/rules/html-indent.md) | enforce consistent indentation in `<template>` |
| :wrench: | [vue/html-self-closing](./docs/rules/html-self-closing.md) | enforce self-closing style |
| | [vue/max-attributes-per-line](./docs/rules/max-attributes-per-line.md) | enforce the maximum number of attributes per line |
| :wrench: | [vue/mustache-interpolation-spacing](./docs/rules/mustache-interpolation-spacing.md) | enforce unified spacing in mustache interpolations |
| :wrench: | [vue/name-property-casing](./docs/rules/name-property-casing.md) | enforce specific casing for the name property in Vue components |
| :wrench: | [vue/no-multi-spaces](./docs/rules/no-multi-spaces.md) | disallow multiple spaces |
| | [vue/require-default-prop](./docs/rules/require-default-prop.md) | require default value for props |
| | [vue/require-prop-types](./docs/rules/require-prop-types.md) | require type definitions in props |
| :wrench: | [vue/v-bind-style](./docs/rules/v-bind-style.md) | enforce `v-bind` directive style |
| :wrench: | [vue/v-on-style](./docs/rules/v-on-style.md) | enforce `v-on` directive style |

### Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)

Enforce all the rules in this category, as well as all higher priority rules, with:

``` json
"extends": "plugin:vue/recommended"
```json
{
"extends": "plugin:vue/recommended"
}
```

| | Rule ID | Description |
|:---|:--------|:------------|
| :wrench: | [html-quotes](./docs/rules/html-quotes.md) | enforce quotes style of HTML attributes |
| | [no-confusing-v-for-v-if](./docs/rules/no-confusing-v-for-v-if.md) | disallow confusing `v-for` and `v-if` on the same element |
| | [order-in-components](./docs/rules/order-in-components.md) | enforce order of properties in components |
| | [this-in-template](./docs/rules/this-in-template.md) | enforce usage of `this` in template |


### Uncategorized

| | Rule ID | Description |
|:---|:--------|:------------|
| :wrench: | [html-closing-bracket-newline](./docs/rules/html-closing-bracket-newline.md) | require or disallow a line break before tag's closing brackets |
| :wrench: | [html-closing-bracket-spacing](./docs/rules/html-closing-bracket-spacing.md) | require or disallow a space before tag's closing brackets |

| :wrench: | [vue/html-quotes](./docs/rules/html-quotes.md) | enforce quotes style of HTML attributes |
| | [vue/no-confusing-v-for-v-if](./docs/rules/no-confusing-v-for-v-if.md) | disallow confusing `v-for` and `v-if` on the same element |
| | [vue/order-in-components](./docs/rules/order-in-components.md) | enforce order of properties in components |
| | [vue/this-in-template](./docs/rules/this-in-template.md) | enforce usage of `this` in template |

### Uncategorized

| | Rule ID | Description |
|:---|:--------|:------------|
| :wrench: | [html-closing-bracket-newline](./docs/rules/html-closing-bracket-newline.md) | require or disallow a line break before tag's closing brackets |
| :wrench: | [html-closing-bracket-spacing](./docs/rules/html-closing-bracket-spacing.md) | require or disallow a space before tag's closing brackets |
| :wrench: | [vue/html-closing-bracket-newline](./docs/rules/html-closing-bracket-newline.md) | require or disallow a line break before tag's closing brackets |
| :wrench: | [vue/html-closing-bracket-spacing](./docs/rules/html-closing-bracket-spacing.md) | require or disallow a space before tag's closing brackets |

<!--RULES_TABLE_END-->

Expand Down
3 changes: 2 additions & 1 deletion docs/rules/attribute-hyphenation.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# enforce attribute naming style in template (attribute-hyphenation)
# enforce attribute naming style in template (vue/attribute-hyphenation)

- :gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.
- :wrench: The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.

## :wrench: Options
Expand Down
4 changes: 3 additions & 1 deletion docs/rules/comment-directive.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# support comment-directives in `<template>` (comment-directive)
# support comment-directives in `<template>` (vue/comment-directive)

- :gear: This rule is included in all of `"plugin:vue/base"`, `"plugin:vue/essential"`, `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.

Sole purpose of this rule is to provide `eslint-disable` functionality in `<template>`.
It supports usage of the following comments:
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/html-closing-bracket-newline.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# require or disallow a line break before tag's closing brackets (html-closing-bracket-newline)
# require or disallow a line break before tag's closing brackets (vue/html-closing-bracket-newline)

- :wrench: The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/html-closing-bracket-spacing.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# require or disallow a space before tag's closing brackets (html-closing-bracket-spacing)
# require or disallow a space before tag's closing brackets (vue/html-closing-bracket-spacing)

- :wrench: The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.

Expand Down
3 changes: 2 additions & 1 deletion docs/rules/html-end-tags.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# enforce end tag style (html-end-tags)
# enforce end tag style (vue/html-end-tags)

- :gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.
- :wrench: The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
3 changes: 2 additions & 1 deletion docs/rules/html-indent.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# enforce consistent indentation in `<template>` (html-indent)
# enforce consistent indentation in `<template>` (vue/html-indent)

- :gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.
- :wrench: The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
3 changes: 2 additions & 1 deletion docs/rules/html-quotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# enforce quotes style of HTML attributes (html-quotes)
# enforce quotes style of HTML attributes (vue/html-quotes)

- :gear: This rule is included in `"plugin:vue/recommended"`.
- :wrench: The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.

You can choose quotes of HTML attributes from:
Expand Down
3 changes: 2 additions & 1 deletion docs/rules/html-self-closing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# enforce self-closing style (html-self-closing)
# enforce self-closing style (vue/html-self-closing)

- :gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.
- :wrench: The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.

In Vue.js template, we can use either two styles for elements which don't have their content.
Expand Down
4 changes: 3 additions & 1 deletion docs/rules/jsx-uses-vars.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# prevent variables used in JSX to be marked as unused (jsx-uses-vars)
# prevent variables used in JSX to be marked as unused (vue/jsx-uses-vars)

- :gear: This rule is included in all of `"plugin:vue/base"`, `"plugin:vue/essential"`, `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.

Since 0.17.0 the ESLint `no-unused-vars` rule does not detect variables used in JSX ([see details](http://eslint.org/blog/2015/03/eslint-0.17.0-released#changes-to-jsxreact-handling)).
This rule will find variables used in JSX and mark them as used.
Expand Down
4 changes: 3 additions & 1 deletion docs/rules/max-attributes-per-line.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# enforce the maximum number of attributes per line (max-attributes-per-line)
# enforce the maximum number of attributes per line (vue/max-attributes-per-line)

- :gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.

Limits the maximum number of attributes/properties per line to improve readability.

Expand Down
3 changes: 2 additions & 1 deletion docs/rules/mustache-interpolation-spacing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# enforce unified spacing in mustache interpolations (mustache-interpolation-spacing)
# enforce unified spacing in mustache interpolations (vue/mustache-interpolation-spacing)

- :gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.
- :wrench: The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.

## :book: Rule Details
Expand Down
3 changes: 2 additions & 1 deletion docs/rules/name-property-casing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# enforce specific casing for the name property in Vue components (name-property-casing)
# enforce specific casing for the name property in Vue components (vue/name-property-casing)

- :gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.
- :wrench: The `--fix` option on the [command line](http://eslint.org/docs/user-guide/command-line-interface#fix) can automatically fix some of the problems reported by this rule.

Define a style for the `name` property casing for consistency purposes.
Expand Down
4 changes: 3 additions & 1 deletion docs/rules/no-async-in-computed-properties.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# disallow asynchronous actions in computed properties (no-async-in-computed-properties)
# disallow asynchronous actions in computed properties (vue/no-async-in-computed-properties)

- :gear: This rule is included in all of `"plugin:vue/essential"`, `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.

Computed properties should be synchronous. Asynchronous actions inside them may not work as expected and can lead to an unexpected behaviour, that's why you should avoid them.
If you need async computed properties you might want to consider using additional plugin [vue-async-computed]
Expand Down
4 changes: 3 additions & 1 deletion docs/rules/no-confusing-v-for-v-if.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# disallow confusing `v-for` and `v-if` on the same element (no-confusing-v-for-v-if)
# disallow confusing `v-for` and `v-if` on the same element (vue/no-confusing-v-for-v-if)

- :gear: This rule is included in `"plugin:vue/recommended"`.

> When they exist on the same node, `v-for` has a higher priority than `v-if`. That means the `v-if` will be run on each iteration of the loop separately.
>
Expand Down
4 changes: 3 additions & 1 deletion docs/rules/no-dupe-keys.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# disallow duplication of field names (no-dupe-keys)
# disallow duplication of field names (vue/no-dupe-keys)

- :gear: This rule is included in all of `"plugin:vue/essential"`, `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.

This rule prevents to use duplicated names.

Expand Down
4 changes: 3 additions & 1 deletion docs/rules/no-duplicate-attributes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# disallow duplication of attributes (no-duplicate-attributes)
# disallow duplication of attributes (vue/no-duplicate-attributes)

- :gear: This rule is included in all of `"plugin:vue/essential"`, `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.

When duplicate arguments exist, only the last one is valid.
It's possibly mistakes.
Expand Down
Loading
0