Socket
Socket
Sign inDemoInstall

eslint-plugin-vue

Package Overview
Dependencies
Maintainers
4
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-vue - npm Package Compare versions

Comparing version 4.5.0 to 4.6.0

lib/rules/no-use-v-if-with-v-for.js

1

lib/index.js

@@ -35,2 +35,3 @@ /*

'no-unused-vars': require('./rules/no-unused-vars'),
'no-use-v-if-with-v-for': require('./rules/no-use-v-if-with-v-for'),
'order-in-components': require('./rules/order-in-components'),

@@ -37,0 +38,0 @@ 'prop-name-casing': require('./rules/prop-name-casing'),

@@ -17,5 +17,5 @@ /**

docs: {
description: 'enforce attribute naming style in template',
description: 'enforce attribute naming style on custom components in template',
category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/attribute-hyphenation.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/attribute-hyphenation.md'
},

@@ -26,2 +26,20 @@ fixable: 'code',

enum: ['always', 'never']
},
{
type: 'object',
properties: {
'ignore': {
type: 'array',
items: {
allOf: [
{ type: 'string' },
{ not: { type: 'string', pattern: ':exit$' }},
{ not: { type: 'string', pattern: '^\\s*$' }}
]
},
uniqueItems: true,
additionalItems: false
}
},
additionalProperties: false
}

@@ -33,5 +51,11 @@ ]

const sourceCode = context.getSourceCode()
const options = context.options[0]
const useHyphenated = options !== 'never'
const option = context.options[0]
const optionsPayload = context.options[1]
const useHyphenated = option !== 'never'
const ignoredAttributes = ['data-', 'aria-', 'slot-scope']
if (optionsPayload && optionsPayload.ignore) {
ignoredAttributes.push(optionsPayload.ignore)
}
const caseConverter = casing.getConverter(useHyphenated ? 'kebab-case' : 'camelCase')

@@ -54,5 +78,10 @@

function isIgnoredAttribute (value) {
if (value.indexOf('data-') !== -1 || value.indexOf('aria-') !== -1) {
const isIgnored = ignoredAttributes.some(function (attr) {
return value.indexOf(attr) !== -1
})
if (isIgnored) {
return true
}
return useHyphenated ? value.toLowerCase() === value : !/-/.test(value)

@@ -59,0 +88,0 @@ }

3

lib/rules/attributes-order.js

@@ -111,3 +111,4 @@ /**

description: 'enforce order of attributes',
category: 'recommended'
category: 'recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/attributes-order.md'
},

@@ -114,0 +115,0 @@ fixable: 'code',

@@ -112,3 +112,3 @@ /**

category: 'base',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/comment-directive.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/comment-directive.md'
},

@@ -115,0 +115,0 @@ schema: []

@@ -35,3 +35,3 @@ /**

category: undefined,
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/html-closing-bracket-newline.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/html-closing-bracket-newline.md'
},

@@ -38,0 +38,0 @@ fixable: 'whitespace',

@@ -56,3 +56,3 @@ /**

category: undefined,
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/html-closing-bracket-spacing.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/html-closing-bracket-spacing.md'
},

@@ -59,0 +59,0 @@ schema: [{

@@ -23,3 +23,3 @@ /**

category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/html-end-tags.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/html-end-tags.md'
},

@@ -26,0 +26,0 @@ fixable: 'code',

@@ -32,3 +32,3 @@ /**

category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/html-indent.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/html-indent.md'
},

@@ -35,0 +35,0 @@ fixable: 'whitespace',

@@ -23,3 +23,3 @@ /**

category: 'recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/html-quotes.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/html-quotes.md'
},

@@ -26,0 +26,0 @@ fixable: 'code',

@@ -91,3 +91,3 @@ /**

category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/html-self-closing.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/html-self-closing.md'
},

@@ -94,0 +94,0 @@ fixable: 'code',

@@ -42,3 +42,3 @@ // the following rule is based on yannickcr/eslint-plugin-react

category: 'base',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/jsx-uses-vars.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/jsx-uses-vars.md'
},

@@ -45,0 +45,0 @@ schema: []

@@ -17,3 +17,3 @@ /**

category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/max-attributes-per-line.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/max-attributes-per-line.md'
},

@@ -20,0 +20,0 @@ fixable: 'whitespace', // or "code" or "whitespace"

@@ -22,3 +22,3 @@ /**

category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/mustache-interpolation-spacing.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/mustache-interpolation-spacing.md'
},

@@ -25,0 +25,0 @@ fixable: 'whitespace',

@@ -20,3 +20,3 @@ /**

category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/name-property-casing.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/name-property-casing.md'
},

@@ -23,0 +23,0 @@ fixable: 'code', // or "code" or "whitespace"

@@ -67,3 +67,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/no-async-in-computed-properties.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/no-async-in-computed-properties.md'
},

@@ -70,0 +70,0 @@ fixable: null,

@@ -42,3 +42,3 @@ /**

category: 'recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/no-confusing-v-for-v-if.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/no-confusing-v-for-v-if.md'
},

@@ -45,0 +45,0 @@ fixable: null,

@@ -20,3 +20,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/no-dupe-keys.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/no-dupe-keys.md'
},

@@ -23,0 +23,0 @@ fixable: null, // or "code" or "whitespace"

@@ -42,3 +42,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/no-duplicate-attributes.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/no-duplicate-attributes.md'
},

@@ -45,0 +45,0 @@ fixable: null,

@@ -16,3 +16,3 @@ /**

category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/no-multi-spaces.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/no-multi-spaces.md'
},

@@ -19,0 +19,0 @@ fixable: 'whitespace', // or "code" or "whitespace"

@@ -61,3 +61,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/no-parsing-error.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/no-parsing-error.md'
},

@@ -64,0 +64,0 @@ fixable: null,

@@ -21,3 +21,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/no-reserved-keys.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/no-reserved-keys.md'
},

@@ -24,0 +24,0 @@ fixable: null,

@@ -43,3 +43,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/no-shared-component-data.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/no-shared-component-data.md'
},

@@ -46,0 +46,0 @@ fixable: 'code',

@@ -18,3 +18,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/no-side-effects-in-computed-properties.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/no-side-effects-in-computed-properties.md'
},

@@ -45,3 +45,3 @@ fixable: null,

'CallExpression' (node) {
const code = context.getSourceCode().getText(node)
const code = utils.parseMemberOrCallExpression(node)
const MUTATION_REGEX = /(this.)((?!(concat|slice|map|filter)\().)[^\)]*((push|pop|shift|unshift|reverse|splice|sort|copyWithin|fill)\()/g

@@ -48,0 +48,0 @@

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/no-template-key.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/no-template-key.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/no-textarea-mustache.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/no-textarea-mustache.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -18,3 +18,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/no-unused-vars.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/no-unused-vars.md'
},

@@ -21,0 +21,0 @@ fixable: null,

@@ -138,3 +138,3 @@ /**

category: 'recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/order-in-components.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/order-in-components.md'
},

@@ -141,0 +141,0 @@ fixable: 'code', // null or "code" or "whitespace"

@@ -93,3 +93,4 @@ /**

description: 'enforce specific casing for the Prop name in Vue components',
category: undefined // 'strongly-recommended'
category: undefined, // 'strongly-recommended'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/prop-name-casing.md'
},

@@ -96,0 +97,0 @@ fixable: 'code', // null or "code" or "whitespace"

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/require-component-is.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/require-component-is.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -18,3 +18,3 @@ /**

category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/require-default-prop.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/require-default-prop.md'
},

@@ -54,3 +54,6 @@ fixable: null, // or "code" or "whitespace"

const propDefaultNode = prop.value.properties
.find(p => p.key && p.key.name === 'default')
.find(p =>
p.key &&
(p.key.name === 'default' || p.key.value === 'default')
)

@@ -57,0 +60,0 @@ return Boolean(propDefaultNode)

@@ -18,3 +18,3 @@ /**

category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/require-prop-types.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/require-prop-types.md'
},

@@ -21,0 +21,0 @@ fixable: null, // or "code" or "whitespace"

@@ -18,3 +18,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/require-render-return.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/require-render-return.md'
},

@@ -21,0 +21,0 @@ fixable: null, // or "code" or "whitespace"

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/require-v-for-key.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/require-v-for-key.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -27,3 +27,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/require-valid-default-prop.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/require-valid-default-prop.md'
},

@@ -30,0 +30,0 @@ fixable: null,

@@ -18,3 +18,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/return-in-computed-property.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/return-in-computed-property.md'
},

@@ -21,0 +21,0 @@ fixable: null, // or "code" or "whitespace"

@@ -22,3 +22,3 @@ /**

category: undefined,
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/script-indent.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/script-indent.md'
},

@@ -25,0 +25,0 @@ fixable: 'whitespace',

@@ -23,3 +23,3 @@ /**

category: 'recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/this-in-template.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/this-in-template.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -23,3 +23,3 @@ /**

category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/v-bind-style.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/v-bind-style.md'
},

@@ -26,0 +26,0 @@ fixable: 'code',

@@ -23,3 +23,3 @@ /**

category: 'strongly-recommended',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/v-on-style.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/v-on-style.md'
},

@@ -26,0 +26,0 @@ fixable: 'code',

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-template-root.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-template-root.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -29,3 +29,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-v-bind.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-v-bind.md'
},

@@ -32,0 +32,0 @@ fixable: null,

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-v-cloak.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-v-cloak.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-v-else-if.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-v-else-if.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-v-else.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-v-else.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -109,3 +109,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-v-for.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-v-for.md'
},

@@ -112,0 +112,0 @@ fixable: null,

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-v-html.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-v-html.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-v-if.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-v-if.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -85,3 +85,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-v-model.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-v-model.md'
},

@@ -88,0 +88,0 @@ fixable: null,

@@ -118,3 +118,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-v-on.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-v-on.md'
},

@@ -121,0 +121,0 @@ fixable: null,

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-v-once.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-v-once.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-v-pre.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-v-pre.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-v-show.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-v-show.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -23,3 +23,3 @@ /**

category: 'essential',
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.5.0/docs/rules/valid-v-text.md'
url: 'https://github.com/vuejs/eslint-plugin-vue/blob/v4.6.0/docs/rules/valid-v-text.md'
},

@@ -26,0 +26,0 @@ fixable: null,

@@ -347,2 +347,3 @@ /**

.filter(p =>
p.type === 'Property' &&
p.key.type === 'Identifier' &&

@@ -621,3 +622,40 @@ p.key.name === 'get' &&

return body.errors.some(error => typeof error.code === 'string' && error.code.startsWith('eof-'))
},
/**
* Parse CallExpression or MemberExpression to get simplified version without arguments
*
* @param {Object} node The node to parse (MemberExpression | CallExpression)
* @return {String} eg. 'this.asd.qwe().map().filter().test.reduce()'
*/
parseMemberOrCallExpression (node) {
const parsedCallee = []
let n = node
let isFunc
while (n.type === 'MemberExpression' || n.type === 'CallExpression') {
if (n.type === 'CallExpression') {
n = n.callee
isFunc = true
} else {
if (n.computed) {
parsedCallee.push('[]')
} else if (n.property.type === 'Identifier') {
parsedCallee.push(n.property.name + (isFunc ? '()' : ''))
}
isFunc = false
n = n.object
}
}
if (n.type === 'Identifier') {
parsedCallee.push(n.name)
}
if (n.type === 'ThisExpression') {
parsedCallee.push('this')
}
return parsedCallee.reverse().join('.').replace(/\.\[/g, '[')
}
}
{
"name": "eslint-plugin-vue",
"version": "4.5.0",
"version": "4.6.0",
"description": "Official ESLint plugin for Vue.js",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -48,2 +48,13 @@ # eslint-plugin-vue

### Single File Components
ESLint only targets `.js` files by default. You must include the `.vue` extension using [the `--ext` option](https://eslint.org/docs/user-guide/configuring#specifying-file-extensions-to-lint) or a glob pattern.
Examples:
```bash
eslint --ext .js,.vue src
eslint src/**/*.{js,vue}
```
### Attention

@@ -176,3 +187,3 @@

|:---|:--------|:------------|
| :wrench: | [vue/attribute-hyphenation](./docs/rules/attribute-hyphenation.md) | enforce attribute naming style in template |
| :wrench: | [vue/attribute-hyphenation](./docs/rules/attribute-hyphenation.md) | enforce attribute naming style on custom components in template |
| :wrench: | [vue/html-end-tags](./docs/rules/html-end-tags.md) | enforce end tag style |

@@ -214,2 +225,3 @@ | :wrench: | [vue/html-indent](./docs/rules/html-indent.md) | enforce consistent indentation in `<template>` |

| :wrench: | [vue/html-closing-bracket-spacing](./docs/rules/html-closing-bracket-spacing.md) | require or disallow a space before tag's closing brackets |
| | [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 |
| :wrench: | [vue/prop-name-casing](./docs/rules/prop-name-casing.md) | enforce specific casing for the Prop name in Vue components |

@@ -246,3 +258,3 @@ | :wrench: | [vue/script-indent](./docs/rules/script-indent.md) | enforce consistent indentation in `<script>` |

1. Make sure you don't have `eslint-plugin-html` in your config. The `eslint-plugin-html` extracts the content from `<script>` tags, but `eslint-vue-plugin` requires `<script>` tags and `<template>` tags in order to distinguish template and script in single file components.
1. Make sure you don't have `eslint-plugin-html` in your config. The `eslint-plugin-html` extracts the content from `<script>` tags, but `eslint-plugin-vue` requires `<script>` tags and `<template>` tags in order to distinguish template and script in single file components.

@@ -258,3 +270,3 @@ ```diff

- CLI targets only `.js` files by default. You have to specify additional extensions by `--ext` option or glob patterns. E.g. `eslint "src/**/*.{js,vue}"` or `eslint src --ext .vue`.
- VSCode targets only JavaScript or HTML files by default. You have to add `{"autoFix": true, "language": "vue"}` into `eslint.validate` entry.
- VSCode targets only JavaScript or HTML files by default. You have to add `"vue"` to the `"eslint.validate"` array in vscode settings. e.g. `"eslint.validate": [ "javascript", "javascriptreact", "vue" ]`

@@ -261,0 +273,0 @@ ## :anchor: Semantic Versioning Policy

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc