Skip to content

chore: add type to all rules #673

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 3 commits into from
Nov 23, 2018
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
1 change: 1 addition & 0 deletions lib/rules/attribute-hyphenation.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const casing = require('../utils/casing')

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce attribute naming style on custom components in template',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/attributes-order.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function create (context) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce order of attributes',
category: 'recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/comment-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function processLine (context, comment) {

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'support comment-directives in `<template>`',
category: 'base',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/component-name-in-template-casing.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const defaultCase = 'PascalCase'

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce specific casing for the component naming style in template',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/html-closing-bracket-newline.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function getPhrase (lineBreaks) {

module.exports = {
meta: {
type: 'layout',
docs: {
description: "require or disallow a line break before tag's closing brackets",
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/html-closing-bracket-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function parseOptions (options, tokens) {

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'require or disallow a space before tag\'s closing brackets',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/html-end-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce end tag style',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/html-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = {
return utils.defineTemplateBodyVisitor(context, visitor)
},
meta: {
type: 'layout',
docs: {
description: 'enforce consistent indentation in `<template>`',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/html-quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'enforce quotes style of HTML attributes',
category: 'recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/html-self-closing.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function isEmpty (node, sourceCode) {

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'enforce self-closing style',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/jsx-uses-vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ SOFTWARE.

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'prevent variables used in JSX to be marked as unused', // eslint-disable-line consistent-docs-description
category: 'base',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/max-attributes-per-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'enforce the maximum number of attributes per line',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/multiline-html-element-content-newline.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function isEmpty (node, sourceCode) {

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'require a line break before and after the contents of a multiline element',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/mustache-interpolation-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'enforce unified spacing in mustache interpolations',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/name-property-casing.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const allowedCaseOptions = ['PascalCase', 'kebab-case']

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce specific casing for the name property in Vue components',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-async-in-computed-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function isPromise (node) {

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'disallow asynchronous actions in computed properties',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-confusing-v-for-v-if.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function isUsingIterationVar (vIf) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow confusing `v-for` and `v-if` on the same element',
category: 'recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-dupe-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const GROUP_NAMES = ['props', 'computed', 'data', 'methods']

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'disallow duplication of field names',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-duplicate-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function getName (attribute) {

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'disallow duplication of attributes',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-multi-spaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const isProperty = (context, node) => {

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'disallow multiple spaces',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-parsing-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const DEFAULT_OPTIONS = Object.freeze(Object.assign(Object.create(null), {

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'disallow parsing errors in `<template>`',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-reserved-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const GROUP_NAMES = ['props', 'computed', 'data', 'methods']

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow overwriting reserved keys',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-shared-component-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function getFirstAndLastTokens (node, sourceCode) {

module.exports = {
meta: {
type: 'problem',
docs: {
description: "enforce component's data property to be a function",
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-side-effects-in-computed-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'disallow side effects in computed properties',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-spaces-around-equal-signs-in-attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'disallow spaces around equal signs in attribute',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-template-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'disallow `key` attribute on `<template>`',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-template-shadow.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const GROUP_NAMES = ['props', 'computed', 'data', 'methods']

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow variable declarations from shadowing variables declared in the outer scope',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-textarea-mustache.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'disallow mustaches in `<textarea>`',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-unused-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const casing = require('../utils/casing')

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow registering components that are not used inside templates',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-unused-vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow unused variable definitions of v-for directives or scope attributes',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-use-v-if-with-v-for.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function getVForUsingIterationVar (vIf) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow use v-if on the same element as v-for',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-v-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow use of v-html to prevent XSS attack',
category: 'recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/order-in-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ function isNotSideEffectsNode (node, visitorKeys) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce order of properties in components',
category: 'recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/prop-name-casing.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function create (context) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce specific casing for the Prop name in Vue components',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/require-component-is.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'require `v-bind:is` of `<component>` elements',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/require-default-prop.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const NATIVE_TYPES = new Set([

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'require default value for props',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/require-prop-type-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const isForbiddenType = node => forbiddenTypes.indexOf(node.type) > -1 && node.r

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'require prop type to be a constructor',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/require-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'require type definitions in props',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/require-render-return.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'enforce render function to always return value',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/require-v-for-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'require `v-bind:key` with `v-for` directives',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/require-valid-default-prop.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const NATIVE_TYPES = new Set([

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce props default values to be valid',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/return-in-computed-property.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'enforce that a return statement is present in computed property',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/script-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const indentCommon = require('../utils/indent-common')

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'enforce consistent indentation in `<script>`',
category: undefined,
Expand Down
1 change: 1 addition & 0 deletions lib/rules/singleline-html-element-content-newline.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function isEmpty (node, sourceCode) {

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'require a line break before and after the contents of a singleline element',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/this-in-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const RESERVED_NAMES = new Set(require('../utils/js-reserved.json'))

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce usage of `this` in template',
category: 'recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/use-v-on-exact.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce usage of `exact` modifier on `v-on`',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/v-bind-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'enforce `v-bind` directive style',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/v-on-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'layout',
docs: {
description: 'enforce `v-on` directive style',
category: 'strongly-recommended',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/valid-template-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const utils = require('../utils')

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'enforce valid template root',
category: 'essential',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/valid-v-bind.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const VALID_MODIFIERS = new Set(['prop', 'camel', 'sync'])

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'enforce valid `v-bind` directives',
category: 'essential',
Expand Down
Loading