From 856643bbd46f6010d1562f6ca8b1266ac9bcf476 Mon Sep 17 00:00:00 2001
From: IWANABETHATGUY <974153916@qq.com>
Date: Sun, 16 May 2021 16:54:48 +0800
Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20https://github.com/v?=
=?UTF-8?q?uejs/eslint-plugin-vue/issues/1492?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/rules/this-in-template.js | 11 ++++++--
tests/lib/rules/this-in-template.js | 44 +++++++++++++++++++++++++++++
2 files changed, 53 insertions(+), 2 deletions(-)
diff --git a/lib/rules/this-in-template.js b/lib/rules/this-in-template.js
index 8ed42345c..671ac56a0 100644
--- a/lib/rules/this-in-template.js
+++ b/lib/rules/this-in-template.js
@@ -23,7 +23,7 @@ module.exports = {
categories: ['vue3-recommended', 'recommended'],
url: 'https://eslint.vuejs.org/rules/this-in-template.html'
},
- fixable: null,
+ fixable: 'code',
schema: [
{
enum: ['always', 'never']
@@ -91,6 +91,10 @@ module.exports = {
context.report({
node,
loc: node.loc,
+ fix(fixer) {
+ // node.parent should be some code like `this.test`, `this?.['result']`
+ return fixer.replaceText(node.parent, propertyName)
+ },
message: "Unexpected usage of 'this'."
})
}
@@ -116,7 +120,10 @@ module.exports = {
context.report({
node: reference.id,
loc: reference.id.loc,
- message: "Expected 'this'."
+ message: "Expected 'this'.",
+ fix(fixer) {
+ return fixer.insertTextBefore(reference.id, 'this.')
+ }
})
}
}
diff --git a/tests/lib/rules/this-in-template.js b/tests/lib/rules/this-in-template.js
index f2a40ff61..5d081f468 100644
--- a/tests/lib/rules/this-in-template.js
+++ b/tests/lib/rules/this-in-template.js
@@ -121,41 +121,73 @@ function createInvalidTests(prefix, options, message, type) {
return [
{
code: `{{ ${prefix}foo }}
`,
+ output: `{{ ${suggestionPrefix(
+ prefix,
+ options
+ )}foo }}
`,
errors: [{ message, type }],
options
},
{
code: `{{ ${prefix}foo() }}
`,
+ output: `{{ ${suggestionPrefix(
+ prefix,
+ options
+ )}foo() }}
`,
errors: [{ message, type }],
options
},
{
code: `{{ ${prefix}foo.bar() }}
`,
+ output: `{{ ${suggestionPrefix(
+ prefix,
+ options
+ )}foo.bar() }}
`,
errors: [{ message, type }],
options
},
{
code: `
`,
+ output: `
`,
errors: [{ message, type }],
options
},
{
code: `
`,
+ output: `
`,
errors: [{ message, type }],
options
},
{
code: `
`,
+ output: `
`,
errors: [{ message, type }],
options
},
{
code: `
`,
+ output: `
`,
errors: [{ message, type }],
options
},
{
code: `
`,
+ output: `
`,
errors: [{ message, type }],
options
}
@@ -172,11 +204,13 @@ function createInvalidTests(prefix, options, message, type) {
: [
{
code: `{{ this['xs'] }}
`,
+ output: `{{ xs }}
`,
errors: [{ message, type }],
options
},
{
code: `{{ this['xs0AZ_foo'] }}
`,
+ output: `{{ xs0AZ_foo }}
`,
errors: [{ message, type }],
options
}
@@ -225,13 +259,23 @@ ruleTester.run('this-in-template', rule, {
.concat([
{
code: `
`,
+ output: `
`,
errors: ["Unexpected usage of 'this'."],
options: ['never']
},
{
code: `
`,
+ output: `
`,
errors: ["Unexpected usage of 'this'."],
options: ['never']
}
])
})
+
+function suggestionPrefix(prefix, options) {
+ if (options[0] === 'always' && !['this.', 'this?.'].includes(prefix)) {
+ return 'this.'
+ } else {
+ return ''
+ }
+}
From b161c20f358e43722e2e2c8d3fd85b97f77a7480 Mon Sep 17 00:00:00 2001
From: IWANABETHATGUY <974153916@qq.com>
Date: Sun, 16 May 2021 17:00:00 +0800
Subject: [PATCH 2/3] =?UTF-8?q?docs:=20=E2=9C=8F=EF=B8=8F=20update=20doc?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/rules/README.md | 4 ++--
docs/rules/this-in-template.md | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/rules/README.md b/docs/rules/README.md
index e34e4ca2b..9717d49ae 100644
--- a/docs/rules/README.md
+++ b/docs/rules/README.md
@@ -157,7 +157,7 @@ Enforce all the rules in this category, as well as all higher priority rules, wi
| [vue/no-multiple-slot-args](./no-multiple-slot-args.md) | disallow to pass multiple arguments to scoped slots | |
| [vue/no-v-html](./no-v-html.md) | disallow use of v-html to prevent XSS attack | |
| [vue/order-in-components](./order-in-components.md) | enforce order of properties in components | :wrench: |
-| [vue/this-in-template](./this-in-template.md) | disallow usage of `this` in template | |
+| [vue/this-in-template](./this-in-template.md) | disallow usage of `this` in template | :wrench: |
## Priority A: Essential (Error Prevention) for Vue.js 2.x
@@ -267,7 +267,7 @@ Enforce all the rules in this category, as well as all higher priority rules, wi
| [vue/no-multiple-slot-args](./no-multiple-slot-args.md) | disallow to pass multiple arguments to scoped slots | |
| [vue/no-v-html](./no-v-html.md) | disallow use of v-html to prevent XSS attack | |
| [vue/order-in-components](./order-in-components.md) | enforce order of properties in components | :wrench: |
-| [vue/this-in-template](./this-in-template.md) | disallow usage of `this` in template | |
+| [vue/this-in-template](./this-in-template.md) | disallow usage of `this` in template | :wrench: |
## Uncategorized
diff --git a/docs/rules/this-in-template.md b/docs/rules/this-in-template.md
index 7924ad3b5..f193e7e37 100644
--- a/docs/rules/this-in-template.md
+++ b/docs/rules/this-in-template.md
@@ -10,12 +10,13 @@ since: v3.13.0
> disallow usage of `this` in template
- :gear: This rule is included in `"plugin:vue/vue3-recommended"` and `"plugin:vue/recommended"`.
+- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
## :book: Rule Details
This rule aims at preventing usage of `this` in Vue templates.
-
+
```vue
@@ -45,7 +46,7 @@ This rule aims at preventing usage of `this` in Vue templates.
### `"always"`
-
+
```vue
From 58c759d4981d22820948a8867870893e568a9ac4 Mon Sep 17 00:00:00 2001
From: IWANABETHATGUY <974153916@qq.com>
Date: Sun, 16 May 2021 17:05:17 +0800
Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20eslint?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/eslint-code-block.vue | 15 +--
lib/rules/attributes-order.js | 6 +-
lib/rules/component-definition-name-casing.js | 3 +-
.../component-name-in-template-casing.js | 3 +-
lib/rules/experimental-script-setup-vars.js | 5 +-
lib/rules/html-self-closing.js | 6 +-
lib/rules/max-attributes-per-line.js | 9 +-
lib/rules/max-len.js | 3 +-
.../multiline-html-element-content-newline.js | 17 +--
.../new-line-between-multi-line-property.js | 3 +-
.../no-deprecated-data-object-declaration.js | 3 +-
.../no-deprecated-destroyed-lifecycle.js | 3 +-
.../no-deprecated-dollar-listeners-api.js | 3 +-
.../no-deprecated-dollar-scopedslots-api.js | 3 +-
.../no-deprecated-functional-template.js | 3 +-
lib/rules/no-deprecated-props-default-this.js | 3 +-
lib/rules/no-deprecated-scope-attribute.js | 5 +-
.../no-deprecated-slot-scope-attribute.js | 3 +-
.../no-deprecated-v-on-native-modifier.js | 3 +-
.../no-deprecated-v-on-number-modifiers.js | 3 +-
.../no-deprecated-vue-config-keycodes.js | 3 +-
lib/rules/no-extra-parens.js | 3 +-
lib/rules/no-irregular-whitespace.js | 9 +-
.../no-potential-component-option-typo.js | 3 +-
lib/rules/no-restricted-v-bind.js | 5 +-
.../no-side-effects-in-computed-properties.js | 9 +-
...-spaces-around-equal-signs-in-attribute.js | 3 +-
lib/rules/no-useless-mustaches.js | 7 +-
lib/rules/no-useless-v-bind.js | 3 +-
lib/rules/require-explicit-emits.js | 42 +++---
lib/rules/require-toggle-inside-transition.js | 3 +-
...singleline-html-element-content-newline.js | 17 +--
.../syntaxes/dynamic-directive-arguments.js | 3 +-
lib/rules/syntaxes/scope-attribute.js | 3 +-
lib/rules/syntaxes/slot-attribute.js | 3 +-
.../v-bind-prop-modifier-shorthand.js | 3 +-
lib/rules/v-for-delimiter-style.js | 14 +-
lib/rules/v-slot-style.js | 5 +-
lib/utils/indent-common.js | 96 ++++++--------
lib/utils/index.js | 42 +++---
tests/lib/rules/attribute-hyphenation.js | 30 ++---
tests/lib/rules/attributes-order.js | 21 +--
tests/lib/rules/block-spacing.js | 6 +-
tests/lib/rules/block-tag-newline.js | 21 +--
tests/lib/rules/brace-style.js | 3 +-
.../component-name-in-template-casing.js | 3 +-
tests/lib/rules/component-tags-order.js | 9 +-
tests/lib/rules/html-button-has-type.js | 6 +-
.../rules/mustache-interpolation-spacing.js | 6 +-
tests/lib/rules/no-confusing-v-for-v-if.js | 18 +--
tests/lib/rules/no-deprecated-filter.js | 6 +-
.../rules/no-deprecated-inline-template.js | 15 +--
tests/lib/rules/no-deprecated-v-bind-sync.js | 39 ++----
.../no-deprecated-v-on-number-modifiers.js | 9 +-
tests/lib/rules/no-dupe-v-else-if.js | 123 ++++++------------
tests/lib/rules/no-duplicate-attributes.js | 3 +-
tests/lib/rules/no-extra-parens.js | 6 +-
tests/lib/rules/no-irregular-whitespace.js | 7 +-
tests/lib/rules/no-multi-spaces.js | 3 +-
tests/lib/rules/no-multiple-template-root.js | 9 +-
tests/lib/rules/no-parsing-error.js | 3 +-
.../rules/no-restricted-static-attribute.js | 3 +-
tests/lib/rules/no-restricted-v-bind.js | 3 +-
tests/lib/rules/no-template-key.js | 21 +--
tests/lib/rules/no-template-shadow.js | 3 +-
tests/lib/rules/no-template-target-blank.js | 27 ++--
tests/lib/rules/no-textarea-mustache.js | 6 +-
tests/lib/rules/no-unused-vars.js | 48 +++----
tests/lib/rules/no-use-v-if-with-v-for.js | 42 ++----
.../rules/no-v-for-template-key-on-child.js | 30 ++---
tests/lib/rules/no-v-for-template-key.js | 21 +--
tests/lib/rules/no-v-model-argument.js | 6 +-
tests/lib/rules/require-explicit-emits.js | 42 ++----
.../rules/require-toggle-inside-transition.js | 30 ++---
tests/lib/rules/require-v-for-key.js | 57 +++-----
tests/lib/rules/valid-template-root.js | 9 +-
tests/lib/rules/valid-v-bind-sync.js | 42 ++----
tests/lib/rules/valid-v-else-if.js | 42 ++----
tests/lib/rules/valid-v-else.js | 30 ++---
tests/lib/rules/valid-v-for.js | 120 ++++++-----------
tests/lib/rules/valid-v-if.js | 3 +-
tests/lib/rules/valid-v-model.js | 60 +++------
tests/lib/rules/valid-v-slot.js | 12 +-
tools/lib/categories.js | 18 +--
84 files changed, 517 insertions(+), 882 deletions(-)
diff --git a/docs/.vuepress/components/eslint-code-block.vue b/docs/.vuepress/components/eslint-code-block.vue
index 00b694825..381d9985f 100644
--- a/docs/.vuepress/components/eslint-code-block.vue
+++ b/docs/.vuepress/components/eslint-code-block.vue
@@ -122,15 +122,12 @@ export default {
async mounted() {
// Load linter.
- const [
- { default: Linter },
- { default: coreRules },
- { parseForESLint }
- ] = await Promise.all([
- import('eslint4b/dist/linter'),
- import('eslint4b/dist/core-rules'),
- import('espree').then(() => import('vue-eslint-parser'))
- ])
+ const [{ default: Linter }, { default: coreRules }, { parseForESLint }] =
+ await Promise.all([
+ import('eslint4b/dist/linter'),
+ import('eslint4b/dist/core-rules'),
+ import('espree').then(() => import('vue-eslint-parser'))
+ ])
const linter = (this.linter = new Linter())
diff --git a/lib/rules/attributes-order.js b/lib/rules/attributes-order.js
index 8f2917dd7..5af387db0 100644
--- a/lib/rules/attributes-order.js
+++ b/lib/rules/attributes-order.js
@@ -271,10 +271,8 @@ function create(context) {
return
}
- let {
- attr: previousNode,
- position: previousPosition
- } = attributeAndPositions[0]
+ let { attr: previousNode, position: previousPosition } =
+ attributeAndPositions[0]
for (let index = 1; index < attributeAndPositions.length; index++) {
const { attr, position } = attributeAndPositions[index]
diff --git a/lib/rules/component-definition-name-casing.js b/lib/rules/component-definition-name-casing.js
index 1f2e59a85..8e192df5e 100644
--- a/lib/rules/component-definition-name-casing.js
+++ b/lib/rules/component-definition-name-casing.js
@@ -18,8 +18,7 @@ module.exports = {
docs: {
description: 'enforce specific casing for component definition name',
categories: ['vue3-strongly-recommended', 'strongly-recommended'],
- url:
- 'https://eslint.vuejs.org/rules/component-definition-name-casing.html'
+ url: 'https://eslint.vuejs.org/rules/component-definition-name-casing.html'
},
fixable: 'code', // or "code" or "whitespace"
schema: [
diff --git a/lib/rules/component-name-in-template-casing.js b/lib/rules/component-name-in-template-casing.js
index dffca0c88..b2f60a637 100644
--- a/lib/rules/component-name-in-template-casing.js
+++ b/lib/rules/component-name-in-template-casing.js
@@ -30,8 +30,7 @@ module.exports = {
description:
'enforce specific casing for the component naming style in template',
categories: undefined,
- url:
- 'https://eslint.vuejs.org/rules/component-name-in-template-casing.html'
+ url: 'https://eslint.vuejs.org/rules/component-name-in-template-casing.html'
},
fixable: 'code',
schema: [
diff --git a/lib/rules/experimental-script-setup-vars.js b/lib/rules/experimental-script-setup-vars.js
index b209376d6..d215a27b9 100644
--- a/lib/rules/experimental-script-setup-vars.js
+++ b/lib/rules/experimental-script-setup-vars.js
@@ -161,8 +161,9 @@ function parseSetup(code, espree, eslintScope) {
fallback: AST.getFallbackKeys
})
- const variables = /** @type {Variable[]} */ (result.globalScope.childScopes[0]
- .variables)
+ const variables = /** @type {Variable[]} */ (
+ result.globalScope.childScopes[0].variables
+ )
return variables.map((v) => v.name)
}
diff --git a/lib/rules/html-self-closing.js b/lib/rules/html-self-closing.js
index b54c20671..ed4a3dca4 100644
--- a/lib/rules/html-self-closing.js
+++ b/lib/rules/html-self-closing.js
@@ -164,7 +164,8 @@ module.exports = {
name: node.rawName
},
fix(fixer) {
- const tokens = context.parserServices.getTemplateBodyTokenStore()
+ const tokens =
+ context.parserServices.getTemplateBodyTokenStore()
const close = tokens.getLastToken(node.startTag)
if (close.type !== 'HTMLTagClose') {
return null
@@ -188,7 +189,8 @@ module.exports = {
name: node.rawName
},
fix(fixer) {
- const tokens = context.parserServices.getTemplateBodyTokenStore()
+ const tokens =
+ context.parserServices.getTemplateBodyTokenStore()
const close = tokens.getLastToken(node.startTag)
if (close.type !== 'HTMLSelfClosingTagClose') {
return null
diff --git a/lib/rules/max-attributes-per-line.js b/lib/rules/max-attributes-per-line.js
index d50a78d6d..c21604a61 100644
--- a/lib/rules/max-attributes-per-line.js
+++ b/lib/rules/max-attributes-per-line.js
@@ -177,12 +177,11 @@ module.exports = {
// Find the closest token before the current prop
// that is not a white space
- const prevToken = /** @type {Token} */ (template.getTokenBefore(
- prop,
- {
+ const prevToken = /** @type {Token} */ (
+ template.getTokenBefore(prop, {
filter: (token) => token.type !== 'HTMLWhitespace'
- }
- ))
+ })
+ )
/** @type {Range} */
const range = [prevToken.range[1], prop.range[0]]
diff --git a/lib/rules/max-len.js b/lib/rules/max-len.js
index 6de8f8953..773b62649 100644
--- a/lib/rules/max-len.js
+++ b/lib/rules/max-len.js
@@ -209,8 +209,7 @@ module.exports = {
OPTIONS_SCHEMA
],
messages: {
- max:
- 'This line has a length of {{lineLength}}. Maximum allowed is {{maxLength}}.',
+ max: 'This line has a length of {{lineLength}}. Maximum allowed is {{maxLength}}.',
maxComment:
'This line has a comment length of {{lineLength}}. Maximum allowed is {{maxCommentLength}}.'
}
diff --git a/lib/rules/multiline-html-element-content-newline.js b/lib/rules/multiline-html-element-content-newline.js
index 49a675c4b..fa24dd250 100644
--- a/lib/rules/multiline-html-element-content-newline.js
+++ b/lib/rules/multiline-html-element-content-newline.js
@@ -72,8 +72,7 @@ module.exports = {
description:
'require a line break before and after the contents of a multiline element',
categories: ['vue3-strongly-recommended', 'strongly-recommended'],
- url:
- 'https://eslint.vuejs.org/rules/multiline-html-element-content-newline.html'
+ url: 'https://eslint.vuejs.org/rules/multiline-html-element-content-newline.html'
},
fixable: 'whitespace',
schema: [
@@ -179,14 +178,12 @@ module.exports = {
return
}
- const contentFirst = /** @type {Token} */ (template.getTokenAfter(
- element.startTag,
- getTokenOption
- ))
- const contentLast = /** @type {Token} */ (template.getTokenBefore(
- element.endTag,
- getTokenOption
- ))
+ const contentFirst = /** @type {Token} */ (
+ template.getTokenAfter(element.startTag, getTokenOption)
+ )
+ const contentLast = /** @type {Token} */ (
+ template.getTokenBefore(element.endTag, getTokenOption)
+ )
const beforeLineBreaks =
contentFirst.loc.start.line - element.startTag.loc.end.line
diff --git a/lib/rules/new-line-between-multi-line-property.js b/lib/rules/new-line-between-multi-line-property.js
index c1be3618f..f0e3aa550 100644
--- a/lib/rules/new-line-between-multi-line-property.js
+++ b/lib/rules/new-line-between-multi-line-property.js
@@ -55,8 +55,7 @@ module.exports = {
description:
'enforce new lines between multi-line properties in Vue components',
categories: undefined,
- url:
- 'https://eslint.vuejs.org/rules/new-line-between-multi-line-property.html'
+ url: 'https://eslint.vuejs.org/rules/new-line-between-multi-line-property.html'
},
fixable: 'whitespace', // or "code" or "whitespace"
schema: [
diff --git a/lib/rules/no-deprecated-data-object-declaration.js b/lib/rules/no-deprecated-data-object-declaration.js
index 37d280ef6..017e46ec4 100644
--- a/lib/rules/no-deprecated-data-object-declaration.js
+++ b/lib/rules/no-deprecated-data-object-declaration.js
@@ -52,8 +52,7 @@ module.exports = {
description:
'disallow using deprecated object declaration on data (in Vue.js 3.0.0+)',
categories: ['vue3-essential'],
- url:
- 'https://eslint.vuejs.org/rules/no-deprecated-data-object-declaration.html'
+ url: 'https://eslint.vuejs.org/rules/no-deprecated-data-object-declaration.html'
},
fixable: 'code',
schema: [],
diff --git a/lib/rules/no-deprecated-destroyed-lifecycle.js b/lib/rules/no-deprecated-destroyed-lifecycle.js
index c3556084c..6176daa95 100644
--- a/lib/rules/no-deprecated-destroyed-lifecycle.js
+++ b/lib/rules/no-deprecated-destroyed-lifecycle.js
@@ -21,8 +21,7 @@ module.exports = {
description:
'disallow using deprecated `destroyed` and `beforeDestroy` lifecycle hooks (in Vue.js 3.0.0+)',
categories: ['vue3-essential'],
- url:
- 'https://eslint.vuejs.org/rules/no-deprecated-destroyed-lifecycle.html'
+ url: 'https://eslint.vuejs.org/rules/no-deprecated-destroyed-lifecycle.html'
},
fixable: null,
schema: [],
diff --git a/lib/rules/no-deprecated-dollar-listeners-api.js b/lib/rules/no-deprecated-dollar-listeners-api.js
index 97d98359c..64c175be8 100644
--- a/lib/rules/no-deprecated-dollar-listeners-api.js
+++ b/lib/rules/no-deprecated-dollar-listeners-api.js
@@ -20,8 +20,7 @@ module.exports = {
docs: {
description: 'disallow using deprecated `$listeners` (in Vue.js 3.0.0+)',
categories: ['vue3-essential'],
- url:
- 'https://eslint.vuejs.org/rules/no-deprecated-dollar-listeners-api.html'
+ url: 'https://eslint.vuejs.org/rules/no-deprecated-dollar-listeners-api.html'
},
fixable: null,
schema: [],
diff --git a/lib/rules/no-deprecated-dollar-scopedslots-api.js b/lib/rules/no-deprecated-dollar-scopedslots-api.js
index bdfa0f844..eaa9b3328 100644
--- a/lib/rules/no-deprecated-dollar-scopedslots-api.js
+++ b/lib/rules/no-deprecated-dollar-scopedslots-api.js
@@ -21,8 +21,7 @@ module.exports = {
description:
'disallow using deprecated `$scopedSlots` (in Vue.js 3.0.0+)',
categories: ['vue3-essential'],
- url:
- 'https://eslint.vuejs.org/rules/no-deprecated-dollar-scopedslots-api.html'
+ url: 'https://eslint.vuejs.org/rules/no-deprecated-dollar-scopedslots-api.html'
},
fixable: 'code',
schema: [],
diff --git a/lib/rules/no-deprecated-functional-template.js b/lib/rules/no-deprecated-functional-template.js
index e489841b0..7624ddc51 100644
--- a/lib/rules/no-deprecated-functional-template.js
+++ b/lib/rules/no-deprecated-functional-template.js
@@ -21,8 +21,7 @@ module.exports = {
description:
'disallow using deprecated the `functional` template (in Vue.js 3.0.0+)',
categories: ['vue3-essential'],
- url:
- 'https://eslint.vuejs.org/rules/no-deprecated-functional-template.html'
+ url: 'https://eslint.vuejs.org/rules/no-deprecated-functional-template.html'
},
fixable: null,
schema: [],
diff --git a/lib/rules/no-deprecated-props-default-this.js b/lib/rules/no-deprecated-props-default-this.js
index 926476c1e..b194e7915 100644
--- a/lib/rules/no-deprecated-props-default-this.js
+++ b/lib/rules/no-deprecated-props-default-this.js
@@ -20,8 +20,7 @@ module.exports = {
docs: {
description: 'disallow props default function `this` access',
categories: ['vue3-essential'],
- url:
- 'https://eslint.vuejs.org/rules/no-deprecated-props-default-this.html'
+ url: 'https://eslint.vuejs.org/rules/no-deprecated-props-default-this.html'
},
fixable: null,
schema: [],
diff --git a/lib/rules/no-deprecated-scope-attribute.js b/lib/rules/no-deprecated-scope-attribute.js
index e7e22c3d3..dcb5d6270 100644
--- a/lib/rules/no-deprecated-scope-attribute.js
+++ b/lib/rules/no-deprecated-scope-attribute.js
@@ -23,9 +23,8 @@ module.exports = {
},
/** @param {RuleContext} context */
create(context) {
- const templateBodyVisitor = scopeAttribute.createTemplateBodyVisitor(
- context
- )
+ const templateBodyVisitor =
+ scopeAttribute.createTemplateBodyVisitor(context)
return utils.defineTemplateBodyVisitor(context, templateBodyVisitor)
}
}
diff --git a/lib/rules/no-deprecated-slot-scope-attribute.js b/lib/rules/no-deprecated-slot-scope-attribute.js
index 793b1ed6d..c3a08b8e0 100644
--- a/lib/rules/no-deprecated-slot-scope-attribute.js
+++ b/lib/rules/no-deprecated-slot-scope-attribute.js
@@ -14,8 +14,7 @@ module.exports = {
description:
'disallow deprecated `slot-scope` attribute (in Vue.js 2.6.0+)',
categories: ['vue3-essential'],
- url:
- 'https://eslint.vuejs.org/rules/no-deprecated-slot-scope-attribute.html'
+ url: 'https://eslint.vuejs.org/rules/no-deprecated-slot-scope-attribute.html'
},
fixable: 'code',
schema: [],
diff --git a/lib/rules/no-deprecated-v-on-native-modifier.js b/lib/rules/no-deprecated-v-on-native-modifier.js
index 4f60210b0..a37875d6d 100644
--- a/lib/rules/no-deprecated-v-on-native-modifier.js
+++ b/lib/rules/no-deprecated-v-on-native-modifier.js
@@ -21,8 +21,7 @@ module.exports = {
description:
'disallow using deprecated `.native` modifiers (in Vue.js 3.0.0+)',
categories: ['vue3-essential'],
- url:
- 'https://eslint.vuejs.org/rules/no-deprecated-v-on-native-modifier.html'
+ url: 'https://eslint.vuejs.org/rules/no-deprecated-v-on-native-modifier.html'
},
fixable: null,
schema: [],
diff --git a/lib/rules/no-deprecated-v-on-number-modifiers.js b/lib/rules/no-deprecated-v-on-number-modifiers.js
index 24341580a..a7e91a095 100644
--- a/lib/rules/no-deprecated-v-on-number-modifiers.js
+++ b/lib/rules/no-deprecated-v-on-number-modifiers.js
@@ -22,8 +22,7 @@ module.exports = {
description:
'disallow using deprecated number (keycode) modifiers (in Vue.js 3.0.0+)',
categories: ['vue3-essential'],
- url:
- 'https://eslint.vuejs.org/rules/no-deprecated-v-on-number-modifiers.html'
+ url: 'https://eslint.vuejs.org/rules/no-deprecated-v-on-number-modifiers.html'
},
fixable: 'code',
schema: [],
diff --git a/lib/rules/no-deprecated-vue-config-keycodes.js b/lib/rules/no-deprecated-vue-config-keycodes.js
index 4db268e44..c251e9548 100644
--- a/lib/rules/no-deprecated-vue-config-keycodes.js
+++ b/lib/rules/no-deprecated-vue-config-keycodes.js
@@ -17,8 +17,7 @@ module.exports = {
description:
'disallow using deprecated `Vue.config.keyCodes` (in Vue.js 3.0.0+)',
categories: ['vue3-essential'],
- url:
- 'https://eslint.vuejs.org/rules/no-deprecated-vue-config-keycodes.html'
+ url: 'https://eslint.vuejs.org/rules/no-deprecated-vue-config-keycodes.html'
},
fixable: null,
schema: [],
diff --git a/lib/rules/no-extra-parens.js b/lib/rules/no-extra-parens.js
index 3f202fa9d..20c25938e 100644
--- a/lib/rules/no-extra-parens.js
+++ b/lib/rules/no-extra-parens.js
@@ -176,7 +176,8 @@ function createForVueSyntax(context) {
}
return {
- "VAttribute[directive=true][key.name.name='bind'] > VExpressionContainer": verify,
+ "VAttribute[directive=true][key.name.name='bind'] > VExpressionContainer":
+ verify,
'VElement > VExpressionContainer': verify
}
}
diff --git a/lib/rules/no-irregular-whitespace.js b/lib/rules/no-irregular-whitespace.js
index 7c05083b3..1cfbd6129 100644
--- a/lib/rules/no-irregular-whitespace.js
+++ b/lib/rules/no-irregular-whitespace.js
@@ -15,8 +15,10 @@ const utils = require('../utils')
// Constants
// ------------------------------------------------------------------------------
-const ALL_IRREGULARS = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u
-const IRREGULAR_WHITESPACE = /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gmu
+const ALL_IRREGULARS =
+ /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u
+const IRREGULAR_WHITESPACE =
+ /[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gmu
const IRREGULAR_LINE_TERMINATORS = /[\u2028\u2029]/gmu
// ------------------------------------------------------------------------------
@@ -195,7 +197,8 @@ module.exports = {
const bodyVisitor = utils.defineTemplateBodyVisitor(context, {
...(skipHTMLAttributeValues
? {
- 'VAttribute[directive=false] > VLiteral': removeInvalidNodeErrorsInHTMLAttributeValue
+ 'VAttribute[directive=false] > VLiteral':
+ removeInvalidNodeErrorsInHTMLAttributeValue
}
: {}),
...(skipHTMLTextContents
diff --git a/lib/rules/no-potential-component-option-typo.js b/lib/rules/no-potential-component-option-typo.js
index cf3b33cdc..ddd6f386c 100644
--- a/lib/rules/no-potential-component-option-typo.js
+++ b/lib/rules/no-potential-component-option-typo.js
@@ -17,8 +17,7 @@ module.exports = {
description: 'disallow a potential typo in your component property',
categories: undefined,
recommended: false,
- url:
- 'https://eslint.vuejs.org/rules/no-potential-component-option-typo.html'
+ url: 'https://eslint.vuejs.org/rules/no-potential-component-option-typo.html'
},
fixable: null,
schema: [
diff --git a/lib/rules/no-restricted-v-bind.js b/lib/rules/no-restricted-v-bind.js
index 02ac6e399..d15bb4caa 100644
--- a/lib/rules/no-restricted-v-bind.js
+++ b/lib/rules/no-restricted-v-bind.js
@@ -137,9 +137,8 @@ module.exports = {
/** @param {RuleContext} context */
create(context) {
/** @type {ParsedOption[]} */
- const options = (context.options.length === 0
- ? DEFAULT_OPTIONS
- : context.options
+ const options = (
+ context.options.length === 0 ? DEFAULT_OPTIONS : context.options
).map(parseOption)
return utils.defineTemplateBodyVisitor(context, {
diff --git a/lib/rules/no-side-effects-in-computed-properties.js b/lib/rules/no-side-effects-in-computed-properties.js
index 7c0639b95..54ededbdb 100644
--- a/lib/rules/no-side-effects-in-computed-properties.js
+++ b/lib/rules/no-side-effects-in-computed-properties.js
@@ -21,8 +21,7 @@ module.exports = {
docs: {
description: 'disallow side effects in computed properties',
categories: ['vue3-essential', 'essential'],
- url:
- 'https://eslint.vuejs.org/rules/no-side-effects-in-computed-properties.html'
+ url: 'https://eslint.vuejs.org/rules/no-side-effects-in-computed-properties.html'
},
fixable: null,
schema: []
@@ -104,9 +103,9 @@ module.exports = {
}
const targetBody = scopeStack.body
- const computedProperty = /** @type {ComponentComputedProperty[]} */ (computedPropertiesMap.get(
- vueNode
- )).find((cp) => {
+ const computedProperty = /** @type {ComponentComputedProperty[]} */ (
+ computedPropertiesMap.get(vueNode)
+ ).find((cp) => {
return (
cp.value &&
node.loc.start.line >= cp.value.loc.start.line &&
diff --git a/lib/rules/no-spaces-around-equal-signs-in-attribute.js b/lib/rules/no-spaces-around-equal-signs-in-attribute.js
index 8357fbf3d..31c290588 100644
--- a/lib/rules/no-spaces-around-equal-signs-in-attribute.js
+++ b/lib/rules/no-spaces-around-equal-signs-in-attribute.js
@@ -20,8 +20,7 @@ module.exports = {
docs: {
description: 'disallow spaces around equal signs in attribute',
categories: ['vue3-strongly-recommended', 'strongly-recommended'],
- url:
- 'https://eslint.vuejs.org/rules/no-spaces-around-equal-signs-in-attribute.html'
+ url: 'https://eslint.vuejs.org/rules/no-spaces-around-equal-signs-in-attribute.html'
},
fixable: 'whitespace',
schema: []
diff --git a/lib/rules/no-useless-mustaches.js b/lib/rules/no-useless-mustaches.js
index 845c42f9b..8e5a6cee1 100644
--- a/lib/rules/no-useless-mustaches.js
+++ b/lib/rules/no-useless-mustaches.js
@@ -19,9 +19,10 @@ function stripQuotesForHTML(text) {
return text.slice(1, -1)
}
- const re = /^(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])([\s\S]*)(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])$/u.exec(
- text
- )
+ const re =
+ /^(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])([\s\S]*)(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])$/u.exec(
+ text
+ )
if (!re) {
return null
}
diff --git a/lib/rules/no-useless-v-bind.js b/lib/rules/no-useless-v-bind.js
index 5d4dc0067..749a292e4 100644
--- a/lib/rules/no-useless-v-bind.js
+++ b/lib/rules/no-useless-v-bind.js
@@ -145,7 +145,8 @@ module.exports = {
}
return utils.defineTemplateBodyVisitor(context, {
- "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]": verify
+ "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]":
+ verify
})
}
}
diff --git a/lib/rules/require-explicit-emits.js b/lib/rules/require-explicit-emits.js
index ec356364e..797428254 100644
--- a/lib/rules/require-explicit-emits.js
+++ b/lib/rules/require-explicit-emits.js
@@ -387,10 +387,9 @@ function buildSuggest(object, emits, nameNode, context) {
const sourceCode = context.getSourceCode()
const emitsOptionValue = emitsOption.value
if (emitsOptionValue.type === 'ArrayExpression') {
- const leftBracket = /** @type {Token} */ (sourceCode.getFirstToken(
- emitsOptionValue,
- isLeftBracket
- ))
+ const leftBracket = /** @type {Token} */ (
+ sourceCode.getFirstToken(emitsOptionValue, isLeftBracket)
+ )
return [
{
messageId: 'addOneOption',
@@ -406,10 +405,9 @@ function buildSuggest(object, emits, nameNode, context) {
}
]
} else if (emitsOptionValue.type === 'ObjectExpression') {
- const leftBrace = /** @type {Token} */ (sourceCode.getFirstToken(
- emitsOptionValue,
- isLeftBrace
- ))
+ const leftBrace = /** @type {Token} */ (
+ sourceCode.getFirstToken(emitsOptionValue, isLeftBrace)
+ )
return [
{
messageId: 'addOneOption',
@@ -451,14 +449,12 @@ function buildSuggest(object, emits, nameNode, context) {
`,\nemits: ['${nameNode.value}']`
)
} else {
- const objectLeftBrace = /** @type {Token} */ (sourceCode.getFirstToken(
- object,
- isLeftBrace
- ))
- const objectRightBrace = /** @type {Token} */ (sourceCode.getLastToken(
- object,
- isRightBrace
- ))
+ const objectLeftBrace = /** @type {Token} */ (
+ sourceCode.getFirstToken(object, isLeftBrace)
+ )
+ const objectRightBrace = /** @type {Token} */ (
+ sourceCode.getLastToken(object, isRightBrace)
+ )
return fixer.insertTextAfter(
objectLeftBrace,
`\nemits: ['${nameNode.value}']${
@@ -488,14 +484,12 @@ function buildSuggest(object, emits, nameNode, context) {
`,\nemits: {'${nameNode.value}': null}`
)
} else {
- const objectLeftBrace = /** @type {Token} */ (sourceCode.getFirstToken(
- object,
- isLeftBrace
- ))
- const objectRightBrace = /** @type {Token} */ (sourceCode.getLastToken(
- object,
- isRightBrace
- ))
+ const objectLeftBrace = /** @type {Token} */ (
+ sourceCode.getFirstToken(object, isLeftBrace)
+ )
+ const objectRightBrace = /** @type {Token} */ (
+ sourceCode.getLastToken(object, isRightBrace)
+ )
return fixer.insertTextAfter(
objectLeftBrace,
`\nemits: {'${nameNode.value}': null}${
diff --git a/lib/rules/require-toggle-inside-transition.js b/lib/rules/require-toggle-inside-transition.js
index 12b77d741..223e4f9be 100644
--- a/lib/rules/require-toggle-inside-transition.js
+++ b/lib/rules/require-toggle-inside-transition.js
@@ -21,8 +21,7 @@ module.exports = {
description:
'require control the display of the content inside ``',
categories: ['vue3-essential'],
- url:
- 'https://eslint.vuejs.org/rules/require-toggle-inside-transition.html'
+ url: 'https://eslint.vuejs.org/rules/require-toggle-inside-transition.html'
},
fixable: null,
schema: [],
diff --git a/lib/rules/singleline-html-element-content-newline.js b/lib/rules/singleline-html-element-content-newline.js
index 52b5ed1fe..2ac1eba9a 100644
--- a/lib/rules/singleline-html-element-content-newline.js
+++ b/lib/rules/singleline-html-element-content-newline.js
@@ -61,8 +61,7 @@ module.exports = {
description:
'require a line break before and after the contents of a singleline element',
categories: ['vue3-strongly-recommended', 'strongly-recommended'],
- url:
- 'https://eslint.vuejs.org/rules/singleline-html-element-content-newline.html'
+ url: 'https://eslint.vuejs.org/rules/singleline-html-element-content-newline.html'
},
fixable: 'whitespace',
schema: [
@@ -157,14 +156,12 @@ module.exports = {
return
}
- const contentFirst = /** @type {Token} */ (template.getTokenAfter(
- elem.startTag,
- getTokenOption
- ))
- const contentLast = /** @type {Token} */ (template.getTokenBefore(
- elem.endTag,
- getTokenOption
- ))
+ const contentFirst = /** @type {Token} */ (
+ template.getTokenAfter(elem.startTag, getTokenOption)
+ )
+ const contentLast = /** @type {Token} */ (
+ template.getTokenBefore(elem.endTag, getTokenOption)
+ )
context.report({
node: template.getLastToken(elem.startTag),
diff --git a/lib/rules/syntaxes/dynamic-directive-arguments.js b/lib/rules/syntaxes/dynamic-directive-arguments.js
index 9a790e9f7..e670fa3fc 100644
--- a/lib/rules/syntaxes/dynamic-directive-arguments.js
+++ b/lib/rules/syntaxes/dynamic-directive-arguments.js
@@ -20,7 +20,8 @@ module.exports = {
}
return {
- 'VAttribute[directive=true] > VDirectiveKey > VExpressionContainer': reportDynamicArgument
+ 'VAttribute[directive=true] > VDirectiveKey > VExpressionContainer':
+ reportDynamicArgument
}
}
}
diff --git a/lib/rules/syntaxes/scope-attribute.js b/lib/rules/syntaxes/scope-attribute.js
index c356a6750..af7dbcd2f 100644
--- a/lib/rules/syntaxes/scope-attribute.js
+++ b/lib/rules/syntaxes/scope-attribute.js
@@ -23,7 +23,8 @@ module.exports = {
}
return {
- "VAttribute[directive=true] > VDirectiveKey[name.name='scope']": reportScope
+ "VAttribute[directive=true] > VDirectiveKey[name.name='scope']":
+ reportScope
}
}
}
diff --git a/lib/rules/syntaxes/slot-attribute.js b/lib/rules/syntaxes/slot-attribute.js
index 8b4392746..d5fa61898 100644
--- a/lib/rules/syntaxes/slot-attribute.js
+++ b/lib/rules/syntaxes/slot-attribute.js
@@ -128,7 +128,8 @@ module.exports = {
return {
"VAttribute[directive=false][key.name='slot']": reportSlot,
- "VAttribute[directive=true][key.name.name='bind'][key.argument.name='slot']": reportVBindSlot
+ "VAttribute[directive=true][key.name.name='bind'][key.argument.name='slot']":
+ reportVBindSlot
}
}
}
diff --git a/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js b/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
index 219d2b3c9..5a53a9e3a 100644
--- a/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
+++ b/lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
@@ -27,7 +27,8 @@ module.exports = {
}
return {
- "VAttribute[directive=true] > VDirectiveKey[name.name='bind'][name.rawName='.']": reportPropModifierShorthand
+ "VAttribute[directive=true] > VDirectiveKey[name.name='bind'][name.rawName='.']":
+ reportPropModifierShorthand
}
}
}
diff --git a/lib/rules/v-for-delimiter-style.js b/lib/rules/v-for-delimiter-style.js
index ef0086cfe..a50b6a592 100644
--- a/lib/rules/v-for-delimiter-style.js
+++ b/lib/rules/v-for-delimiter-style.js
@@ -40,12 +40,14 @@ module.exports = {
context.parserServices.getTemplateBodyTokenStore &&
context.parserServices.getTemplateBodyTokenStore()
- const delimiterToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- node.left.length
- ? node.left[node.left.length - 1]
- : tokenStore.getFirstToken(node),
- (token) => token.type !== 'Punctuator' || token.value !== ')'
- ))
+ const delimiterToken = /** @type {Token} */ (
+ tokenStore.getTokenAfter(
+ node.left.length
+ ? node.left[node.left.length - 1]
+ : tokenStore.getFirstToken(node),
+ (token) => token.type !== 'Punctuator' || token.value !== ')'
+ )
+ )
if (delimiterToken.value === preferredDelimiter) {
return
diff --git a/lib/rules/v-slot-style.js b/lib/rules/v-slot-style.js
index f0cbe3610..1bb5f57f2 100644
--- a/lib/rules/v-slot-style.js
+++ b/lib/rules/v-slot-style.js
@@ -28,7 +28,10 @@ function normalizeOptions(options) {
}
if (typeof options === 'string') {
- normalized.atComponent = normalized.default = normalized.named = /** @type {"shorthand" | "longform"} */ (options)
+ normalized.atComponent =
+ normalized.default =
+ normalized.named =
+ /** @type {"shorthand" | "longform"} */ (options)
} else if (options != null) {
/** @type {(keyof Options)[]} */
const keys = ['atComponent', 'default', 'named']
diff --git a/lib/utils/indent-common.js b/lib/utils/indent-common.js
index 9e6bfdeff..5f1e23632 100644
--- a/lib/utils/indent-common.js
+++ b/lib/utils/indent-common.js
@@ -739,10 +739,9 @@ module.exports.defineVisitor = function create(
return true
}
if (parent.type === 'CallExpression' || parent.type === 'NewExpression') {
- const openParen = /** @type {Token} */ (tokenStore.getTokenAfter(
- parent.callee,
- isNotRightParen
- ))
+ const openParen = /** @type {Token} */ (
+ tokenStore.getTokenAfter(parent.callee, isNotRightParen)
+ )
return parent.arguments.some(
(param) =>
getFirstAndLastTokens(param, openParen.range[1]).firstToken
@@ -1215,10 +1214,9 @@ module.exports.defineVisitor = function create(
VForExpression(node) {
const firstToken = tokenStore.getFirstToken(node)
const lastOfLeft = last(node.left) || firstToken
- const inToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- lastOfLeft,
- isNotRightParen
- ))
+ const inToken = /** @type {Token} */ (
+ tokenStore.getTokenAfter(lastOfLeft, isNotRightParen)
+ )
const rightToken = tokenStore.getFirstToken(node.right)
if (isLeftParen(firstToken)) {
@@ -1296,10 +1294,9 @@ module.exports.defineVisitor = function create(
node
) {
const leftToken = getChainHeadToken(node)
- const opToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- node.left,
- isNotRightParen
- ))
+ const opToken = /** @type {Token} */ (
+ tokenStore.getTokenAfter(node.left, isNotRightParen)
+ )
const rightToken = tokenStore.getTokenAfter(opToken)
const prevToken = tokenStore.getTokenBefore(leftToken)
const shouldIndent =
@@ -1392,15 +1389,13 @@ module.exports.defineVisitor = function create(
ConditionalExpression(node) {
const prevToken = tokenStore.getTokenBefore(node)
const firstToken = tokenStore.getFirstToken(node)
- const questionToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- node.test,
- isNotRightParen
- ))
+ const questionToken = /** @type {Token} */ (
+ tokenStore.getTokenAfter(node.test, isNotRightParen)
+ )
const consequentToken = tokenStore.getTokenAfter(questionToken)
- const colonToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- node.consequent,
- isNotRightParen
- ))
+ const colonToken = /** @type {Token} */ (
+ tokenStore.getTokenAfter(node.consequent, isNotRightParen)
+ )
const alternateToken = tokenStore.getTokenAfter(colonToken)
const isFlat =
prevToken &&
@@ -1421,10 +1416,9 @@ module.exports.defineVisitor = function create(
/** @param {DoWhileStatement} node */
DoWhileStatement(node) {
const doToken = tokenStore.getFirstToken(node)
- const whileToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- node.body,
- isNotRightParen
- ))
+ const whileToken = /** @type {Token} */ (
+ tokenStore.getTokenAfter(node.body, isNotRightParen)
+ )
const leftToken = tokenStore.getTokenAfter(whileToken)
const testToken = tokenStore.getTokenAfter(leftToken)
const lastToken = tokenStore.getLastToken(node)
@@ -1464,8 +1458,9 @@ module.exports.defineVisitor = function create(
ExportDefaultDeclaration(node) {
const exportToken = tokenStore.getFirstToken(node)
const defaultToken = tokenStore.getFirstToken(node, 1)
- const declarationToken = getFirstAndLastTokens(node.declaration)
- .firstToken
+ const declarationToken = getFirstAndLastTokens(
+ node.declaration
+ ).firstToken
setOffset([defaultToken, declarationToken], 1, exportToken)
},
/** @param {ExportNamedDeclaration} node */
@@ -1480,10 +1475,9 @@ module.exports.defineVisitor = function create(
if (!firstSpecifier || firstSpecifier.type === 'ExportSpecifier') {
// export {foo, bar}; or export {foo, bar} from "mod";
const leftParenToken = tokenStore.getFirstToken(node, 1)
- const rightParenToken = /** @type {Token} */ (tokenStore.getLastToken(
- node,
- isRightBrace
- ))
+ const rightParenToken = /** @type {Token} */ (
+ tokenStore.getLastToken(node, isRightBrace)
+ )
setOffset(leftParenToken, 0, exportToken)
processNodeList(node.specifiers, leftParenToken, rightParenToken, 1)
@@ -1517,10 +1511,9 @@ module.exports.defineVisitor = function create(
null
const leftParenToken = tokenStore.getTokenAfter(awaitToken || forToken)
const leftToken = tokenStore.getTokenAfter(leftParenToken)
- const inToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- leftToken,
- isNotRightParen
- ))
+ const inToken = /** @type {Token} */ (
+ tokenStore.getTokenAfter(leftToken, isNotRightParen)
+ )
const rightToken = tokenStore.getTokenAfter(inToken)
const rightParenToken = tokenStore.getTokenBefore(
node.body,
@@ -1615,10 +1608,9 @@ module.exports.defineVisitor = function create(
processMaybeBlock(node.consequent, ifToken)
if (node.alternate != null) {
- const elseToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- node.consequent,
- isNotRightParen
- ))
+ const elseToken = /** @type {Token} */ (
+ tokenStore.getTokenAfter(node.consequent, isNotRightParen)
+ )
setOffset(elseToken, 0, ifToken)
processMaybeBlock(node.alternate, elseToken)
@@ -1739,10 +1731,9 @@ module.exports.defineVisitor = function create(
'MemberExpression, MetaProperty'(node) {
const objectToken = tokenStore.getFirstToken(node)
if (node.type === 'MemberExpression' && node.computed) {
- const leftBracketToken = /** @type {Token} */ (tokenStore.getTokenBefore(
- node.property,
- isLeftBracket
- ))
+ const leftBracketToken = /** @type {Token} */ (
+ tokenStore.getTokenBefore(node.property, isLeftBracket)
+ )
const propertyToken = tokenStore.getTokenAfter(leftBracketToken)
const rightBracketToken = tokenStore.getTokenAfter(
node.property,
@@ -1772,15 +1763,13 @@ module.exports.defineVisitor = function create(
/** @type {Token} */
let lastKeyToken
if (node.computed) {
- const keyLeftToken = /** @type {Token} */ (tokenStore.getFirstToken(
- node,
- isLeftBracket
- ))
+ const keyLeftToken = /** @type {Token} */ (
+ tokenStore.getFirstToken(node, isLeftBracket)
+ )
const keyToken = tokenStore.getTokenAfter(keyLeftToken)
- const keyRightToken = (lastKeyToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- node.key,
- isRightBracket
- )))
+ const keyRightToken = (lastKeyToken = /** @type {Token} */ (
+ tokenStore.getTokenAfter(node.key, isRightBracket)
+ ))
if (hasPrefix) {
setOffset(keyLeftToken, 0, /** @type {Token} */ (last(prefixTokens)))
@@ -1864,10 +1853,9 @@ module.exports.defineVisitor = function create(
const switchToken = tokenStore.getFirstToken(node)
const leftParenToken = tokenStore.getTokenAfter(switchToken)
const discriminantToken = tokenStore.getTokenAfter(leftParenToken)
- const leftBraceToken = /** @type {Token} */ (tokenStore.getTokenAfter(
- node.discriminant,
- isLeftBrace
- ))
+ const leftBraceToken = /** @type {Token} */ (
+ tokenStore.getTokenAfter(node.discriminant, isLeftBrace)
+ )
const rightParenToken = tokenStore.getTokenBefore(leftBraceToken)
const rightBraceToken = tokenStore.getLastToken(node)
diff --git a/lib/utils/index.js b/lib/utils/index.js
index 0bcf80169..e78238ee3 100644
--- a/lib/utils/index.js
+++ b/lib/utils/index.js
@@ -266,18 +266,16 @@ module.exports = {
}
if (skipDynamicArgumentsReport) {
- context = wrapContextToOverrideReportMethodToSkipDynamicArgument(
- context
- )
+ context =
+ wrapContextToOverrideReportMethodToSkipDynamicArgument(context)
}
// Move `Program` handlers to `VElement[parent.type!='VElement']`
const coreHandlers = coreRule.create(context)
- const handlers = /** @type {TemplateListener} */ (Object.assign(
- {},
- coreHandlers
- ))
+ const handlers = /** @type {TemplateListener} */ (
+ Object.assign({}, coreHandlers)
+ )
if (handlers.Program) {
handlers["VElement[parent.type!='VElement']"] = handlers.Program
delete handlers.Program
@@ -838,11 +836,14 @@ module.exports = {
if (propValue.type === 'FunctionExpression') {
value = propValue.body
} else if (propValue.type === 'ObjectExpression') {
- const get = /** @type {(Property & { value: FunctionExpression }) | null} */ (findProperty(
- propValue,
- 'get',
- (p) => p.value.type === 'FunctionExpression'
- ))
+ const get =
+ /** @type {(Property & { value: FunctionExpression }) | null} */ (
+ findProperty(
+ propValue,
+ 'get',
+ (p) => p.value.type === 'FunctionExpression'
+ )
+ )
value = get ? get.value.body : null
}
@@ -870,13 +871,16 @@ module.exports = {
}
if (arg.type === 'ObjectExpression') {
- const getProperty = /** @type {(Property & { value: FunctionExpression | ArrowFunctionExpression }) | null} */ (findProperty(
- arg,
- 'get',
- (p) =>
- p.value.type === 'FunctionExpression' ||
- p.value.type === 'ArrowFunctionExpression'
- ))
+ const getProperty =
+ /** @type {(Property & { value: FunctionExpression | ArrowFunctionExpression }) | null} */ (
+ findProperty(
+ arg,
+ 'get',
+ (p) =>
+ p.value.type === 'FunctionExpression' ||
+ p.value.type === 'ArrowFunctionExpression'
+ )
+ )
return getProperty ? getProperty.value : null
}
diff --git a/tests/lib/rules/attribute-hyphenation.js b/tests/lib/rules/attribute-hyphenation.js
index 284017a3e..7e7f2ea9d 100644
--- a/tests/lib/rules/attribute-hyphenation.js
+++ b/tests/lib/rules/attribute-hyphenation.js
@@ -29,26 +29,22 @@ ruleTester.run('attribute-hyphenation', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
options: ['always']
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
options: ['never']
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
options: ['never']
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
options: ['never', { ignore: ['custom-hyphen', 'second-custom'] }]
},
{
@@ -120,8 +116,7 @@ ruleTester.run('attribute-hyphenation', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
output:
'
',
options: ['never'],
@@ -135,8 +130,7 @@ ruleTester.run('attribute-hyphenation', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
output:
'
',
options: ['always'],
@@ -150,8 +144,7 @@ ruleTester.run('attribute-hyphenation', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
output:
'
',
options: ['always', { ignore: [] }],
@@ -165,8 +158,7 @@ ruleTester.run('attribute-hyphenation', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
output:
'
',
options: ['never', { ignore: ['my-prop'] }],
@@ -180,8 +172,7 @@ ruleTester.run('attribute-hyphenation', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
output:
'
',
options: ['always', { ignore: ['secondProp'] }],
@@ -195,8 +186,7 @@ ruleTester.run('attribute-hyphenation', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
output:
'
',
options: ['always', { ignore: ['secondPropID'] }],
diff --git a/tests/lib/rules/attributes-order.js b/tests/lib/rules/attributes-order.js
index c956dae8d..b08ab1612 100644
--- a/tests/lib/rules/attributes-order.js
+++ b/tests/lib/rules/attributes-order.js
@@ -194,13 +194,11 @@ tester.run('attributes-order', rule, {
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
options: [
{
order: [
@@ -221,8 +219,7 @@ tester.run('attributes-order', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
options: [
{
order: [
@@ -546,8 +543,7 @@ tester.run('attributes-order', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
output:
'
',
errors: [
@@ -559,8 +555,7 @@ tester.run('attributes-order', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
options: [
{
order: [
@@ -1317,8 +1312,7 @@ tester.run('attributes-order', rule, {
]
}
],
- code:
- '
',
+ code: '
',
output:
'
',
errors: [
@@ -1348,8 +1342,7 @@ tester.run('attributes-order', rule, {
]
}
],
- code:
- '
',
+ code: '
',
output:
'
',
errors: [
diff --git a/tests/lib/rules/block-spacing.js b/tests/lib/rules/block-spacing.js
index 1c4c531a2..c06d54ec9 100644
--- a/tests/lib/rules/block-spacing.js
+++ b/tests/lib/rules/block-spacing.js
@@ -15,8 +15,7 @@ tester.run('block-spacing', rule, {
valid: [
'
',
{
- code:
- '
',
+ code: '
',
options: ['never']
},
'
'
@@ -114,8 +113,7 @@ tester.run('block-spacing', rule, {
]
},
{
- code:
- '
',
+ code: '
',
output:
'
',
errors: [
diff --git a/tests/lib/rules/block-tag-newline.js b/tests/lib/rules/block-tag-newline.js
index 924278799..a727b0b98 100644
--- a/tests/lib/rules/block-tag-newline.js
+++ b/tests/lib/rules/block-tag-newline.js
@@ -24,13 +24,11 @@ tester.run('block-tag-newline', rule, {
options: [{ singleline: 'never', multiline: 'never' }]
},
{
- code:
- '\n \n \n',
+ code: '\n \n \n',
options: [{ singleline: 'always', multiline: 'always' }]
},
{
- code:
- '\n\n \n\n \n',
+ code: '\n\n \n\n \n',
options: [{ singleline: 'always', multiline: 'always', maxEmptyLines: 1 }]
},
{
@@ -42,8 +40,7 @@ tester.run('block-tag-newline', rule, {
options: [{ multiline: 'never' }]
},
{
- code:
- '\n\n
\n \n',
+ code: '\n\n
\n \n',
options: [{ singleline: 'never' }]
},
// invalid
@@ -110,8 +107,7 @@ tester.run('block-tag-newline', rule, {
]
},
{
- code:
- '\n\n
\n \n',
+ code: '\n\n
\n \n',
output: '\n
\n',
options: [{ singleline: 'never', multiline: 'never' }],
errors: [
@@ -166,8 +162,7 @@ tester.run('block-tag-newline', rule, {
]
},
{
- code:
- '\n\n \n\n \n',
+ code: '\n\n \n\n \n',
output:
'\n \n \n',
options: [{ singleline: 'always', multiline: 'always' }],
@@ -199,8 +194,7 @@ tester.run('block-tag-newline', rule, {
]
},
{
- code:
- '\n\n\n \n\n \n',
+ code: '\n\n\n \n\n \n',
output:
'\n\n \n\n \n',
options: [
@@ -222,8 +216,7 @@ tester.run('block-tag-newline', rule, {
]
},
{
- code:
- ' \n\n \n\n# ',
+ code: ' \n\n \n\n# ',
output:
' \n\n \n\n#\n ',
options: [
diff --git a/tests/lib/rules/brace-style.js b/tests/lib/rules/brace-style.js
index 24a41d28e..cfea73591 100644
--- a/tests/lib/rules/brace-style.js
+++ b/tests/lib/rules/brace-style.js
@@ -69,8 +69,7 @@ tester.run('brace-style', rule, {
]
},
{
- code:
- '
',
+ code: '
',
output: `
`,
diff --git a/tests/lib/rules/component-name-in-template-casing.js b/tests/lib/rules/component-name-in-template-casing.js
index 31c4ae832..baeb66433 100644
--- a/tests/lib/rules/component-name-in-template-casing.js
+++ b/tests/lib/rules/component-name-in-template-casing.js
@@ -121,8 +121,7 @@ tester.run('component-name-in-template-casing', rule, {
]
},
{
- code:
- ' ',
+ code: ' ',
options: [
'PascalCase',
{ ignores: ['custom-element'], registeredComponentsOnly: false }
diff --git a/tests/lib/rules/component-tags-order.js b/tests/lib/rules/component-tags-order.js
index 1630cbed1..0c40d4997 100644
--- a/tests/lib/rules/component-tags-order.js
+++ b/tests/lib/rules/component-tags-order.js
@@ -73,20 +73,17 @@ tester.run('component-tags-order', rule, {
options: [{ order: ['template', 'docs', 'script', 'style'] }]
},
{
- code:
- ' ',
+ code: ' ',
output: null,
options: [{ order: ['template', 'script', 'style'] }]
},
{
- code:
- 'text
',
+ code: 'text
',
output: null,
options: [{ order: ['docs', 'script', 'template', 'style'] }]
},
{
- code:
- ' ',
+ code: ' ',
output: null,
options: [{ order: [['docs', 'script', 'template'], 'style'] }]
},
diff --git a/tests/lib/rules/html-button-has-type.js b/tests/lib/rules/html-button-has-type.js
index d6f40487f..cdf8abff7 100644
--- a/tests/lib/rules/html-button-has-type.js
+++ b/tests/lib/rules/html-button-has-type.js
@@ -36,8 +36,7 @@ ruleTester.run('html-button-has-type', rule, {
},
{
filename: 'test.vue',
- code:
- 'Hello World '
+ code: 'Hello World '
},
{
filename: 'test.vue',
@@ -191,8 +190,7 @@ ruleTester.run('html-button-has-type', rule, {
},
{
filename: 'test.vue',
- code:
- 'Hello World Hello World ',
+ code: 'Hello World Hello World ',
errors: [
{
message: 'Missing an explicit type attribute for button.',
diff --git a/tests/lib/rules/mustache-interpolation-spacing.js b/tests/lib/rules/mustache-interpolation-spacing.js
index 45818fec8..f010fce4d 100644
--- a/tests/lib/rules/mustache-interpolation-spacing.js
+++ b/tests/lib/rules/mustache-interpolation-spacing.js
@@ -32,13 +32,11 @@ ruleTester.run('mustache-interpolation-spacing', rule, {
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
diff --git a/tests/lib/rules/no-confusing-v-for-v-if.js b/tests/lib/rules/no-confusing-v-for-v-if.js
index c94d1b3ea..47959aeb4 100644
--- a/tests/lib/rules/no-confusing-v-for-v-if.js
+++ b/tests/lib/rules/no-confusing-v-for-v-if.js
@@ -29,36 +29,30 @@ tester.run('no-confusing-v-for-v-if', rule, {
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
}
],
invalid: [
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["This 'v-if' should be moved to the wrapper element."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["This 'v-if' should be moved to the wrapper element."]
}
]
diff --git a/tests/lib/rules/no-deprecated-filter.js b/tests/lib/rules/no-deprecated-filter.js
index a6158ab90..e21d2b619 100644
--- a/tests/lib/rules/no-deprecated-filter.js
+++ b/tests/lib/rules/no-deprecated-filter.js
@@ -57,8 +57,7 @@ ruleTester.run('no-deprecated-filter', rule, {
},
{
filename: 'test.vue',
- code:
- '{{ msg | filter }}
',
+ code: '{{ msg | filter }}
',
errors: ['Filters are deprecated.']
},
{
@@ -73,8 +72,7 @@ ruleTester.run('no-deprecated-filter', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: ['Filters are deprecated.']
}
]
diff --git a/tests/lib/rules/no-deprecated-inline-template.js b/tests/lib/rules/no-deprecated-inline-template.js
index 3ee8e999c..e64511acd 100644
--- a/tests/lib/rules/no-deprecated-inline-template.js
+++ b/tests/lib/rules/no-deprecated-inline-template.js
@@ -32,21 +32,18 @@ ruleTester.run('no-deprecated-inline-template', rule, {
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
}
],
invalid: [
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
{
line: 1,
@@ -59,14 +56,12 @@ ruleTester.run('no-deprecated-inline-template', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
}
]
diff --git a/tests/lib/rules/no-deprecated-v-bind-sync.js b/tests/lib/rules/no-deprecated-v-bind-sync.js
index 469d2f577..6f9d6860d 100644
--- a/tests/lib/rules/no-deprecated-v-bind-sync.js
+++ b/tests/lib/rules/no-deprecated-v-bind-sync.js
@@ -59,8 +59,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- " ",
+ code: " ",
output: " ",
errors: [
"'.sync' modifier on 'v-bind' directive is deprecated. Use 'v-model:propName' instead."
@@ -92,8 +91,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
output:
' ',
errors: [
@@ -102,8 +100,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
output:
' ',
errors: [
@@ -112,8 +109,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
output:
' ',
errors: [
@@ -122,8 +118,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
output:
' ',
errors: [
@@ -132,8 +127,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
output:
' ',
errors: [
@@ -142,8 +136,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
output:
' ',
errors: [
@@ -152,8 +145,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
output:
' ',
errors: [
@@ -162,8 +154,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
output:
' ',
errors: [
@@ -172,8 +163,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
output:
' ',
errors: [
@@ -182,8 +172,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
output:
' ',
errors: [
@@ -192,8 +181,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
output:
' ',
errors: [
@@ -202,8 +190,7 @@ ruleTester.run('no-deprecated-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
output:
' ',
errors: [
diff --git a/tests/lib/rules/no-deprecated-v-on-number-modifiers.js b/tests/lib/rules/no-deprecated-v-on-number-modifiers.js
index 9edf2a272..dc7ae6500 100644
--- a/tests/lib/rules/no-deprecated-v-on-number-modifiers.js
+++ b/tests/lib/rules/no-deprecated-v-on-number-modifiers.js
@@ -56,8 +56,7 @@ ruleTester.run('no-deprecated-v-on-number-modifiers', rule, {
},
{
filename: 'test.vue',
- code:
- " "
+ code: " "
},
{
filename: 'test.vue',
@@ -111,8 +110,7 @@ ruleTester.run('no-deprecated-v-on-number-modifiers', rule, {
},
{
filename: 'test.vue',
- code:
- " ",
+ code: " ",
output:
" ",
errors: [
@@ -121,8 +119,7 @@ ruleTester.run('no-deprecated-v-on-number-modifiers', rule, {
},
{
filename: 'test.vue',
- code:
- " ",
+ code: " ",
output:
" ",
errors: [
diff --git a/tests/lib/rules/no-dupe-v-else-if.js b/tests/lib/rules/no-dupe-v-else-if.js
index 0b5698fe8..214657a9c 100644
--- a/tests/lib/rules/no-dupe-v-else-if.js
+++ b/tests/lib/rules/no-dupe-v-else-if.js
@@ -370,56 +370,47 @@ tester.run('no-dupe-v-else-if', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }, { messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
{ messageId: 'unexpected' },
{ messageId: 'unexpected' },
@@ -428,20 +419,17 @@ tester.run('no-dupe-v-else-if', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
@@ -451,14 +439,12 @@ tester.run('no-dupe-v-else-if', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
@@ -468,14 +454,12 @@ tester.run('no-dupe-v-else-if', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
@@ -485,32 +469,27 @@ tester.run('no-dupe-v-else-if', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }, { messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
@@ -520,110 +499,92 @@ tester.run('no-dupe-v-else-if', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
@@ -633,8 +594,7 @@ tester.run('no-dupe-v-else-if', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
@@ -649,8 +609,7 @@ tester.run('no-dupe-v-else-if', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'unexpected' }]
},
{
diff --git a/tests/lib/rules/no-duplicate-attributes.js b/tests/lib/rules/no-duplicate-attributes.js
index 661cf1f33..baa79dc98 100644
--- a/tests/lib/rules/no-duplicate-attributes.js
+++ b/tests/lib/rules/no-duplicate-attributes.js
@@ -33,8 +33,7 @@ tester.run('no-duplicate-attributes', rule, {
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
diff --git a/tests/lib/rules/no-extra-parens.js b/tests/lib/rules/no-extra-parens.js
index 9b7ce315f..1bb704bac 100644
--- a/tests/lib/rules/no-extra-parens.js
+++ b/tests/lib/rules/no-extra-parens.js
@@ -157,15 +157,13 @@ tester.run('no-extra-parens', rule, {
errors: [{ messageId: 'unexpected' }]
},
{
- code:
- '{{ ((foo + bar | bitwise)) }} ',
+ code: '{{ ((foo + bar | bitwise)) }} ',
output:
'{{ (foo + bar | bitwise) }} ',
errors: [{ messageId: 'unexpected' }]
},
{
- code:
- '{{ ((foo | bitwise)) | filter }} ',
+ code: '{{ ((foo | bitwise)) | filter }} ',
output:
'{{ (foo | bitwise) | filter }} ',
errors: [{ messageId: 'unexpected' }]
diff --git a/tests/lib/rules/no-irregular-whitespace.js b/tests/lib/rules/no-irregular-whitespace.js
index 85a0ad4aa..9c3a40cdc 100644
--- a/tests/lib/rules/no-irregular-whitespace.js
+++ b/tests/lib/rules/no-irregular-whitespace.js
@@ -11,9 +11,10 @@ const tester = new RuleTester({
parserOptions: { ecmaVersion: 2018 }
})
-const IRREGULAR_WHITESPACES = '\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000'.split(
- ''
-)
+const IRREGULAR_WHITESPACES =
+ '\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000'.split(
+ ''
+ )
const IRREGULAR_LINE_TERMINATORS = '\u2028\u2029'.split('')
const ALL_IRREGULAR_WHITESPACES = [].concat(
IRREGULAR_WHITESPACES,
diff --git a/tests/lib/rules/no-multi-spaces.js b/tests/lib/rules/no-multi-spaces.js
index f7772dbe1..347672706 100644
--- a/tests/lib/rules/no-multi-spaces.js
+++ b/tests/lib/rules/no-multi-spaces.js
@@ -198,8 +198,7 @@ ruleTester.run('no-multi-spaces', rule, {
]
},
{
- code:
- '{{ test }}
',
+ code: '{{ test }}
',
output: '{{ test }}
',
errors: [
{
diff --git a/tests/lib/rules/no-multiple-template-root.js b/tests/lib/rules/no-multiple-template-root.js
index 7899620a0..69f9f26e4 100644
--- a/tests/lib/rules/no-multiple-template-root.js
+++ b/tests/lib/rules/no-multiple-template-root.js
@@ -36,13 +36,11 @@ ruleTester.run('no-multiple-template-root', rule, {
},
{
filename: 'test.vue',
- code:
- '\n \n abc
\n abc
\n '
+ code: '\n \n abc
\n abc
\n '
},
{
filename: 'test.vue',
- code:
- '\n \n abc
\n abc
\n abc
\n '
+ code: '\n \n abc
\n abc
\n abc
\n '
},
{
filename: 'test.vue',
@@ -54,8 +52,7 @@ ruleTester.run('no-multiple-template-root', rule, {
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
// https://github.com/vuejs/eslint-plugin-vue/issues/1439
diff --git a/tests/lib/rules/no-parsing-error.js b/tests/lib/rules/no-parsing-error.js
index 91b787212..2b299f09a 100644
--- a/tests/lib/rules/no-parsing-error.js
+++ b/tests/lib/rules/no-parsing-error.js
@@ -37,8 +37,7 @@ tester.run('no-parsing-error', rule, {
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
diff --git a/tests/lib/rules/no-restricted-static-attribute.js b/tests/lib/rules/no-restricted-static-attribute.js
index 1b57e9145..e0c4de130 100644
--- a/tests/lib/rules/no-restricted-static-attribute.js
+++ b/tests/lib/rules/no-restricted-static-attribute.js
@@ -104,8 +104,7 @@ tester.run('no-restricted-static-attribute', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
options: [
'/^vv/',
{ key: 'foo', value: true },
diff --git a/tests/lib/rules/no-restricted-v-bind.js b/tests/lib/rules/no-restricted-v-bind.js
index 6a7f0a447..e6dd72d59 100644
--- a/tests/lib/rules/no-restricted-v-bind.js
+++ b/tests/lib/rules/no-restricted-v-bind.js
@@ -109,8 +109,7 @@ tester.run('no-restricted-v-bind', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
options: ['/^v-/', { argument: 'foo', modifiers: ['sync'] }, null],
errors: [
'Using `:v-on` is not allowed.',
diff --git a/tests/lib/rules/no-template-key.js b/tests/lib/rules/no-template-key.js
index 9ec20a7fb..599e150f5 100644
--- a/tests/lib/rules/no-template-key.js
+++ b/tests/lib/rules/no-template-key.js
@@ -45,25 +45,21 @@ tester.run('no-template-key', rule, {
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
// It is probably not valid, but it works as the Vue.js 3.x compiler.
// We can prevent it with other rules. e.g. vue/require-v-for-key
- code:
- '
'
+ code: '
'
}
],
invalid: [
@@ -76,8 +72,7 @@ tester.run('no-template-key', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
"'' cannot be keyed. Place the key on real elements instead."
]
@@ -91,16 +86,14 @@ tester.run('no-template-key', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
"'' cannot be keyed. Place the key on real elements instead."
]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
"'' cannot be keyed. Place the key on real elements instead."
]
diff --git a/tests/lib/rules/no-template-shadow.js b/tests/lib/rules/no-template-shadow.js
index 9d819f348..872dffcf1 100644
--- a/tests/lib/rules/no-template-shadow.js
+++ b/tests/lib/rules/no-template-shadow.js
@@ -121,8 +121,7 @@ ruleTester.run('no-template-shadow', rule, {
invalid: [
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
{
message: "Variable 'i' is already declared in the upper scope.",
diff --git a/tests/lib/rules/no-template-target-blank.js b/tests/lib/rules/no-template-target-blank.js
index ab1bf9220..3d21c1db2 100644
--- a/tests/lib/rules/no-template-target-blank.js
+++ b/tests/lib/rules/no-template-target-blank.js
@@ -31,27 +31,22 @@ ruleTester.run('no-template-target-blank', rule, {
},
{ code: 'link ' },
{
- code:
- 'link '
+ code: 'link '
},
{
- code:
- 'link '
+ code: 'link '
},
{
- code:
- 'link ',
+ code: 'link ',
options: [{ allowReferrer: true }]
},
{ code: 'link ' },
{
- code:
- 'link '
+ code: 'link '
},
{ code: 'link ' },
{
- code:
- 'link '
+ code: 'link '
},
{
code: 'link ',
@@ -60,22 +55,19 @@ ruleTester.run('no-template-target-blank', rule, {
],
invalid: [
{
- code:
- 'link ',
+ code: 'link ',
errors: [
'Using target="_blank" without rel="noopener noreferrer" is a security risk.'
]
},
{
- code:
- 'link ',
+ code: 'link ',
errors: [
'Using target="_blank" without rel="noopener noreferrer" is a security risk.'
]
},
{
- code:
- 'link ',
+ code: 'link ',
errors: [
'Using target="_blank" without rel="noopener noreferrer" is a security risk.'
]
@@ -87,8 +79,7 @@ ruleTester.run('no-template-target-blank', rule, {
]
},
{
- code:
- 'link ',
+ code: 'link ',
errors: [
'Using target="_blank" without rel="noopener noreferrer" is a security risk.'
]
diff --git a/tests/lib/rules/no-textarea-mustache.js b/tests/lib/rules/no-textarea-mustache.js
index e31f96bed..75040538b 100644
--- a/tests/lib/rules/no-textarea-mustache.js
+++ b/tests/lib/rules/no-textarea-mustache.js
@@ -29,8 +29,7 @@ tester.run('no-textarea-mustache', rule, {
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
}
],
invalid: [
@@ -41,8 +40,7 @@ tester.run('no-textarea-mustache', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
"Unexpected mustache. Use 'v-model' instead.",
"Unexpected mustache. Use 'v-model' instead."
diff --git a/tests/lib/rules/no-unused-vars.js b/tests/lib/rules/no-unused-vars.js
index 81df799bb..f57733d3f 100644
--- a/tests/lib/rules/no-unused-vars.js
+++ b/tests/lib/rules/no-unused-vars.js
@@ -30,23 +30,19 @@ tester.run('no-unused-vars', rule, {
code: ' '
},
{
- code:
- '{{i}}{{j}} '
+ code: '{{i}}{{j}} '
},
{
- code:
- '{{ f.bar.baz }} '
+ code: '{{ f.bar.baz }} '
},
{
code: '{{props}} '
},
{
- code:
- ' '
+ code: ' '
},
{
- code:
- '{{item.name}}
'
+ code: '{{item.name}}
'
},
{
code: '{{c}}
'
@@ -84,18 +80,15 @@ tester.run('no-unused-vars', rule, {
errors: ["'props' is defined but never used."]
},
{
- code:
- ' ',
+ code: ' ',
errors: ["'props' is defined but never used."]
},
{
- code:
- '{{i}}{{i}}
',
+ code: '{{i}}{{i}}
',
errors: ["'j' is defined but never used."]
},
{
- code:
- ' ',
+ code: ' ',
errors: ["'f' is defined but never used."]
},
{
@@ -118,8 +111,7 @@ tester.run('no-unused-vars', rule, {
errors: ["'c' is defined but never used."]
},
{
- code:
- '{{item.name}}
',
+ code: '{{item.name}}
',
errors: ["'key' is defined but never used."]
},
{
@@ -149,8 +141,7 @@ tester.run('no-unused-vars', rule, {
options: [{ ignorePattern: '^ignore' }]
},
{
- code:
- ' ',
+ code: ' ',
errors: ["'props' is defined but never used."],
options: [{ ignorePattern: '^ignore' }]
},
@@ -164,23 +155,19 @@ tester.run('no-unused-vars', rule, {
errors: ["'a' is defined but never used."]
},
{
- code:
- '{{d}} ',
+ code: '{{d}} ',
errors: ["'a' is defined but never used."]
},
{
- code:
- '{{a}} ',
+ code: '{{a}} ',
errors: ["'i' is defined but never used."]
},
{
- code:
- '{{i}} ',
+ code: '{{i}} ',
errors: ["'a' is defined but never used."]
},
{
- code:
- '{{f}}
',
+ code: '{{f}}
',
errors: [
"'a' is defined but never used.",
"'b' is defined but never used.",
@@ -189,8 +176,7 @@ tester.run('no-unused-vars', rule, {
]
},
{
- code:
- '{{f}}
',
+ code: '{{f}}
',
errors: [
"'a' is defined but never used.",
"'b' is defined but never used.",
@@ -198,8 +184,7 @@ tester.run('no-unused-vars', rule, {
]
},
{
- code:
- '{{d}} ',
+ code: '{{d}} ',
errors: [
"'a' is defined but never used.",
"'b' is defined but never used.",
@@ -207,8 +192,7 @@ tester.run('no-unused-vars', rule, {
]
},
{
- code:
- '{{f}}
',
+ code: '{{f}}
',
errors: [
"'a' is defined but never used.",
"'bar' is defined but never used.",
diff --git a/tests/lib/rules/no-use-v-if-with-v-for.js b/tests/lib/rules/no-use-v-if-with-v-for.js
index d4bc932c9..4ed5e6f46 100644
--- a/tests/lib/rules/no-use-v-if-with-v-for.js
+++ b/tests/lib/rules/no-use-v-if-with-v-for.js
@@ -27,26 +27,22 @@ tester.run('no-use-v-if-with-v-for', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
options: [{ allowUsingIterationVar: true }]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
options: [{ allowUsingIterationVar: true }]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
options: [{ allowUsingIterationVar: true }]
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
@@ -80,26 +76,22 @@ tester.run('no-use-v-if-with-v-for', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
options: [{ allowUsingIterationVar: true }]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
options: [{ allowUsingIterationVar: true }]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
options: [{ allowUsingIterationVar: true }]
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
@@ -135,8 +127,7 @@ tester.run('no-use-v-if-with-v-for', rule, {
invalid: [
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
{
message: "This 'v-if' should be moved to the wrapper element.",
@@ -146,8 +137,7 @@ tester.run('no-use-v-if-with-v-for', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
{
message: "This 'v-if' should be moved to the wrapper element.",
@@ -157,8 +147,7 @@ tester.run('no-use-v-if-with-v-for', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
{
message:
@@ -214,8 +203,7 @@ tester.run('no-use-v-if-with-v-for', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
{
message:
@@ -271,8 +259,7 @@ tester.run('no-use-v-if-with-v-for', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
{
message:
@@ -283,8 +270,7 @@ tester.run('no-use-v-if-with-v-for', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
{
message:
diff --git a/tests/lib/rules/no-v-for-template-key-on-child.js b/tests/lib/rules/no-v-for-template-key-on-child.js
index 36254f996..f6a1e2419 100644
--- a/tests/lib/rules/no-v-for-template-key-on-child.js
+++ b/tests/lib/rules/no-v-for-template-key-on-child.js
@@ -27,28 +27,23 @@ tester.run('no-v-for-template-key-on-child', rule, {
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
@@ -79,8 +74,7 @@ tester.run('no-v-for-template-key-on-child', rule, {
invalid: [
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
{
message:
@@ -91,32 +85,28 @@ tester.run('no-v-for-template-key-on-child', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
'`` key should be placed on the `` tag.'
]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
'`` key should be placed on the `` tag.'
]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
'`` key should be placed on the `` tag.'
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
'`` key should be placed on the `` tag.'
]
diff --git a/tests/lib/rules/no-v-for-template-key.js b/tests/lib/rules/no-v-for-template-key.js
index 56fdb348d..e6665b583 100644
--- a/tests/lib/rules/no-v-for-template-key.js
+++ b/tests/lib/rules/no-v-for-template-key.js
@@ -47,8 +47,7 @@ tester.run('no-v-for-template-key', rule, {
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
@@ -56,44 +55,38 @@ tester.run('no-v-for-template-key', rule, {
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
}
],
invalid: [
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
"'' cannot be keyed. Place the key on real elements instead."
]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
"'' cannot be keyed. Place the key on real elements instead."
]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
"'' cannot be keyed. Place the key on real elements instead."
]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
"'' cannot be keyed. Place the key on real elements instead."
]
diff --git a/tests/lib/rules/no-v-model-argument.js b/tests/lib/rules/no-v-model-argument.js
index cba98ebe4..4ffe0a57b 100644
--- a/tests/lib/rules/no-v-model-argument.js
+++ b/tests/lib/rules/no-v-model-argument.js
@@ -31,14 +31,12 @@ ruleTester.run('no-v-model-argument', rule, {
invalid: [
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["'v-model' directives require no argument."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["'v-model' directives require no argument."]
}
]
diff --git a/tests/lib/rules/require-explicit-emits.js b/tests/lib/rules/require-explicit-emits.js
index 31ad623a4..6cf1cc6eb 100644
--- a/tests/lib/rules/require-explicit-emits.js
+++ b/tests/lib/rules/require-explicit-emits.js
@@ -417,8 +417,7 @@ tester.run('require-explicit-emits', rule, {
endColumn: 33,
suggestions: [
{
- desc:
- 'Add the `emits` option with array syntax and define "foo" event.',
+ desc: 'Add the `emits` option with array syntax and define "foo" event.',
output: `
@@ -431,8 +430,7 @@ emits: ['foo']
`
},
{
- desc:
- 'Add the `emits` option with object syntax and define "foo" event.',
+ desc: 'Add the `emits` option with object syntax and define "foo" event.',
output: `
@@ -797,8 +795,7 @@ emits: {'foo': null}
'The "foo" event has been triggered but not declared on `emits` option.',
suggestions: [
{
- desc:
- 'Add the `emits` option with array syntax and define "foo" event.',
+ desc: 'Add the `emits` option with array syntax and define "foo" event.',
output: `
@@ -813,8 +810,7 @@ emits: ['foo']
`
},
{
- desc:
- 'Add the `emits` option with object syntax and define "foo" event.',
+ desc: 'Add the `emits` option with object syntax and define "foo" event.',
output: `
@@ -1308,8 +1304,7 @@ emits: {'foo': null}
'The "foo" event has been triggered but not declared on `emits` option.',
suggestions: [
{
- desc:
- 'Add the `emits` option with array syntax and define "foo" event.',
+ desc: 'Add the `emits` option with array syntax and define "foo" event.',
output: `
@@ -1324,8 +1319,7 @@ emits: ['foo']
`
},
{
- desc:
- 'Add the `emits` option with object syntax and define "foo" event.',
+ desc: 'Add the `emits` option with object syntax and define "foo" event.',
output: `
@@ -1362,8 +1356,7 @@ emits: {'foo': null}
'The "foo" event has been triggered but not declared on `emits` option.',
suggestions: [
{
- desc:
- 'Add the `emits` option with array syntax and define "foo" event.',
+ desc: 'Add the `emits` option with array syntax and define "foo" event.',
output: `
@@ -1378,8 +1371,7 @@ emits: ['foo'],
`
},
{
- desc:
- 'Add the `emits` option with object syntax and define "foo" event.',
+ desc: 'Add the `emits` option with object syntax and define "foo" event.',
output: `
@@ -1415,8 +1407,7 @@ emits: {'foo': null},
'The "foo" event has been triggered but not declared on `emits` option.',
suggestions: [
{
- desc:
- 'Add the `emits` option with array syntax and define "foo" event.',
+ desc: 'Add the `emits` option with array syntax and define "foo" event.',
output: `
@@ -1430,8 +1421,7 @@ emits: ['foo'],
`
},
{
- desc:
- 'Add the `emits` option with object syntax and define "foo" event.',
+ desc: 'Add the `emits` option with object syntax and define "foo" event.',
output: `
@@ -1466,8 +1456,7 @@ emits: {'foo': null},
'The "foo" event has been triggered but not declared on `emits` option.',
suggestions: [
{
- desc:
- 'Add the `emits` option with array syntax and define "foo" event.',
+ desc: 'Add the `emits` option with array syntax and define "foo" event.',
output: `
@@ -1481,8 +1470,7 @@ emits: ['foo']
`
},
{
- desc:
- 'Add the `emits` option with object syntax and define "foo" event.',
+ desc: 'Add the `emits` option with object syntax and define "foo" event.',
output: `
@@ -1517,8 +1505,7 @@ emits: {'foo': null}
'The "foo" event has been triggered but not declared on `emits` option.',
suggestions: [
{
- desc:
- 'Add the `emits` option with array syntax and define "foo" event.',
+ desc: 'Add the `emits` option with array syntax and define "foo" event.',
output: `
@@ -1532,8 +1519,7 @@ emits: ['foo']
`
},
{
- desc:
- 'Add the `emits` option with object syntax and define "foo" event.',
+ desc: 'Add the `emits` option with object syntax and define "foo" event.',
output: `
diff --git a/tests/lib/rules/require-toggle-inside-transition.js b/tests/lib/rules/require-toggle-inside-transition.js
index 82726b6f0..76c2b7c5a 100644
--- a/tests/lib/rules/require-toggle-inside-transition.js
+++ b/tests/lib/rules/require-toggle-inside-transition.js
@@ -32,8 +32,7 @@ tester.run('require-toggle-inside-transition', rule, {
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
@@ -41,8 +40,7 @@ tester.run('require-toggle-inside-transition', rule, {
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
@@ -50,28 +48,23 @@ tester.run('require-toggle-inside-transition', rule, {
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
}
],
invalid: [
@@ -100,20 +93,17 @@ tester.run('require-toggle-inside-transition', rule, {
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'expected' }]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [{ messageId: 'expected' }]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'expected' }]
}
]
diff --git a/tests/lib/rules/require-v-for-key.js b/tests/lib/rules/require-v-for-key.js
index f98da8bc1..22bb36244 100644
--- a/tests/lib/rules/require-v-for-key.js
+++ b/tests/lib/rules/require-v-for-key.js
@@ -29,85 +29,69 @@ tester.run('require-v-for-key', rule, {
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
// key on : In Vue.js 3.x, you can place key on .
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
// key on : In Vue.js 3.x, you can place key on .
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
}
],
invalid: [
@@ -118,20 +102,17 @@ tester.run('require-v-for-key', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["Elements in iteration expect to have 'v-bind:key' directives."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["Elements in iteration expect to have 'v-bind:key' directives."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["Elements in iteration expect to have 'v-bind:key' directives."]
}
]
diff --git a/tests/lib/rules/valid-template-root.js b/tests/lib/rules/valid-template-root.js
index 212fefc8d..f530786d3 100644
--- a/tests/lib/rules/valid-template-root.js
+++ b/tests/lib/rules/valid-template-root.js
@@ -41,13 +41,11 @@ tester.run('valid-template-root', rule, {
},
{
filename: 'test.vue',
- code:
- '\n \n abc
\n abc
\n '
+ code: '\n \n abc
\n abc
\n '
},
{
filename: 'test.vue',
- code:
- '\n \n abc
\n abc
\n abc
\n '
+ code: '\n \n abc
\n abc
\n abc
\n '
},
{
filename: 'test.vue',
@@ -59,8 +57,7 @@ tester.run('valid-template-root', rule, {
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
diff --git a/tests/lib/rules/valid-v-bind-sync.js b/tests/lib/rules/valid-v-bind-sync.js
index 763ae582d..a2e47a6a7 100644
--- a/tests/lib/rules/valid-v-bind-sync.js
+++ b/tests/lib/rules/valid-v-bind-sync.js
@@ -51,63 +51,51 @@ tester.run('valid-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
// not .sync
{
@@ -431,14 +419,12 @@ tester.run('valid-v-bind-sync', rule, {
},
{
filename: 'test.vue',
- code:
- '',
+ code: '',
errors: ["'.sync' modifiers aren't supported on non Vue-components."]
},
{
filename: 'test.vue',
- code:
- '',
+ code: '',
errors: ["'.sync' modifiers aren't supported on non Vue-components."]
}
]
diff --git a/tests/lib/rules/valid-v-else-if.js b/tests/lib/rules/valid-v-else-if.js
index e9f05d1e2..847632c56 100644
--- a/tests/lib/rules/valid-v-else-if.js
+++ b/tests/lib/rules/valid-v-else-if.js
@@ -29,13 +29,11 @@ tester.run('valid-v-else-if', rule, {
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
@@ -44,21 +42,18 @@ tester.run('valid-v-else-if', rule, {
// parsing error
{
filename: 'parsing-error.vue',
- code:
- '
'
+ code: '
'
},
// comment value (parsing error)
{
filename: 'comment-value.vue',
- code:
- '
'
+ code: '
'
}
],
invalid: [
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
"'v-else-if' directives require being preceded by the element which has a 'v-if' or 'v-else-if' directive."
]
@@ -79,67 +74,58 @@ tester.run('valid-v-else-if', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-else-if' directives require being preceded by the element which has a 'v-if' or 'v-else-if' directive."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-else-if' directives require being preceded by the element which has a 'v-if' or 'v-else-if' directive."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-else-if' directives require being preceded by the element which has a 'v-if' or 'v-else-if' directive."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-else-if' and 'v-if' directives can't exist on the same element."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-else-if' and 'v-else' directives can't exist on the same element."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["'v-else-if' directives require no argument."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["'v-else-if' directives require no modifier."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["'v-else-if' directives require that attribute value."]
},
// empty value
{
filename: 'empty-value.vue',
- code:
- '
',
+ code: '
',
errors: ["'v-else-if' directives require that attribute value."]
}
]
diff --git a/tests/lib/rules/valid-v-else.js b/tests/lib/rules/valid-v-else.js
index 31b067861..e4513ca48 100644
--- a/tests/lib/rules/valid-v-else.js
+++ b/tests/lib/rules/valid-v-else.js
@@ -29,13 +29,11 @@ tester.run('valid-v-else', rule, {
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
@@ -73,52 +71,45 @@ tester.run('valid-v-else', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-else' directives require being preceded by the element which has a 'v-if' or 'v-else-if' directive."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-else' directives require being preceded by the element which has a 'v-if' or 'v-else-if' directive."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-else' and 'v-if' directives can't exist on the same element. You may want 'v-else-if' directives."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-else' and 'v-else-if' directives can't exist on the same element."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["'v-else' directives require no argument."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["'v-else' directives require no modifier."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["'v-else' directives require no attribute value."]
},
// parsing error
@@ -130,8 +121,7 @@ tester.run('valid-v-else', rule, {
// comment value
{
filename: 'comment-value.vue',
- code:
- '
',
+ code: '
',
errors: ["'v-else' directives require no attribute value."]
},
// empty value
diff --git a/tests/lib/rules/valid-v-for.js b/tests/lib/rules/valid-v-for.js
index e42fa4f4a..a29d3081e 100644
--- a/tests/lib/rules/valid-v-for.js
+++ b/tests/lib/rules/valid-v-for.js
@@ -37,68 +37,55 @@ tester.run('valid-v-for', rule, {
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- 'foo
'
+ code: 'foo
'
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
@@ -131,59 +118,48 @@ tester.run('valid-v-for', rule, {
// key on : In Vue.js 3.x, you can place key on .
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
// key on : In Vue.js 3.x, you can place key on .
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- '
'
+ code: '
'
},
// parsing error
{
@@ -192,8 +168,7 @@ tester.run('valid-v-for', rule, {
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
// comment value (parsing error)
{
@@ -219,102 +194,87 @@ tester.run('valid-v-for', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["Invalid alias ''."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["Invalid alias ''."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["Invalid alias ''."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["Invalid alias '{b,c}'."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["Invalid alias '{c,d}'."]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: ["Custom elements in iteration require 'v-bind:key' directives."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["Custom elements in iteration require 'v-bind:key' directives."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["Custom elements in iteration require 'v-bind:key' directives."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: ["Custom elements in iteration require 'v-bind:key' directives."]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive."
]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
"Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive."
]
},
{
filename: 'test.vue',
- code:
- '
',
+ code: '
',
errors: [
"Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive."
]
diff --git a/tests/lib/rules/valid-v-if.js b/tests/lib/rules/valid-v-if.js
index d3afe5780..64232c3d2 100644
--- a/tests/lib/rules/valid-v-if.js
+++ b/tests/lib/rules/valid-v-if.js
@@ -52,8 +52,7 @@ tester.run('valid-v-if', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-if' and 'v-else-if' directives can't exist on the same element."
]
diff --git a/tests/lib/rules/valid-v-model.js b/tests/lib/rules/valid-v-model.js
index 8c3e384a3..6ee60526e 100644
--- a/tests/lib/rules/valid-v-model.js
+++ b/tests/lib/rules/valid-v-model.js
@@ -61,63 +61,51 @@ tester.run('valid-v-model', rule, {
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
@@ -133,23 +121,19 @@ tester.run('valid-v-model', rule, {
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
{
filename: 'test.vue',
- code:
- ' '
+ code: ' '
},
// svg
{
@@ -206,32 +190,28 @@ tester.run('valid-v-model', rule, {
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-model' directives cannot update the iteration variable 'x' itself."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-model' directives cannot update the iteration variable 'x' itself."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-model' directives cannot update the iteration variable 'x' itself."
]
},
{
filename: 'test.vue',
- code:
- ' ',
+ code: ' ',
errors: [
"'v-model' directives cannot update the iteration variable 'e' itself."
]
diff --git a/tests/lib/rules/valid-v-slot.js b/tests/lib/rules/valid-v-slot.js
index 99dc4b39b..cb6b8538d 100644
--- a/tests/lib/rules/valid-v-slot.js
+++ b/tests/lib/rules/valid-v-slot.js
@@ -145,8 +145,7 @@ tester.run('valid-v-slot', rule, {
// parsing error
{
filename: 'parsing-error.vue',
- code:
- '
'
+ code: '
'
}
],
invalid: [
@@ -461,21 +460,18 @@ tester.run('valid-v-slot', rule, {
// comment value
{
filename: 'comment-value1.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'requireAttributeValue' }]
},
{
filename: 'comment-value2.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'requireAttributeValue' }]
},
// empty value
{
filename: 'empty-value.vue',
- code:
- '
',
+ code: '
',
errors: [{ messageId: 'requireAttributeValue' }]
}
]
diff --git a/tools/lib/categories.js b/tools/lib/categories.js
index 9f7fd796e..7223fd87b 100644
--- a/tools/lib/categories.js
+++ b/tools/lib/categories.js
@@ -18,20 +18,17 @@ const categoryTitles = {
'Priority A: Essential (Error Prevention) for Vue.js 3.x '
},
'vue3-strongly-recommended': {
- text:
- 'Priority B: Strongly Recommended (Improving Readability) for Vue.js 3.x',
+ text: 'Priority B: Strongly Recommended (Improving Readability) for Vue.js 3.x',
vuepress:
'Priority B: Strongly Recommended (Improving Readability) for Vue.js 3.x '
},
'vue3-recommended': {
- text:
- 'Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) for Vue.js 3.x',
+ text: 'Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) for Vue.js 3.x',
vuepress:
'Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) for Vue.js 3.x '
},
'vue3-use-with-caution': {
- text:
- 'Priority D: Use with Caution (Potentially Dangerous Patterns) for Vue.js 3.x',
+ text: 'Priority D: Use with Caution (Potentially Dangerous Patterns) for Vue.js 3.x',
vuepress:
'Priority D: Use with Caution (Potentially Dangerous Patterns) for Vue.js 3.x '
},
@@ -41,20 +38,17 @@ const categoryTitles = {
'Priority A: Essential (Error Prevention) for Vue.js 2.x '
},
'strongly-recommended': {
- text:
- 'Priority B: Strongly Recommended (Improving Readability) for Vue.js 2.x',
+ text: 'Priority B: Strongly Recommended (Improving Readability) for Vue.js 2.x',
vuepress:
'Priority B: Strongly Recommended (Improving Readability) for Vue.js 2.x '
},
recommended: {
- text:
- 'Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) for Vue.js 2.x',
+ text: 'Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) for Vue.js 2.x',
vuepress:
'Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) for Vue.js 2.x '
},
'use-with-caution': {
- text:
- 'Priority D: Use with Caution (Potentially Dangerous Patterns) for Vue.js 2.x',
+ text: 'Priority D: Use with Caution (Potentially Dangerous Patterns) for Vue.js 2.x',
vuepress:
'Priority D: Use with Caution (Potentially Dangerous Patterns) for Vue.js 2.x '
}