diff --git a/lib/rules/require-expose.js b/lib/rules/require-expose.js
index 41578839e..953393e37 100644
--- a/lib/rules/require-expose.js
+++ b/lib/rules/require-expose.js
@@ -67,7 +67,6 @@ module.exports = {
messages: {
requireExpose:
'The public properties of the component must be explicitly declared using `expose`. If the component does not have public properties, declare it empty.',
-
addExposeOptionForEmpty:
'Add the `expose` option to give an empty array.',
addExposeOptionForAll:
diff --git a/tests/lib/rules/define-macros-order.js b/tests/lib/rules/define-macros-order.js
index 78c3637d2..bdae34e6a 100644
--- a/tests/lib/rules/define-macros-order.js
+++ b/tests/lib/rules/define-macros-order.js
@@ -928,7 +928,21 @@ tester.run('define-macros-order', rule, {
},
{
message: defineExposeNotTheLast,
- line: 6
+ line: 6,
+ suggestions: [
+ {
+ messageId: 'putExposeAtTheLast',
+ output: `
+
+ `
+ }
+ ]
}
]
}
diff --git a/tests/lib/rules/no-child-content.js b/tests/lib/rules/no-child-content.js
index 2e46f6cb0..1be1e3c07 100644
--- a/tests/lib/rules/no-child-content.js
+++ b/tests/lib/rules/no-child-content.js
@@ -77,7 +77,10 @@ ruleTester.run('no-child-content', rule, {
column: 29,
endColumn: 32,
suggestions: [
- { output: '' }
+ {
+ messageId: 'removeChildContent',
+ output: ''
+ }
]
}
]
@@ -93,7 +96,10 @@ ruleTester.run('no-child-content', rule, {
column: 29,
endColumn: 38,
suggestions: [
- { output: '' }
+ {
+ messageId: 'removeChildContent',
+ output: ''
+ }
]
}
]
@@ -109,7 +115,10 @@ ruleTester.run('no-child-content', rule, {
column: 29,
endColumn: 37,
suggestions: [
- { output: '' }
+ {
+ messageId: 'removeChildContent',
+ output: ''
+ }
]
}
]
@@ -125,7 +134,10 @@ ruleTester.run('no-child-content', rule, {
column: 29,
endColumn: 41,
suggestions: [
- { output: '' }
+ {
+ messageId: 'removeChildContent',
+ output: ''
+ }
]
}
]
@@ -152,6 +164,7 @@ ruleTester.run('no-child-content', rule, {
endColumn: 11,
suggestions: [
{
+ messageId: 'removeChildContent',
output: `
@@ -173,7 +186,10 @@ ruleTester.run('no-child-content', rule, {
column: 29,
endColumn: 32,
suggestions: [
- { output: '' }
+ {
+ messageId: 'removeChildContent',
+ output: ''
+ }
]
}
]
@@ -190,7 +206,10 @@ ruleTester.run('no-child-content', rule, {
column: 26,
endColumn: 29,
suggestions: [
- { output: '' }
+ {
+ messageId: 'removeChildContent',
+ output: ''
+ }
]
}
]
@@ -207,7 +226,10 @@ ruleTester.run('no-child-content', rule, {
column: 29,
endColumn: 32,
suggestions: [
- { output: '' }
+ {
+ messageId: 'removeChildContent',
+ output: ''
+ }
]
}
]
diff --git a/tests/lib/rules/no-required-prop-with-default.js b/tests/lib/rules/no-required-prop-with-default.js
index af33872f2..89319c0a8 100644
--- a/tests/lib/rules/no-required-prop-with-default.js
+++ b/tests/lib/rules/no-required-prop-with-default.js
@@ -867,7 +867,25 @@ tester.run('no-required-prop-with-default', rule, {
errors: [
{
message: 'Prop "name" should be optional.',
- line: 6
+ line: 6,
+ suggestions: [
+ {
+ messageId: 'fixRequiredProp',
+ output: `
+
+ `
+ }
+ ]
}
]
},
diff --git a/tests/lib/rules/no-unused-vars.js b/tests/lib/rules/no-unused-vars.js
index 39cf9a4c7..60e1c276b 100644
--- a/tests/lib/rules/no-unused-vars.js
+++ b/tests/lib/rules/no-unused-vars.js
@@ -123,7 +123,18 @@ tester.run('no-unused-vars', rule, {
{
code: '',
options: [{ ignorePattern: '^_' }],
- errors: ["'a' is defined but never used."]
+ errors: [
+ {
+ message: "'a' is defined but never used.",
+ suggestions: [
+ {
+ messageId: 'replaceWithUnderscore',
+ output:
+ ''
+ }
+ ]
+ }
+ ]
},
{
code: '{{d}}',
diff --git a/tests/lib/rules/prefer-true-attribute-shorthand.js b/tests/lib/rules/prefer-true-attribute-shorthand.js
index 342b0246c..43253fd69 100644
--- a/tests/lib/rules/prefer-true-attribute-shorthand.js
+++ b/tests/lib/rules/prefer-true-attribute-shorthand.js
@@ -264,12 +264,14 @@ tester.run('prefer-true-attribute-shorthand', rule, {
column: 17,
suggestions: [
{
+ messageId: 'rewriteIntoLongVueProp',
output: `
`
},
{
+ messageId: 'rewriteIntoLongHtmlAttr',
output: `
diff --git a/tests/lib/rules/require-emit-validator.js b/tests/lib/rules/require-emit-validator.js
index 0a509a6c1..8aadde153 100644
--- a/tests/lib/rules/require-emit-validator.js
+++ b/tests/lib/rules/require-emit-validator.js
@@ -383,7 +383,17 @@ ruleTester.run('require-emit-validator', rule, {
{
messageId: 'skipped',
data: { name: 'foo' },
- line: 3
+ line: 3,
+ suggestions: [
+ {
+ messageId: 'emptyValidation',
+ output: `
+
+ `
+ }
+ ]
}
],
languageOptions: {
diff --git a/tests/lib/rules/require-explicit-emits.js b/tests/lib/rules/require-explicit-emits.js
index 83af984ed..ed9e2d050 100644
--- a/tests/lib/rules/require-explicit-emits.js
+++ b/tests/lib/rules/require-explicit-emits.js
@@ -1727,8 +1727,86 @@ emits: {'foo': null}
`,
errors: [
- 'The "foo" event has been triggered but not declared on `emits` option.',
- 'The "bar" event has been triggered but not declared on `emits` option.'
+ {
+ message:
+ '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.',
+ output: `
+
+ `
+ },
+ {
+ desc: 'Add the `emits` option with object syntax and define "foo" event.',
+ output: `
+
+ `
+ }
+ ]
+ },
+ {
+ message:
+ 'The "bar" event has been triggered but not declared on `emits` option.',
+ suggestions: [
+ {
+ desc: 'Add the `emits` option with array syntax and define "bar" event.',
+ output: `
+
+ `
+ },
+ {
+ desc: 'Add the `emits` option with object syntax and define "bar" event.',
+ output: `
+
+ `
+ }
+ ]
+ }
]
},
{
@@ -1744,8 +1822,74 @@ emits: {'foo': null}
`,
errors: [
- 'The "foo" event has been triggered but not declared on `emits` option.',
- 'The "bar" event has been triggered but not declared on `emits` option.'
+ {
+ message:
+ '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.',
+ output: `
+
+ `
+ },
+ {
+ desc: 'Add the `emits` option with object syntax and define "foo" event.',
+ output: `
+
+ `
+ }
+ ]
+ },
+ {
+ message:
+ 'The "bar" event has been triggered but not declared on `emits` option.',
+ suggestions: [
+ {
+ desc: 'Add the `emits` option with array syntax and define "bar" event.',
+ output: `
+
+ `
+ },
+ {
+ desc: 'Add the `emits` option with object syntax and define "bar" event.',
+ output: `
+
+ `
+ }
+ ]
+ }
]
},
// allowProps
@@ -1771,15 +1915,141 @@ emits: {'foo': null}
errors: [
{
line: 3,
- messageId: 'missing'
+ messageId: 'missing',
+ suggestions: [
+ {
+ desc: 'Add the `emits` option with array syntax and define "foo" event.',
+ output: `
+
+
+
+
+ `
+ },
+ {
+ desc: 'Add the `emits` option with object syntax and define "foo" event.',
+ output: `
+
+
+
+
+ `
+ }
+ ]
},
{
line: 9,
- messageId: 'missing'
+ messageId: 'missing',
+ suggestions: [
+ {
+ desc: 'Add the `emits` option with array syntax and define "foo" event.',
+ output: `
+
+
+
+
+ `
+ },
+ {
+ desc: 'Add the `emits` option with object syntax and define "foo" event.',
+ output: `
+
+
+
+
+ `
+ }
+ ]
},
{
line: 12,
- messageId: 'missing'
+ messageId: 'missing',
+ suggestions: [
+ {
+ desc: 'Add the `emits` option with array syntax and define "foo" event.',
+ output: `
+
+
+
+
+ `
+ },
+ {
+ desc: 'Add the `emits` option with object syntax and define "foo" event.',
+ output: `
+
+
+
+
+ `
+ }
+ ]
}
]
},
diff --git a/tests/lib/rules/require-expose.js b/tests/lib/rules/require-expose.js
index 4e0d54738..2c6c4dbb5 100644
--- a/tests/lib/rules/require-expose.js
+++ b/tests/lib/rules/require-expose.js
@@ -284,6 +284,7 @@ expose: ["foo", "bar"],
`,
errors: [
{
+ messageId: 'requireExpose',
suggestions: [
{
desc: 'Add the `expose` option to give an empty array.',
@@ -329,6 +330,7 @@ expose: ["x", "foo", "bar"],
`,
errors: [
{
+ messageId: 'requireExpose',
suggestions: [
{
desc: 'Add the `expose` option to give an empty array.',
@@ -353,6 +355,7 @@ expose: []
`,
errors: [
{
+ messageId: 'requireExpose',
suggestions: [
{
desc: 'Add the `expose` option to give an empty array.',
diff --git a/tests/lib/rules/valid-next-tick.js b/tests/lib/rules/valid-next-tick.js
index 0cd583785..2e776e330 100644
--- a/tests/lib/rules/valid-next-tick.js
+++ b/tests/lib/rules/valid-next-tick.js
@@ -156,6 +156,7 @@ tester.run('valid-next-tick', rule, {
column: 11,
suggestions: [
{
+ messageId: 'addAwait',
output: `