Skip to content
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

(Chore) Update configs #533

Merged
merged 2 commits into from
Jul 25, 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
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,16 @@ Enforce all the rules in this category, as well as all higher priority rules, wi
| | Rule ID | Description |
|:---|:--------|:------------|
| :wrench: | [vue/attribute-hyphenation](./docs/rules/attribute-hyphenation.md) | enforce attribute naming style on custom components in template |
| :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 |
| :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 |
| :wrench: | [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 |
| :wrench: | [vue/prop-name-casing](./docs/rules/prop-name-casing.md) | enforce specific casing for the Prop name in Vue components |
| | [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 |
Expand All @@ -216,21 +219,26 @@ Enforce all the rules in this category, as well as all higher priority rules, wi
|:---|:--------|:------------|
| :wrench: | [vue/attributes-order](./docs/rules/attributes-order.md) | enforce order of attributes |
| :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/no-use-v-if-with-v-for](./docs/rules/no-use-v-if-with-v-for.md) | disallow use v-if on the same element as v-for |
| | [vue/no-v-html](./docs/rules/no-v-html.md) | disallow use of v-html to prevent XSS attack |
| :wrench: | [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: | [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 |
| | [vue/no-use-v-if-with-v-for](./docs/rules/no-use-v-if-with-v-for.md) | disallow use v-if on the same element as v-for |
| | [vue/no-v-html](./docs/rules/no-v-html.md) | disallow use of v-html to prevent XSS attack |
| :wrench: | [vue/prop-name-casing](./docs/rules/prop-name-casing.md) | enforce specific casing for the Prop name in Vue components |
| :wrench: | [vue/script-indent](./docs/rules/script-indent.md) | enforce consistent indentation in `<script>` |

### Deprecated

> - :warning: We're going to remove deprecated rules in the next major release. Please migrate to successor/new rules.
> - :innocent: We don't fix bugs which are in deprecated rules since we don't have enough resources.

| Rule ID | Replaced by |
|:--------|:------------|
| [vue/no-confusing-v-for-v-if](./docs/rules/no-confusing-v-for-v-if.md) | [vue/no-use-v-if-with-v-for](./docs/rules/no-use-v-if-with-v-for.md) |

<!--RULES_TABLE_END-->

## :couple: FAQ
Expand Down
1 change: 1 addition & 0 deletions docs/rules/html-closing-bracket-newline.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# require or disallow a line break before tag's closing brackets (vue/html-closing-bracket-newline)

- :gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.
- :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.

People have own preference about the location of closing brackets.
Expand Down
1 change: 1 addition & 0 deletions docs/rules/html-closing-bracket-spacing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# require or disallow a space before tag's closing brackets (vue/html-closing-bracket-spacing)

- :gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.
- :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.

This rule enforces consistent spacing style before closing brackets `>` of tags.
Expand Down
1 change: 1 addition & 0 deletions docs/rules/no-confusing-v-for-v-if.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 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"`.
- :warning: This rule was **deprecated** and replaced by [vue/no-use-v-if-with-v-for](no-use-v-if-with-v-for.md) rule.

> 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
2 changes: 2 additions & 0 deletions docs/rules/no-use-v-if-with-v-for.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# disallow use v-if on the same element as v-for (vue/no-use-v-if-with-v-for)

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

> Never use `v-if` on the same element as `v-for`.
>
> There are two common cases where this can be tempting:
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-v-html.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# disallow use of v-html to prevent XSS attack (vue/no-v-html)

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

This rule reports use of `v-html` directive in order to reduce the risk of injecting potentially unsafe / unescaped html into the browser leading to Cross Side Scripting (XSS) attacks.

## :book: Rule Details
Expand Down
1 change: 1 addition & 0 deletions docs/rules/prop-name-casing.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# enforce specific casing for the Prop name in Vue components (vue/prop-name-casing)

- :gear: This rule is included in `"plugin:vue/strongly-recommended"` and `"plugin:vue/recommended"`.
- :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.

This rule would enforce proper casing of props in vue components(camelCase).
Expand Down
2 changes: 1 addition & 1 deletion eslint-internal-rules/require-meta-docs-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function getRuleInfo (ast) {
return currentExports
}, {})

return Object.prototype.hasOwnProperty.call(exportNodes, 'create') && isNormalFunctionExpression(exportNodes.create)
return Object.prototype.hasOwnProperty.call(exportNodes, 'create')
? Object.assign({ isNewStyle: !exportsIsFunction, meta: null }, exportNodes)
: null
}
Expand Down
6 changes: 2 additions & 4 deletions lib/configs/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
* in order to update it's content execute "npm run update"
*/
module.exports = {
root: true,
parser: require.resolve('vue-eslint-parser'),
parserOptions: {
ecmaVersion: 2015,
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
experimentalObjectRestSpread: true
jsx: true
}
},
env: {
Expand Down
3 changes: 2 additions & 1 deletion lib/configs/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ module.exports = {
rules: {
'vue/attributes-order': 'error',
'vue/html-quotes': 'error',
'vue/no-confusing-v-for-v-if': 'error',
'vue/no-use-v-if-with-v-for': 'error',
'vue/no-v-html': 'error',
'vue/order-in-components': 'error',
'vue/this-in-template': 'error'
}
Expand Down
3 changes: 3 additions & 0 deletions lib/configs/strongly-recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ module.exports = {
extends: require.resolve('./essential'),
rules: {
'vue/attribute-hyphenation': 'error',
'vue/html-closing-bracket-newline': 'error',
'vue/html-closing-bracket-spacing': 'error',
'vue/html-end-tags': 'error',
'vue/html-indent': 'error',
'vue/html-self-closing': 'error',
'vue/max-attributes-per-line': 'error',
'vue/mustache-interpolation-spacing': 'error',
'vue/name-property-casing': 'error',
'vue/no-multi-spaces': 'error',
'vue/prop-name-casing': 'error',
'vue/require-default-prop': 'error',
'vue/require-prop-types': 'error',
'vue/v-bind-style': 'error',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/attributes-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ module.exports = {
docs: {
description: 'enforce order of attributes',
category: 'recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/attributes-order.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/attributes-order.md'
},
fixable: 'code',
schema: {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/html-closing-bracket-newline.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = {
meta: {
docs: {
description: "require or disallow a line break before tag's closing brackets",
category: undefined,
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/html-closing-bracket-newline.md'
},
fixable: 'whitespace',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/html-closing-bracket-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports = {
meta: {
docs: {
description: 'require or disallow a space before tag\'s closing brackets',
category: undefined,
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/html-closing-bracket-spacing.md'
},
schema: [{
Expand Down
4 changes: 3 additions & 1 deletion lib/rules/no-confusing-v-for-v-if.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ module.exports = {
docs: {
description: 'disallow confusing `v-for` and `v-if` on the same element',
category: 'recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/no-confusing-v-for-v-if.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/no-confusing-v-for-v-if.md',
replacedBy: ['no-use-v-if-with-v-for']
},
deprecated: true,
fixable: null,
schema: []
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-use-v-if-with-v-for.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = {
meta: {
docs: {
description: 'disallow use v-if on the same element as v-for',
category: undefined,
category: 'recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/no-use-v-if-with-v-for.md'
},
fixable: null,
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-v-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
meta: {
docs: {
description: 'disallow use of v-html to prevent XSS attack',
category: undefined,
category: 'recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/no-v-html.md'
},
fixable: null,
Expand Down
5 changes: 2 additions & 3 deletions lib/rules/prop-name-casing.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce specific casing for the Prop name in Vue components',
category: undefined, // 'strongly-recommended'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/prop-name-casing.md'
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/prop-name-casing.md'
},
fixable: 'code', // null or "code" or "whitespace"
schema: [
Expand All @@ -100,6 +100,5 @@ module.exports = {
}
]
},

create
}
4 changes: 1 addition & 3 deletions tools/update-lib-configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ function formatCategory (category, prevCategory) {
* in order to update it's content execute "npm run update"
*/
module.exports = {
root: true,
parser: require.resolve('vue-eslint-parser'),
parserOptions: {
ecmaVersion: 2015,
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
experimentalObjectRestSpread: true
}
},
env: {
Expand Down