Skip to content

⚠️ Add support for deprecated state in update-rules ⚠️ #121

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 2 commits into from
Aug 2, 2017
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,24 @@ No rules are enabled by `plugin:vue/base` config. The `plugin:vue/recommended` c

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

Deprecated rules witch should be used with caution and only enabled when you know what you are doing have a warning :warning: icon.

<!--RULES_TABLE_START-->

### Best Practices

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


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

| | Rule ID | Description |
|:---|:--------|:------------|
| | [no-dupe-keys](./docs/rules/no-dupe-keys.md) | Prevents duplication of field names. |
| :white_check_mark: | [no-invalid-template-root](./docs/rules/no-invalid-template-root.md) | disallow invalid template root. |
| :white_check_mark: | [no-invalid-v-bind](./docs/rules/no-invalid-v-bind.md) | disallow invalid `v-bind` directives. |
| :white_check_mark: | [no-invalid-v-cloak](./docs/rules/no-invalid-v-cloak.md) | disallow invalid `v-cloak` directives. |
Expand All @@ -112,6 +116,7 @@ The `--fix` option on the command line automatically fixes problems reported by
| :white_check_mark: | [no-invalid-v-show](./docs/rules/no-invalid-v-show.md) | disallow invalid `v-show` directives. |
| :white_check_mark: | [no-invalid-v-text](./docs/rules/no-invalid-v-text.md) | disallow invalid `v-text` directives. |
| :white_check_mark: | [no-parsing-error](./docs/rules/no-parsing-error.md) | disallow parsing errors in `<template>`. |
| | [no-reservered-keys](./docs/rules/no-reservered-keys.md) | Prevent overwrite reserved keys. |
| | [no-shared-component-data](./docs/rules/no-shared-component-data.md) | Enforces component's data property to be a function. |
| | [no-template-key](./docs/rules/no-template-key.md) | disallow `key` attribute on `<template>`. |
| | [return-in-computed-property](./docs/rules/return-in-computed-property.md) | Enforces that a return statement is present in computed property. |
Expand Down
3 changes: 3 additions & 0 deletions lib/recommended-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
"vue/name-property-casing": "off",
"vue/no-async-in-computed-properties": "off",
"vue/no-confusing-v-for-v-if": "error",
"vue/no-dupe-keys": "off",
"vue/no-duplicate-attributes": "off",
"vue/no-invalid-template-root": "error",
"vue/no-invalid-v-bind": "error",
Expand All @@ -27,12 +28,14 @@ module.exports = {
"vue/no-invalid-v-show": "error",
"vue/no-invalid-v-text": "error",
"vue/no-parsing-error": "error",
"vue/no-reservered-keys": "off",
"vue/no-shared-component-data": "off",
"vue/no-side-effects-in-computed-properties": "off",
"vue/no-template-key": "off",
"vue/no-textarea-mustache": "error",
"vue/order-in-components": "off",
"vue/require-component-is": "error",
"vue/require-prop-types": "off",
"vue/require-v-for-key": "error",
"vue/return-in-computed-property": "off",
"vue/v-bind-style": "off",
Expand Down
5 changes: 3 additions & 2 deletions tools/update-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const readmeContent = fs.readFileSync(readmeFile, 'utf8')

const STAR = ':white_check_mark:'
const PEN = ':wrench:'
const WARN = ':warning:'

const rules = fs.readdirSync(root)
.filter(file => path.extname(file) === '.js')
Expand Down Expand Up @@ -53,9 +54,9 @@ ${
.map(entry => {
const name = entry[0]
const meta = entry[1].meta
const mark = `${meta.docs.recommended ? STAR : ''}${meta.fixable ? PEN : ''}`
const mark = `${meta.docs.recommended ? STAR : ''}${meta.fixable ? PEN : ''}${meta.deprecated ? WARN : ''}`
const link = `[${name}](./docs/rules/${name}.md)`
const description = meta.docs.description || '(no description)'
const description = (meta.docs.description || '(no description)') + (meta.deprecated ? ' - (deprecated)' : '')
return `| ${mark} | ${link} | ${description} |`
})
.join('\n')
Expand Down