' should be above '',
- output: '
',
- options: [{ order: ['script', 'template', 'style'] }],
- errors: [
- {
- message: "'`,
- output:
- '\n' +
- '
\n' +
- '\n' +
- ' \n' +
- '\n' +
- ' ',
- errors: [
- {
- message: "'
-
- `,
- output:
- '\n' +
- ' \n' +
- '
\n' +
- ' \n' +
- ' ',
- options: [{ order: ['script', 'template', 'style'] }],
- errors: [
- {
- message: "'
-
-
- `,
- output:
- '\n' +
- '
\n' +
- ' \n' +
- ' \n' +
- ' ',
- options: [{ order: ['template', 'script', 'style'] }],
- errors: [
- {
- message: "'
' should be above '
-
- `,
- output:
- '\n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' ',
- options: [{ order: ['docs', 'template', 'script', 'style'] }],
- errors: [
- {
- message: "'' should be above '' on line 2.",
- line: 3
- }
- ]
- },
- {
- code: `
-
-
-
-
- `,
- output:
- '\n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' ',
- options: [{ order: ['script', 'template', 'style'] }],
- errors: [
- {
- message: "'
-
- `,
- output:
- '\n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' ',
- options: [{ order: ['script', 'template', 'style'] }],
- errors: [
- {
- message: "'
-
- `,
- output:
- '\n \n \n ',
- options: [{ order: ['template', 'script'] }],
- errors: [
- {
- message: "'' should be above '
- `,
- output:
- '\n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' ',
- errors: [
- {
- message: "'' should be above '
-
-
-
- `,
- output:
- '\n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' \n' +
- ' ',
- errors: [
- {
- message: "'' should be above '
-
- `,
- output: '\n \n \n ',
- errors: [
- {
- message: "'',
- output: '',
- options: [{ order: ['script:not([scoped])', 'style:not([scoped])'] }],
- errors: [
- {
- message: "'`
- const [{ messages, output }] = await eslint.lintText(code, {
- filePath: 'test.vue'
- })
- assert.deepStrictEqual(messages, [])
- // should not fix `
- )
- })
-})
diff --git a/tests/lib/rules/no-invalid-model-keys.js b/tests/lib/rules/no-invalid-model-keys.js
deleted file mode 100644
index 44469346f..000000000
--- a/tests/lib/rules/no-invalid-model-keys.js
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * @fileoverview Prevents invalid keys in model option.
- * @author Alex Sokolov
- */
-'use strict'
-
-const rule = require('../../../lib/rules/no-invalid-model-keys')
-const RuleTester = require('../../eslint-compat').RuleTester
-
-const ruleTester = new RuleTester({
- languageOptions: {
- ecmaVersion: 2018,
- sourceType: 'module'
- }
-})
-ruleTester.run('no-invalid-model-keys', rule, {
- valid: [
- {
- filename: 'test.vue',
- code: `
- export default {
- model: {
- prop: 'list'
- }
- }
- `
- },
- {
- filename: 'test.vue',
- code: `
- export default {
- model: {
- event: 'update'
- }
- }
- `
- },
- {
- filename: 'test.vue',
- code: `
- export default {
- model: {
- prop: 'list',
- event: 'update'
- }
- }
- `
- }
- ],
-
- invalid: [
- {
- filename: 'test.vue',
- code: `
- export default {
- model: {
- props: 'list'
- }
- }
- `,
- errors: ["Invalid key 'props' in model option."]
- },
- {
- filename: 'test.vue',
- code: `
- export default {
- model: {
- events: 'update'
- }
- }
- `,
- errors: ["Invalid key 'events' in model option."]
- },
- {
- filename: 'test.vue',
- code: `
- export default {
- model: {
- props: 'list',
- event: 'update'
- }
- }
- `,
- errors: ["Invalid key 'props' in model option."]
- },
- {
- filename: 'test.vue',
- code: `
- export default {
- model: {
- prop: 'list',
- events: 'update'
- }
- }
- `,
- errors: ["Invalid key 'events' in model option."]
- },
- {
- filename: 'test.vue',
- code: `
- export default {
- model: {
- props: 'list',
- events: 'update'
- }
- }
- `,
- errors: [
- "Invalid key 'props' in model option.",
- "Invalid key 'events' in model option."
- ]
- },
- {
- filename: 'test.vue',
- code: `
- export default {
- model: {
- prop: 'checked',
- props: 'list',
- event: 'update'
- }
- }
- `,
- errors: ["Invalid key 'props' in model option."]
- },
- {
- filename: 'test.vue',
- code: `
- export default {
- model: {
- name: 'checked',
- props: 'list',
- event: 'update'
- }
- }
- `,
- errors: [
- "Invalid key 'name' in model option.",
- "Invalid key 'props' in model option."
- ]
- }
- ]
-})
diff --git a/tests/lib/rules/no-ref-object-destructure.js b/tests/lib/rules/no-ref-object-destructure.js
deleted file mode 100644
index e9b6e0d59..000000000
--- a/tests/lib/rules/no-ref-object-destructure.js
+++ /dev/null
@@ -1,449 +0,0 @@
-/**
- * @author Yosuke Ota
- * See LICENSE file in root directory for full license.
- */
-'use strict'
-
-const RuleTester = require('../../eslint-compat').RuleTester
-const rule = require('../../../lib/rules/no-ref-object-destructure')
-
-const tester = new RuleTester({
- languageOptions: {
- ecmaVersion: 2020,
- sourceType: 'module'
- }
-})
-
-tester.run('no-ref-object-destructure', rule, {
- valid: [
- `
- import { ref } from 'vue'
- const count = ref(0)
- const value1 = computed(() => count.value)
- const value2 = fn(count)
- const value3 = computed(() => fn(count.value))
- `,
- `
- import { toRefs } from 'vue'
- const { count } = toRefs(foo)
- const value1 = computed(() => count.value)
- const value2 = fn(count)
- const value3 = computed(() => fn(count.value))
- `,
- `
- import { toRefs } from 'vue'
- const refs = toRefs(foo)
- const value1 = computed(() => refs.count.value)
- const value2 = fn(refs.count)
- const value3 = computed(() => fn(refs.count.value))
- `,
- `
- import { ref } from 'vue'
- const count = ref(0)
- count.value = 42
- `,
- `
- import { ref } from 'vue'
- const count = ref(0)
- count.value++
- `,
- `
- import { ref } from 'vue'
- const count = ref(0)
- ;( { foo: count.value } = bar )
- `,
- `
- import { ref, computed, shallowRef, customRef, toRef } from 'vue'
- const r = ref(0)
- const c = computed(() => r.value)
- const sr = shallowRef({ count: 1 })
- const cr = customRef((track, trigger) => {
- return {
- get() { return sr.value },
- set(newValue) { sr.value = newValue }
- }
- })
- const tr = toRef(sr, 'count')
- function fn() {
- console.log(c.value, cr.value, tr.value)
- }
- `,
- // unknown
- `
- import { ref } from 'vue'
- const [a] = ref(0)
- foo.bar = ref(0)
- unknown.value
- `,
- `
- import { ref } from 'vue'
- let foo = ref(0)
- foo = foo
- `,
- // Reactivity Transform
- `
- const count = $ref(0)
- const value1 = computed(() => count)
- const value2 = fn($$(count))
- const value3 = computed(() => fn(count))
- `,
- `
- const count = $(foo)
- const value1 = computed(() => count)
- const value2 = fn($$(count))
- const value3 = computed(() => fn(count))
- `,
- `
- const { count } = $(foo)
- const value1 = computed(() => count)
- const value2 = fn($$(count))
- const value3 = computed(() => fn(count))
- `,
- `
- let count = $ref(0)
- count = 42
- `,
- `
- let count = $ref(0)
- count++
- `,
- `
- let count = $ref(0)
- ;( { foo: count } = bar )
- `,
- `
- const { v1, v2, v3, v4 } = $(foo)
- fn($$({ v1, a: [v2], a: [...v3], ...v4}))
- `,
- `
- let r = $ref(0)
- let c = $computed(() => r)
- let sr = $shallowRef({ count: 1 })
- let cr = $customRef((track, trigger) => {
- return {
- get() { return sr },
- set(newValue) { sr = newValue }
- }
- })
- let tr = $toRef($$(sr), 'count')
- function fn() {
- console.log(
- r.value,
- c.value,
- sr.value,
- cr.value,
- tr.value
- )
- }
- `
- ],
- invalid: [
- {
- code: `
- import { ref } from 'vue'
- const count = ref(0)
- const value1 = count.value
- const { value: value2 } = count
- const value3 = fn(count.value)
- const { value: value4 = 42 } = count
- if (foo) {
- const value1 = count.value
- }
- `,
- errors: [
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 4
- },
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 5
- },
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 6
- },
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 7
- },
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 9
- }
- ]
- },
- {
- code: `
- import { toRefs } from 'vue'
- const { count } = toRefs(foo)
- const value1 = count.value
- const { value: value2 } = count
- const value3 = fn(count.value)
- `,
- errors: [
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 4
- },
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 5
- },
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 6
- }
- ]
- },
- {
- code: `
- import { toRefs } from 'vue'
- const refs = toRefs(foo)
- const value1 = refs.count.value
- const { value: value2 } = refs.count
- const value3 = fn(refs.count.value)
- `,
- errors: [
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 4
- },
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 5
- },
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 6
- }
- ]
- },
- {
- code: `
- import { ref } from 'vue'
- const count = ref(0).value
- `,
- errors: [
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 3
- }
- ]
- },
- {
- code: `
- import { toRefs } from 'vue'
- const refs = toRefs(foo)
- const { foo = 42 } = refs
- const v = foo.value
- `,
- errors: [
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 5
- }
- ]
- },
- {
- code: `
- import { ref, computed, shallowRef, customRef, toRef } from 'vue'
- const r = ref(0)
- const c = computed(() => r.value)
- const sr = shallowRef({ count: 1 })
- const cr = customRef((track, trigger) => {
- return {
- get() { return sr.value },
- set(newValue) { sr.value = newValue }
- }
- })
- const tr = toRef(sr, 'count')
-
- console.log(
- r.value,
- c.value,
- sr.value,
- cr.value,
- tr.value
- )
- `,
- errors: [
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 15
- },
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 16
- },
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 17
- },
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 18
- },
- {
- message:
- 'Getting a value from the ref object in the same scope will cause the value to lose reactivity.',
- line: 19
- }
- ]
- },
- // Reactivity Transform
- {
- code: `
- const count = $ref(0)
- const value1 = count
- const value2 = fn(count)
- `,
- errors: [
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 3
- },
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 4
- }
- ]
- },
- {
- code: `
- const count = $(foo)
- const value1 = count
- const value2 = fn(count)
- `,
- errors: [
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 3
- },
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 4
- }
- ]
- },
- {
- code: `
- const { count } = $(foo)
- const value1 = count
- const value2 = fn(count)
- `,
- errors: [
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 3
- },
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 4
- }
- ]
- },
- {
- code: `
- const { v1, a: [v2 = 42], b: [...v3], ...v4 } = $(foo)
- const value1 = v1
- const value2 = v2
- const value3 = v3
- const value4 = v4
- `,
- errors: [
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 3
- },
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 4
- },
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 5
- },
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 6
- }
- ]
- },
- {
- code: `
- let r = $ref(0)
- let c = $computed(() => r)
- let sr = $shallowRef({ count: 1 })
- let cr = $customRef((track, trigger) => {
- return {
- get() { return sr },
- set(newValue) { sr = newValue }
- }
- })
- let tr = $toRef($$(sr), 'count')
- console.log(
- r.value,
- c.value,
- sr.value,
- cr.value,
- tr.value
- )
- `,
- errors: [
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 13
- },
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 14
- },
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 15
- },
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 16
- },
- {
- message:
- 'Getting a reactive variable in the same scope will cause the value to lose reactivity.',
- line: 17
- }
- ]
- }
- ]
-})
diff --git a/tests/lib/rules/no-setup-props-destructure.js b/tests/lib/rules/no-setup-props-destructure.js
deleted file mode 100644
index eecbcd6d7..000000000
--- a/tests/lib/rules/no-setup-props-destructure.js
+++ /dev/null
@@ -1,670 +0,0 @@
-/**
- * @author Yosuke Ota
- */
-'use strict'
-
-const RuleTester = require('../../eslint-compat').RuleTester
-const rule = require('../../../lib/rules/no-setup-props-destructure')
-
-const tester = new RuleTester({
- languageOptions: {
- parser: require('vue-eslint-parser'),
- ecmaVersion: 2020,
- sourceType: 'module'
- }
-})
-
-tester.run('no-setup-props-destructure', rule, {
- valid: [
- {
- filename: 'test.vue',
- code: `
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
- `
- },
- `
- Vue.component('test', {
- el: a = b
- })
- `,
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 4
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 4
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
- `
- }
- ],
- invalid: [
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'destructuring',
- line: 4,
- column: 15,
- endLine: 4,
- endColumn: 24
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 5,
- column: 17,
- endLine: 5,
- endColumn: 26
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 5
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 5
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 5
- },
- {
- messageId: 'getProperty',
- line: 11
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 5
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 5
- },
- {
- messageId: 'getProperty',
- line: 6
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 5
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 5
- },
- {
- messageId: 'getProperty',
- line: 6
- },
- {
- messageId: 'getProperty',
- line: 7
- },
- {
- messageId: 'getProperty',
- line: 9
- },
- {
- messageId: 'getProperty',
- line: 10
- },
- {
- messageId: 'getProperty',
- line: 11
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 6
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 5
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 5
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- message:
- 'Getting a value from the `props` in root scope of `
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 4
- },
- {
- messageId: 'getProperty',
- line: 5
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 5
- },
- {
- messageId: 'getProperty',
- line: 6
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 4
- },
- {
- messageId: 'getProperty',
- line: 5
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 4
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 4
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 4
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 4
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- errors: [
- {
- messageId: 'getProperty',
- line: 6
- }
- ]
- }
- ]
-})
diff --git a/tests/lib/rules/script-setup-uses-vars.js b/tests/lib/rules/script-setup-uses-vars.js
deleted file mode 100644
index cae0f017e..000000000
--- a/tests/lib/rules/script-setup-uses-vars.js
+++ /dev/null
@@ -1,447 +0,0 @@
-/**
- * @fileoverview Prevent `
-
-
-
-
- `
- ],
- invalid: []
-})
-describe('script-setup-uses-vars', () => {
- ruleTester.run('no-unused-vars', ruleNoUnusedVars, {
- valid: [
- {
- filename: 'test.vue',
- code: `
-
-
-
-
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
-
-
- {{ msg }}
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
-
-
-
-
-
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
-
-
-
-
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
-
-
-
-
- `
- },
-
- // Resolve component name
- {
- filename: 'test.vue',
- code: `
-
-
-
-
-
-
-
- `
- },
- {
- filename: 'test.vue',
- code: `
-
-
-
-
-
-
- `
- },
-
- // TopLevel await
- {
- filename: 'test.vue',
- code: `
-
-
-
- {{post}}
-
- `,
- languageOptions: {
- ecmaVersion: 2022,
- sourceType: 'module'
- }
- },
-
- // ref
- {
- filename: 'test.vue',
- code: `
-
-
-
-
-
- `
- },
-
- //style vars
- {
- filename: 'test.vue',
- code: `
-
-
-
- `
- },
- // ns
- {
- filename: 'test.vue',
- code: `
-
-
-
-
- label
-
-
- `
- }
- ],
-
- invalid: [
- {
- filename: 'test.vue',
- code: `
-
-
-
-
-
- `,
- errors: [
- {
- message: "'Bar' is defined but never used.",
- line: 6,
- suggestions: semver.gte(ESLint.version, '9.17.0')
- ? [
- {
- desc: "Remove unused variable 'Bar'.",
- output: `
-
-
-
-
-
- `
- }
- ]
- : null
- },
- {
- message: "'baz' is assigned a value but never used.",
- line: 19
- }
- ]
- },
-
- // Resolve component name
- {
- filename: 'test.vue',
- code: `
-
-
-
-
-
- `,
- errors: [
- {
- message: "'camelCase' is defined but never used.",
- line: 4,
- suggestions: semver.gte(ESLint.version, '9.17.0')
- ? [
- {
- desc: "Remove unused variable 'camelCase'.",
- output: `
-
-
-
-
-
- `
- }
- ]
- : null
- }
- ]
- },
-
- // Scope tests
- {
- filename: 'test.vue',
- code: `
-
-
-
- {{ msg }}
-
- `,
- errors: [
- {
- message: "'msg' is assigned a value but never used.",
- line: 5,
- suggestions: semver.gte(ESLint.version, '9.17.0')
- ? [
- {
- desc: "Remove unused variable 'msg'.",
- output: `
-
-
-
- {{ msg }}
-
- `
- }
- ]
- : null
- }
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
-
-
- {{ i }}
-
- `,
- errors: [
- {
- message: "'i' is assigned a value but never used.",
- line: 4
- }
- ]
- },
-
- // Not `
-
-
- {{ msg }}
-
- `,
- errors: [
- {
- message: "'msg' is assigned a value but never used.",
- line: 4
- }
- ]
- },
-
- //style vars
- {
- filename: 'test.vue',
- code: `
-
-
-
- `,
- errors: ["'color' is assigned a value but never used."]
- }
- ]
- })
-})
diff --git a/tests/lib/rules/v-on-function-call.js b/tests/lib/rules/v-on-function-call.js
deleted file mode 100644
index ad6292505..000000000
--- a/tests/lib/rules/v-on-function-call.js
+++ /dev/null
@@ -1,356 +0,0 @@
-/**
- * @author Niklas Higi
- */
-'use strict'
-
-const RuleTester = require('../../eslint-compat').RuleTester
-const rule = require('../../../lib/rules/v-on-function-call')
-
-const tester = new RuleTester({
- languageOptions: {
- parser: require('vue-eslint-parser'),
- ecmaVersion: 2020,
- sourceType: 'module'
- }
-})
-
-tester.run('v-on-function-call', rule, {
- valid: [
- {
- filename: 'test.vue',
- code: ''
- },
- {
- filename: 'test.vue',
- code: '',
- options: ['always']
- },
- {
- filename: 'test.vue',
- code: '',
- options: ['never']
- },
- {
- filename: 'test.vue',
- code: '',
- options: ['always']
- },
- {
- filename: 'test.vue',
- code: '',
- options: ['never']
- },
- {
- filename: 'test.vue',
- code: ''
- },
- {
- filename: 'test.vue',
- code: '',
- options: ['always']
- },
- {
- filename: 'test.vue',
- code: ''
- },
- {
- filename: 'test.vue',
- code: '',
- options: ['always']
- },
- {
- filename: 'test.vue',
- code: 'foo.bar()">
'
- },
- {
- filename: 'test.vue',
- code: 'foo.bar()">
',
- options: ['always']
- },
- {
- filename: 'test.vue',
- code: `
-
-
- `,
- options: ['never']
- },
- {
- filename: 'test.vue',
- code: `
-
-
- `,
- options: ['never']
- },
- {
- filename: 'test.vue',
- code: `
-
-
- `,
- options: ['never']
- },
- {
- filename: 'test.vue',
- code: `
-
-
- `,
- options: ['never', { ignoreIncludesComment: true }]
- },
- {
- filename: 'test.vue',
- code: '',
- options: ['never']
- },
- {
- filename: 'test.vue',
- code: `
-
- `,
- options: ['never']
- },
- {
- filename: 'test.vue',
- code: `
-
-
-
-
-
- `,
- options: ['never']
- },
- {
- filename: 'test.vue',
- code: `
-
-
-
-
-
- `,
- options: ['never']
- }
- ],
- invalid: [
- {
- filename: 'test.vue',
- code: '',
- output: null,
- options: ['always'],
- errors: [
- "Method calls inside of 'v-on' directives must have parentheses."
- ]
- },
- {
- filename: 'test.vue',
- code: '',
- output: ``,
- options: ['never'],
- errors: [
- "Method calls without arguments inside of 'v-on' directives must not have parentheses."
- ]
- },
- {
- filename: 'test.vue',
- code: '',
- output: ``,
- options: ['never'],
- errors: [
- "Method calls without arguments inside of 'v-on' directives must not have parentheses."
- ]
- },
- {
- filename: 'test.vue',
- code: '',
- output: null,
- options: ['never'],
- errors: [
- "Method calls without arguments inside of 'v-on' directives must not have parentheses."
- ]
- },
- {
- filename: 'test.vue',
- code: `
-
-
-
-
-