Skip to content

Commit

Permalink
Docs: Add URL to rule documentation to the metadata (#340)
Browse files Browse the repository at this point in the history
ESLint v4.15.0 added an official location for rules to store a URL to
their documentation in the rule metadata in eslint/eslint#9788. This
adds the URL to all the existing rules so anything consuming them can
know where their documentation is without having to resort to external
packages to guess.
  • Loading branch information
Arcanemagus authored and mysticatea committed Jan 9, 2018
1 parent 9f83c5a commit 085f1ca
Show file tree
Hide file tree
Showing 50 changed files with 100 additions and 50 deletions.
3 changes: 2 additions & 1 deletion lib/rules/attribute-hyphenation.js
Expand Up @@ -59,7 +59,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce attribute naming style in template',
category: 'strongly-recommended'
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/attribute-hyphenation.md'
},
fixable: 'code',
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/comment-directive.js
Expand Up @@ -124,7 +124,8 @@ module.exports = {
meta: {
docs: {
description: 'support comment-directives in `<template>`', // eslint-disable-line consistent-docs-description
category: 'base'
category: 'base',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/comment-directive.md'
},
schema: []
},
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/html-closing-bracket-newline.js
Expand Up @@ -77,7 +77,8 @@ module.exports = {
meta: {
docs: {
description: "require or disallow a line break before tag's closing brackets",
category: undefined
category: undefined,
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-closing-bracket-newline.md'
},
fixable: 'whitespace',
schema: [{
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/html-closing-bracket-spacing.js
Expand Up @@ -52,7 +52,8 @@ module.exports = {
meta: {
docs: {
description: 'require or disallow a space before tag\'s closing brackets',
category: undefined
category: undefined,
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-closing-bracket-spacing.md'
},
schema: [{
type: 'object',
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/html-end-tags.js
Expand Up @@ -61,7 +61,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce end tag style',
category: 'strongly-recommended'
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-end-tags.md'
},
fixable: 'code',
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/html-indent.js
Expand Up @@ -28,7 +28,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce consistent indentation in `<template>`',
category: 'strongly-recommended'
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-indent.md'
},
fixable: 'whitespace',
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/html-quotes.js
Expand Up @@ -70,7 +70,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce quotes style of HTML attributes',
category: 'recommended'
category: 'recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-quotes.md'
},
fixable: 'code',
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/html-self-closing.js
Expand Up @@ -152,7 +152,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce self-closing style',
category: 'strongly-recommended'
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-self-closing.md'
},
fixable: 'code',
schema: {
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/jsx-uses-vars.js
Expand Up @@ -38,7 +38,8 @@ module.exports = {
meta: {
docs: {
description: 'prevent variables used in JSX to be marked as unused', // eslint-disable-line consistent-docs-description
category: 'base'
category: 'base',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/jsx-uses-vars.md'
},
schema: []
},
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/max-attributes-per-line.js
Expand Up @@ -13,7 +13,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce the maximum number of attributes per line',
category: 'strongly-recommended'
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/max-attributes-per-line.md'
},
fixable: null,
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/mustache-interpolation-spacing.js
Expand Up @@ -18,7 +18,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce unified spacing in mustache interpolations',
category: 'strongly-recommended'
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/mustache-interpolation-spacing.md'
},
fixable: 'whitespace',
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/name-property-casing.js
Expand Up @@ -49,7 +49,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce specific casing for the name property in Vue components',
category: 'strongly-recommended'
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/name-property-casing.md'
},
fixable: 'code', // or "code" or "whitespace"
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-async-in-computed-properties.js
Expand Up @@ -148,7 +148,8 @@ module.exports = {
meta: {
docs: {
description: 'disallow asynchronous actions in computed properties',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-async-in-computed-properties.md'
},
fixable: null,
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-confusing-v-for-v-if.js
Expand Up @@ -61,7 +61,8 @@ module.exports = {
meta: {
docs: {
description: 'disallow confusing `v-for` and `v-if` on the same element',
category: 'recommended'
category: 'recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-confusing-v-for-v-if.md'
},
fixable: false,
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-dupe-keys.js
Expand Up @@ -48,7 +48,8 @@ module.exports = {
meta: {
docs: {
description: 'disallow duplication of field names',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-dupe-keys.md'
},
fixable: null, // or "code" or "whitespace"
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-duplicate-attributes.js
Expand Up @@ -89,7 +89,8 @@ module.exports = {
meta: {
docs: {
description: 'disallow duplication of attributes',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-duplicate-attributes.md'
},
fixable: false,

Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-multi-spaces.js
Expand Up @@ -12,7 +12,8 @@ module.exports = {
meta: {
docs: {
description: 'disallow multiple spaces',
category: 'strongly-recommended'
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-multi-spaces.md'
},
fixable: 'whitespace', // or "code" or "whitespace"
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-parsing-error.js
Expand Up @@ -94,7 +94,8 @@ module.exports = {
meta: {
docs: {
description: 'disallow parsing errors in `<template>`',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-parsing-error.md'
},
fixable: false,
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-reserved-keys.js
Expand Up @@ -50,7 +50,8 @@ module.exports = {
meta: {
docs: {
description: 'disallow overwriting reserved keys',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-reserved-keys.md'
},
fixable: null,
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-shared-component-data.js
Expand Up @@ -75,7 +75,8 @@ module.exports = {
meta: {
docs: {
description: "enforce component's data property to be a function",
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-shared-component-data.md'
},
fixable: 'code',
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-side-effects-in-computed-properties.js
Expand Up @@ -64,7 +64,8 @@ module.exports = {
meta: {
docs: {
description: 'disallow side effects in computed properties',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-side-effects-in-computed-properties.md'
},
fixable: null,
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-template-key.js
Expand Up @@ -44,7 +44,8 @@ module.exports = {
meta: {
docs: {
description: 'disallow `key` attribute on `<template>`',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-template-key.md'
},
fixable: false,
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-textarea-mustache.js
Expand Up @@ -46,7 +46,8 @@ module.exports = {
meta: {
docs: {
description: 'disallow mustaches in `<textarea>`',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-textarea-mustache.md'
},
fixable: false,
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-unused-vars.js
Expand Up @@ -43,7 +43,8 @@ module.exports = {
meta: {
docs: {
description: 'disallow unused variable definitions of v-for directives or scope attributes',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-unused-vars.md'
},
fixable: null,
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/order-in-components.js
Expand Up @@ -100,7 +100,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce order of properties in components',
category: 'recommended'
category: 'recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/order-in-components.md'
},
fixable: null,
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/require-component-is.js
Expand Up @@ -44,7 +44,8 @@ module.exports = {
meta: {
docs: {
description: 'require `v-bind:is` of `<component>` elements',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/require-component-is.md'
},
fixable: false,
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/require-default-prop.js
Expand Up @@ -14,7 +14,8 @@ module.exports = {
meta: {
docs: {
description: 'require default value for props',
category: 'strongly-recommended'
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/require-default-prop.md'
},
fixable: null, // or "code" or "whitespace"
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/require-prop-types.js
Expand Up @@ -83,7 +83,8 @@ module.exports = {
meta: {
docs: {
description: 'require type definitions in props',
category: 'strongly-recommended'
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/require-prop-types.md'
},
fixable: null, // or "code" or "whitespace"
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/require-render-return.js
Expand Up @@ -44,7 +44,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce render function to always return value',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/require-render-return.md'
},
fixable: null, // or "code" or "whitespace"
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/require-v-for-key.js
Expand Up @@ -59,7 +59,8 @@ module.exports = {
meta: {
docs: {
description: 'require `v-bind:key` with `v-for` directives',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/require-v-for-key.md'
},
fixable: false,
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/require-valid-default-prop.js
Expand Up @@ -23,7 +23,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce props default values to be valid',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/require-valid-default-prop.md'
},
fixable: null,
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/return-in-computed-property.js
Expand Up @@ -48,7 +48,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce that a return statement is present in computed property',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/return-in-computed-property.md'
},
fixable: null, // or "code" or "whitespace"
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/script-indent.js
Expand Up @@ -21,7 +21,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce consistent indentation in `<script>`',
category: undefined
category: undefined,
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/script-indent.md'
},
fixable: 'whitespace',
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/this-in-template.js
Expand Up @@ -19,7 +19,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce usage of `this` in template',
category: 'recommended'
category: 'recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/this-in-template.md'
},
fixable: null,
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/v-bind-style.js
Expand Up @@ -53,7 +53,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce `v-bind` directive style',
category: 'strongly-recommended'
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/v-bind-style.md'
},
fixable: 'code',
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/v-on-style.js
Expand Up @@ -54,7 +54,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce `v-on` directive style',
category: 'strongly-recommended'
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/v-on-style.md'
},
fixable: 'code',
schema: [
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/valid-template-root.js
Expand Up @@ -113,7 +113,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce valid template root',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/valid-template-root.md'
},
fixable: false,
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/valid-v-bind.js
Expand Up @@ -57,7 +57,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce valid `v-bind` directives',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/valid-v-bind.md'
},
fixable: false,
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/valid-v-cloak.js
Expand Up @@ -58,7 +58,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce valid `v-cloak` directives',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/valid-v-cloak.md'
},
fixable: false,
schema: []
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/valid-v-else-if.js
Expand Up @@ -81,7 +81,8 @@ module.exports = {
meta: {
docs: {
description: 'enforce valid `v-else-if` directives',
category: 'essential'
category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/valid-v-else-if.md'
},
fixable: false,
schema: []
Expand Down

0 comments on commit 085f1ca

Please sign in to comment.