Skip to content

Commit c149f33

Browse files
armano2michalsnik
authored andcommitted
⚠️ Add support for deprecated state in update-rules ⚠️ (#121)
* Add support for deprecated state in update-rules * Update README
1 parent 39c9df5 commit c149f33

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,24 @@ No rules are enabled by `plugin:vue/base` config. The `plugin:vue/recommended` c
5858

5959
The `--fix` option on the command line automatically fixes problems reported by rules which have a wrench :wrench: below.
6060

61+
Deprecated rules witch should be used with caution and only enabled when you know what you are doing have a warning :warning: icon.
62+
6163
<!--RULES_TABLE_START-->
6264

6365
### Best Practices
6466

6567
| | Rule ID | Description |
6668
|:---|:--------|:------------|
6769
| :wrench: | [html-end-tags](./docs/rules/html-end-tags.md) | enforce end tag style. |
68-
| :wrench: | [html-no-self-closing](./docs/rules/html-no-self-closing.md) | disallow self-closing elements. |
70+
| :wrench::warning: | [html-no-self-closing](./docs/rules/html-no-self-closing.md) | disallow self-closing elements. - (deprecated) |
6971
| | [no-async-in-computed-properties](./docs/rules/no-async-in-computed-properties.md) | Check if there are no asynchronous actions inside computed properties. |
7072
| :white_check_mark: | [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. |
7173
| | [no-duplicate-attributes](./docs/rules/no-duplicate-attributes.md) | disallow duplicate attributes. |
7274
| | [no-side-effects-in-computed-properties](./docs/rules/no-side-effects-in-computed-properties.md) | Don't introduce side effects in computed properties |
7375
| :white_check_mark: | [no-textarea-mustache](./docs/rules/no-textarea-mustache.md) | disallow mustaches in `<textarea>`. |
7476
| | [order-in-components](./docs/rules/order-in-components.md) | Keep order of properties in components |
7577
| :white_check_mark: | [require-component-is](./docs/rules/require-component-is.md) | require `v-bind:is` of `<component>` elements. |
78+
| | [require-prop-types](./docs/rules/require-prop-types.md) | Prop definitions should be detailed |
7679
| :white_check_mark: | [require-v-for-key](./docs/rules/require-v-for-key.md) | require `v-bind:key` with `v-for` directives. |
7780

7881

@@ -97,6 +100,7 @@ The `--fix` option on the command line automatically fixes problems reported by
97100

98101
| | Rule ID | Description |
99102
|:---|:--------|:------------|
103+
| | [no-dupe-keys](./docs/rules/no-dupe-keys.md) | Prevents duplication of field names. |
100104
| :white_check_mark: | [no-invalid-template-root](./docs/rules/no-invalid-template-root.md) | disallow invalid template root. |
101105
| :white_check_mark: | [no-invalid-v-bind](./docs/rules/no-invalid-v-bind.md) | disallow invalid `v-bind` directives. |
102106
| :white_check_mark: | [no-invalid-v-cloak](./docs/rules/no-invalid-v-cloak.md) | disallow invalid `v-cloak` directives. |
@@ -112,6 +116,7 @@ The `--fix` option on the command line automatically fixes problems reported by
112116
| :white_check_mark: | [no-invalid-v-show](./docs/rules/no-invalid-v-show.md) | disallow invalid `v-show` directives. |
113117
| :white_check_mark: | [no-invalid-v-text](./docs/rules/no-invalid-v-text.md) | disallow invalid `v-text` directives. |
114118
| :white_check_mark: | [no-parsing-error](./docs/rules/no-parsing-error.md) | disallow parsing errors in `<template>`. |
119+
| | [no-reservered-keys](./docs/rules/no-reservered-keys.md) | Prevent overwrite reserved keys. |
115120
| | [no-shared-component-data](./docs/rules/no-shared-component-data.md) | Enforces component's data property to be a function. |
116121
| | [no-template-key](./docs/rules/no-template-key.md) | disallow `key` attribute on `<template>`. |
117122
| | [return-in-computed-property](./docs/rules/return-in-computed-property.md) | Enforces that a return statement is present in computed property. |

lib/recommended-rules.js

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = {
1111
"vue/name-property-casing": "off",
1212
"vue/no-async-in-computed-properties": "off",
1313
"vue/no-confusing-v-for-v-if": "error",
14+
"vue/no-dupe-keys": "off",
1415
"vue/no-duplicate-attributes": "off",
1516
"vue/no-invalid-template-root": "error",
1617
"vue/no-invalid-v-bind": "error",
@@ -27,12 +28,14 @@ module.exports = {
2728
"vue/no-invalid-v-show": "error",
2829
"vue/no-invalid-v-text": "error",
2930
"vue/no-parsing-error": "error",
31+
"vue/no-reservered-keys": "off",
3032
"vue/no-shared-component-data": "off",
3133
"vue/no-side-effects-in-computed-properties": "off",
3234
"vue/no-template-key": "off",
3335
"vue/no-textarea-mustache": "error",
3436
"vue/order-in-components": "off",
3537
"vue/require-component-is": "error",
38+
"vue/require-prop-types": "off",
3639
"vue/require-v-for-key": "error",
3740
"vue/return-in-computed-property": "off",
3841
"vue/v-bind-style": "off",

tools/update-rules.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const readmeContent = fs.readFileSync(readmeFile, 'utf8')
2424

2525
const STAR = ':white_check_mark:'
2626
const PEN = ':wrench:'
27+
const WARN = ':warning:'
2728

2829
const rules = fs.readdirSync(root)
2930
.filter(file => path.extname(file) === '.js')
@@ -53,9 +54,9 @@ ${
5354
.map(entry => {
5455
const name = entry[0]
5556
const meta = entry[1].meta
56-
const mark = `${meta.docs.recommended ? STAR : ''}${meta.fixable ? PEN : ''}`
57+
const mark = `${meta.docs.recommended ? STAR : ''}${meta.fixable ? PEN : ''}${meta.deprecated ? WARN : ''}`
5758
const link = `[${name}](./docs/rules/${name}.md)`
58-
const description = meta.docs.description || '(no description)'
59+
const description = (meta.docs.description || '(no description)') + (meta.deprecated ? ' - (deprecated)' : '')
5960
return `| ${mark} | ${link} | ${description} |`
6061
})
6162
.join('\n')

0 commit comments

Comments
 (0)