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

README.md

Lines changed: 14 additions & 6 deletions
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

docs/rules/html-closing-bracket-newline.md

Lines changed: 1 addition & 0 deletions
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.

docs/rules/html-closing-bracket-spacing.md

Lines changed: 1 addition & 0 deletions
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.

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

Lines changed: 1 addition & 0 deletions
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
>

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

Lines changed: 2 additions & 0 deletions
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:

docs/rules/no-v-html.md

Lines changed: 2 additions & 0 deletions
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

docs/rules/prop-name-casing.md

Lines changed: 1 addition & 0 deletions
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).

eslint-internal-rules/require-meta-docs-url.js

Lines changed: 1 addition & 1 deletion
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
}

lib/configs/base.js

Lines changed: 2 additions & 4 deletions
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: {

lib/configs/recommended.js

Lines changed: 2 additions & 1 deletion
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
}

0 commit comments

Comments
 (0)