Skip to content

Commit d5da866

Browse files
authored
(Chore) Update configs (#533)
* (Chore) Update configs * (Chore) Update base config, remove root
1 parent d64aa49 commit d5da866

19 files changed

+41
-24
lines changed

Diff for: README.md

+14-6
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,16 @@ Enforce all the rules in this category, as well as all higher priority rules, wi
190190
| | Rule ID | Description |
191191
|:---|:--------|:------------|
192192
| :wrench: | [vue/attribute-hyphenation](./docs/rules/attribute-hyphenation.md) | enforce attribute naming style on custom components in template |
193+
| :wrench: | [vue/html-closing-bracket-newline](./docs/rules/html-closing-bracket-newline.md) | require or disallow a line break before tag's closing brackets |
194+
| :wrench: | [vue/html-closing-bracket-spacing](./docs/rules/html-closing-bracket-spacing.md) | require or disallow a space before tag's closing brackets |
193195
| :wrench: | [vue/html-end-tags](./docs/rules/html-end-tags.md) | enforce end tag style |
194196
| :wrench: | [vue/html-indent](./docs/rules/html-indent.md) | enforce consistent indentation in `<template>` |
195197
| :wrench: | [vue/html-self-closing](./docs/rules/html-self-closing.md) | enforce self-closing style |
196198
| :wrench: | [vue/max-attributes-per-line](./docs/rules/max-attributes-per-line.md) | enforce the maximum number of attributes per line |
197199
| :wrench: | [vue/mustache-interpolation-spacing](./docs/rules/mustache-interpolation-spacing.md) | enforce unified spacing in mustache interpolations |
198200
| :wrench: | [vue/name-property-casing](./docs/rules/name-property-casing.md) | enforce specific casing for the name property in Vue components |
199201
| :wrench: | [vue/no-multi-spaces](./docs/rules/no-multi-spaces.md) | disallow multiple spaces |
202+
| :wrench: | [vue/prop-name-casing](./docs/rules/prop-name-casing.md) | enforce specific casing for the Prop name in Vue components |
200203
| | [vue/require-default-prop](./docs/rules/require-default-prop.md) | require default value for props |
201204
| | [vue/require-prop-types](./docs/rules/require-prop-types.md) | require type definitions in props |
202205
| :wrench: | [vue/v-bind-style](./docs/rules/v-bind-style.md) | enforce `v-bind` directive style |
@@ -216,21 +219,26 @@ Enforce all the rules in this category, as well as all higher priority rules, wi
216219
|:---|:--------|:------------|
217220
| :wrench: | [vue/attributes-order](./docs/rules/attributes-order.md) | enforce order of attributes |
218221
| :wrench: | [vue/html-quotes](./docs/rules/html-quotes.md) | enforce quotes style of HTML attributes |
219-
| | [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 |
222+
| | [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 |
223+
| | [vue/no-v-html](./docs/rules/no-v-html.md) | disallow use of v-html to prevent XSS attack |
220224
| :wrench: | [vue/order-in-components](./docs/rules/order-in-components.md) | enforce order of properties in components |
221225
| | [vue/this-in-template](./docs/rules/this-in-template.md) | enforce usage of `this` in template |
222226

223227
### Uncategorized
224228

225229
| | Rule ID | Description |
226230
|:---|:--------|:------------|
227-
| :wrench: | [vue/html-closing-bracket-newline](./docs/rules/html-closing-bracket-newline.md) | require or disallow a line break before tag's closing brackets |
228-
| :wrench: | [vue/html-closing-bracket-spacing](./docs/rules/html-closing-bracket-spacing.md) | require or disallow a space before tag's closing brackets |
229-
| | [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 |
230-
| | [vue/no-v-html](./docs/rules/no-v-html.md) | disallow use of v-html to prevent XSS attack |
231-
| :wrench: | [vue/prop-name-casing](./docs/rules/prop-name-casing.md) | enforce specific casing for the Prop name in Vue components |
232231
| :wrench: | [vue/script-indent](./docs/rules/script-indent.md) | enforce consistent indentation in `<script>` |
233232

233+
### Deprecated
234+
235+
> - :warning: We're going to remove deprecated rules in the next major release. Please migrate to successor/new rules.
236+
> - :innocent: We don't fix bugs which are in deprecated rules since we don't have enough resources.
237+
238+
| Rule ID | Replaced by |
239+
|:--------|:------------|
240+
| [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) |
241+
234242
<!--RULES_TABLE_END-->
235243

236244
## :couple: FAQ

Diff for: docs/rules/html-closing-bracket-newline.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# require or disallow a line break before tag's closing brackets (vue/html-closing-bracket-newline)
22

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

56
People have own preference about the location of closing brackets.

Diff for: docs/rules/html-closing-bracket-spacing.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# require or disallow a space before tag's closing brackets (vue/html-closing-bracket-spacing)
22

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

56
This rule enforces consistent spacing style before closing brackets `>` of tags.

Diff for: docs/rules/no-confusing-v-for-v-if.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# disallow confusing `v-for` and `v-if` on the same element (vue/no-confusing-v-for-v-if)
22

33
- :gear: This rule is included in `"plugin:vue/recommended"`.
4+
- :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.
45

56
> 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.
67
>

Diff for: docs/rules/no-use-v-if-with-v-for.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# disallow use v-if on the same element as v-for (vue/no-use-v-if-with-v-for)
22

3+
- :gear: This rule is included in `"plugin:vue/recommended"`.
4+
35
> Never use `v-if` on the same element as `v-for`.
46
>
57
> There are two common cases where this can be tempting:

Diff for: docs/rules/no-v-html.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# disallow use of v-html to prevent XSS attack (vue/no-v-html)
22

3+
- :gear: This rule is included in `"plugin:vue/recommended"`.
4+
35
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.
46

57
## :book: Rule Details

Diff for: docs/rules/prop-name-casing.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# enforce specific casing for the Prop name in Vue components (vue/prop-name-casing)
22

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

56
This rule would enforce proper casing of props in vue components(camelCase).

Diff for: eslint-internal-rules/require-meta-docs-url.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function getRuleInfo (ast) {
112112
return currentExports
113113
}, {})
114114

115-
return Object.prototype.hasOwnProperty.call(exportNodes, 'create') && isNormalFunctionExpression(exportNodes.create)
115+
return Object.prototype.hasOwnProperty.call(exportNodes, 'create')
116116
? Object.assign({ isNewStyle: !exportsIsFunction, meta: null }, exportNodes)
117117
: null
118118
}

Diff for: lib/configs/base.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44
* in order to update it's content execute "npm run update"
55
*/
66
module.exports = {
7-
root: true,
87
parser: require.resolve('vue-eslint-parser'),
98
parserOptions: {
10-
ecmaVersion: 2015,
9+
ecmaVersion: 2018,
1110
sourceType: 'module',
1211
ecmaFeatures: {
13-
jsx: true,
14-
experimentalObjectRestSpread: true
12+
jsx: true
1513
}
1614
},
1715
env: {

Diff for: lib/configs/recommended.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ module.exports = {
88
rules: {
99
'vue/attributes-order': 'error',
1010
'vue/html-quotes': 'error',
11-
'vue/no-confusing-v-for-v-if': 'error',
11+
'vue/no-use-v-if-with-v-for': 'error',
12+
'vue/no-v-html': 'error',
1213
'vue/order-in-components': 'error',
1314
'vue/this-in-template': 'error'
1415
}

Diff for: lib/configs/strongly-recommended.js

+3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ module.exports = {
77
extends: require.resolve('./essential'),
88
rules: {
99
'vue/attribute-hyphenation': 'error',
10+
'vue/html-closing-bracket-newline': 'error',
11+
'vue/html-closing-bracket-spacing': 'error',
1012
'vue/html-end-tags': 'error',
1113
'vue/html-indent': 'error',
1214
'vue/html-self-closing': 'error',
1315
'vue/max-attributes-per-line': 'error',
1416
'vue/mustache-interpolation-spacing': 'error',
1517
'vue/name-property-casing': 'error',
1618
'vue/no-multi-spaces': 'error',
19+
'vue/prop-name-casing': 'error',
1720
'vue/require-default-prop': 'error',
1821
'vue/require-prop-types': 'error',
1922
'vue/v-bind-style': 'error',

Diff for: lib/rules/attributes-order.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ module.exports = {
116116
docs: {
117117
description: 'enforce order of attributes',
118118
category: 'recommended',
119-
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/attributes-order.md'
119+
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/attributes-order.md'
120120
},
121121
fixable: 'code',
122122
schema: {

Diff for: lib/rules/html-closing-bracket-newline.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module.exports = {
3131
meta: {
3232
docs: {
3333
description: "require or disallow a line break before tag's closing brackets",
34-
category: undefined,
34+
category: 'strongly-recommended',
3535
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/html-closing-bracket-newline.md'
3636
},
3737
fixable: 'whitespace',

Diff for: lib/rules/html-closing-bracket-spacing.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module.exports = {
5252
meta: {
5353
docs: {
5454
description: 'require or disallow a space before tag\'s closing brackets',
55-
category: undefined,
55+
category: 'strongly-recommended',
5656
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/html-closing-bracket-spacing.md'
5757
},
5858
schema: [{

Diff for: lib/rules/no-confusing-v-for-v-if.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ module.exports = {
3939
docs: {
4040
description: 'disallow confusing `v-for` and `v-if` on the same element',
4141
category: 'recommended',
42-
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/no-confusing-v-for-v-if.md'
42+
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/no-confusing-v-for-v-if.md',
43+
replacedBy: ['no-use-v-if-with-v-for']
4344
},
45+
deprecated: true,
4446
fixable: null,
4547
schema: []
4648
},

Diff for: lib/rules/no-use-v-if-with-v-for.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module.exports = {
5151
meta: {
5252
docs: {
5353
description: 'disallow use v-if on the same element as v-for',
54-
category: undefined,
54+
category: 'recommended',
5555
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/no-use-v-if-with-v-for.md'
5656
},
5757
fixable: null,

Diff for: lib/rules/no-v-html.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
meta: {
1414
docs: {
1515
description: 'disallow use of v-html to prevent XSS attack',
16-
category: undefined,
16+
category: 'recommended',
1717
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/no-v-html.md'
1818
},
1919
fixable: null,

Diff for: lib/rules/prop-name-casing.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ module.exports = {
9090
meta: {
9191
docs: {
9292
description: 'enforce specific casing for the Prop name in Vue components',
93-
category: undefined, // 'strongly-recommended'
94-
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/prop-name-casing.md'
93+
category: 'strongly-recommended',
94+
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v5.0.0-beta.0/docs/rules/prop-name-casing.md'
9595
},
9696
fixable: 'code', // null or "code" or "whitespace"
9797
schema: [
@@ -100,6 +100,5 @@ module.exports = {
100100
}
101101
]
102102
},
103-
104103
create
105104
}

Diff for: tools/update-lib-configs.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,12 @@ function formatCategory (category, prevCategory) {
3030
* in order to update it's content execute "npm run update"
3131
*/
3232
module.exports = {
33-
root: true,
3433
parser: require.resolve('vue-eslint-parser'),
3534
parserOptions: {
36-
ecmaVersion: 2015,
35+
ecmaVersion: 2018,
3736
sourceType: 'module',
3837
ecmaFeatures: {
3938
jsx: true,
40-
experimentalObjectRestSpread: true
4139
}
4240
},
4341
env: {

0 commit comments

Comments
 (0)