diff --git a/docs/rules/component-tags-order.md b/docs/rules/component-tags-order.md
index 0826be968..a5037cdee 100644
--- a/docs/rules/component-tags-order.md
+++ b/docs/rules/component-tags-order.md
@@ -10,8 +10,7 @@ since: v6.1.0
> enforce order of component top-level elements
-- :no_entry_sign: This rule was **deprecated** and replaced by [vue/block-order](block-order.md) rule.
-- :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.
+- :no_entry: This rule was **removed** in eslint-plugin-vue v10.0.0 and replaced by [vue/block-order](block-order.md) rule.
## :book: Rule Details
diff --git a/docs/rules/index.md b/docs/rules/index.md
index 8bac4aaa9..9b2e94ea5 100644
--- a/docs/rules/index.md
+++ b/docs/rules/index.md
@@ -341,30 +341,22 @@ The following rules extend the rules provided by ESLint itself and apply them to
-## Deprecated
-
-- :no_entry_sign: We're going to remove deprecated rules in the next major release. Please migrate to successor/new rules.
-- :innocent: We don't fix bugs which are in deprecated rules since we don't have enough resources.
-
-| Rule ID | Replaced by |
-|:--------|:------------|
-| [vue/component-tags-order] | [vue/block-order] |
-| [vue/no-invalid-model-keys] | [vue/valid-model-definition] |
-| [vue/no-ref-object-destructure] | [vue/no-ref-object-reactivity-loss] |
-| [vue/no-setup-props-destructure] | [vue/no-setup-props-reactivity-loss] |
-| [vue/script-setup-uses-vars] | (no replacement) |
-| [vue/v-on-function-call] | [vue/v-on-handler-style] |
-
## Removed
- :no_entry: These rules have been removed in a previous major release, after they have been deprecated for a while.
| Rule ID | Replaced by | Deprecated in version | Removed in version |
|:--------|:------------|:-----------------------|:-------------------|
+| [vue/component-tags-order] | [vue/block-order] | [v9.16.0] | [v10.0.0] |
| [vue/experimental-script-setup-vars] | (no replacement) | [v7.13.0] | [v9.0.0] |
| [vue/name-property-casing] | [vue/component-definition-name-casing] | [v7.0.0] | [v9.0.0] |
| [vue/no-confusing-v-for-v-if] | [vue/no-use-v-if-with-v-for] | [v5.0.0] | [v9.0.0] |
+| [vue/no-invalid-model-keys] | [vue/valid-model-definition] | [v9.0.0] | [v10.0.0] |
+| [vue/no-ref-object-destructure] | [vue/no-ref-object-reactivity-loss] | [v9.17.0] | [v10.0.0] |
+| [vue/no-setup-props-destructure] | [vue/no-setup-props-reactivity-loss] | [v9.17.0] | [v10.0.0] |
| [vue/no-unregistered-components] | [vue/no-undef-components] | [v8.4.0] | [v9.0.0] |
+| [vue/script-setup-uses-vars] | (no replacement) | [v9.0.0] | [v10.0.0] |
+| [vue/v-on-function-call] | [vue/v-on-handler-style] | [v9.7.0] | [v10.0.0] |
@@ -388,7 +380,6 @@ The following rules extend the rules provided by ESLint itself and apply them to
[vue/component-definition-name-casing]: ./component-definition-name-casing.md
[vue/component-name-in-template-casing]: ./component-name-in-template-casing.md
[vue/component-options-name-casing]: ./component-options-name-casing.md
-[vue/component-tags-order]: ./component-tags-order.md
[vue/custom-event-name-casing]: ./custom-event-name-casing.md
[vue/define-emits-declaration]: ./define-emits-declaration.md
[vue/define-macros-order]: ./define-macros-order.md
@@ -464,7 +455,6 @@ The following rules extend the rules provided by ESLint itself and apply them to
[vue/no-export-in-script-setup]: ./no-export-in-script-setup.md
[vue/no-expose-after-await]: ./no-expose-after-await.md
[vue/no-extra-parens]: ./no-extra-parens.md
-[vue/no-invalid-model-keys]: ./no-invalid-model-keys.md
[vue/no-irregular-whitespace]: ./no-irregular-whitespace.md
[vue/no-lifecycle-after-await]: ./no-lifecycle-after-await.md
[vue/no-lone-template]: ./no-lone-template.md
@@ -477,7 +467,6 @@ The following rules extend the rules provided by ESLint itself and apply them to
[vue/no-parsing-error]: ./no-parsing-error.md
[vue/no-potential-component-option-typo]: ./no-potential-component-option-typo.md
[vue/no-ref-as-operand]: ./no-ref-as-operand.md
-[vue/no-ref-object-destructure]: ./no-ref-object-destructure.md
[vue/no-ref-object-reactivity-loss]: ./no-ref-object-reactivity-loss.md
[vue/no-required-prop-with-default]: ./no-required-prop-with-default.md
[vue/no-reserved-component-names]: ./no-reserved-component-names.md
@@ -496,7 +485,6 @@ The following rules extend the rules provided by ESLint itself and apply them to
[vue/no-restricted-v-bind]: ./no-restricted-v-bind.md
[vue/no-restricted-v-on]: ./no-restricted-v-on.md
[vue/no-root-v-if]: ./no-root-v-if.md
-[vue/no-setup-props-destructure]: ./no-setup-props-destructure.md
[vue/no-setup-props-reactivity-loss]: ./no-setup-props-reactivity-loss.md
[vue/no-shared-component-data]: ./no-shared-component-data.md
[vue/no-side-effects-in-computed-properties]: ./no-side-effects-in-computed-properties.md
@@ -573,7 +561,6 @@ The following rules extend the rules provided by ESLint itself and apply them to
[vue/return-in-computed-property]: ./return-in-computed-property.md
[vue/return-in-emits-validator]: ./return-in-emits-validator.md
[vue/script-indent]: ./script-indent.md
-[vue/script-setup-uses-vars]: ./script-setup-uses-vars.md
[vue/singleline-html-element-content-newline]: ./singleline-html-element-content-newline.md
[vue/slot-name-casing]: ./slot-name-casing.md
[vue/sort-keys]: ./sort-keys.md
@@ -588,7 +575,6 @@ The following rules extend the rules provided by ESLint itself and apply them to
[vue/v-for-delimiter-style]: ./v-for-delimiter-style.md
[vue/v-if-else-key]: ./v-if-else-key.md
[vue/v-on-event-hyphenation]: ./v-on-event-hyphenation.md
-[vue/v-on-function-call]: ./v-on-function-call.md
[vue/v-on-handler-style]: ./v-on-handler-style.md
[vue/v-on-style]: ./v-on-style.md
[vue/v-slot-style]: ./v-slot-style.md
@@ -619,15 +605,25 @@ The following rules extend the rules provided by ESLint itself and apply them to
+[vue/component-tags-order]: ./component-tags-order.md
[vue/experimental-script-setup-vars]: ./experimental-script-setup-vars.md
[vue/name-property-casing]: ./name-property-casing.md
[vue/no-confusing-v-for-v-if]: ./no-confusing-v-for-v-if.md
+[vue/no-invalid-model-keys]: ./no-invalid-model-keys.md
+[vue/no-ref-object-destructure]: ./no-ref-object-destructure.md
+[vue/no-setup-props-destructure]: ./no-setup-props-destructure.md
[vue/no-unregistered-components]: ./no-unregistered-components.md
+[vue/script-setup-uses-vars]: ./script-setup-uses-vars.md
+[vue/v-on-function-call]: ./v-on-function-call.md
+[v10.0.0]: https://github.com/vuejs/eslint-plugin-vue/releases/tag/v10.0.0
[v5.0.0]: https://github.com/vuejs/eslint-plugin-vue/releases/tag/v5.0.0
[v7.0.0]: https://github.com/vuejs/eslint-plugin-vue/releases/tag/v7.0.0
[v7.13.0]: https://github.com/vuejs/eslint-plugin-vue/releases/tag/v7.13.0
[v8.4.0]: https://github.com/vuejs/eslint-plugin-vue/releases/tag/v8.4.0
[v9.0.0]: https://github.com/vuejs/eslint-plugin-vue/releases/tag/v9.0.0
+[v9.16.0]: https://github.com/vuejs/eslint-plugin-vue/releases/tag/v9.16.0
+[v9.17.0]: https://github.com/vuejs/eslint-plugin-vue/releases/tag/v9.17.0
+[v9.7.0]: https://github.com/vuejs/eslint-plugin-vue/releases/tag/v9.7.0
diff --git a/docs/rules/no-invalid-model-keys.md b/docs/rules/no-invalid-model-keys.md
index 33eb74dc8..e93c79db4 100644
--- a/docs/rules/no-invalid-model-keys.md
+++ b/docs/rules/no-invalid-model-keys.md
@@ -10,7 +10,7 @@ since: v7.9.0
> require valid keys in model option
-- :no_entry_sign: This rule was **deprecated** and replaced by [vue/valid-model-definition](valid-model-definition.md) rule.
+- :no_entry: This rule was **removed** in eslint-plugin-vue v10.0.0 and replaced by [vue/valid-model-definition](valid-model-definition.md) rule.
## :book: Rule Details
diff --git a/docs/rules/no-ref-object-destructure.md b/docs/rules/no-ref-object-destructure.md
index ea848c63e..8ea5247a1 100644
--- a/docs/rules/no-ref-object-destructure.md
+++ b/docs/rules/no-ref-object-destructure.md
@@ -10,7 +10,7 @@ since: v9.5.0
> disallow usages of ref objects that can lead to loss of reactivity
-- :no_entry_sign: This rule was **deprecated** and replaced by [vue/no-ref-object-reactivity-loss](no-ref-object-reactivity-loss.md) rule.
+- :no_entry: This rule was **removed** in eslint-plugin-vue v10.0.0 and replaced by [vue/no-ref-object-reactivity-loss](no-ref-object-reactivity-loss.md) rule.
## :book: Rule Details
diff --git a/docs/rules/no-setup-props-destructure.md b/docs/rules/no-setup-props-destructure.md
index 0ecb01f6f..66fa784c7 100644
--- a/docs/rules/no-setup-props-destructure.md
+++ b/docs/rules/no-setup-props-destructure.md
@@ -10,7 +10,7 @@ since: v7.0.0
> disallow usages that lose the reactivity of `props` passed to `setup`
-- :no_entry_sign: This rule was **deprecated** and replaced by [vue/no-setup-props-reactivity-loss](no-setup-props-reactivity-loss.md) rule.
+- :no_entry: This rule was **removed** in eslint-plugin-vue v10.0.0 and replaced by [vue/no-setup-props-reactivity-loss](no-setup-props-reactivity-loss.md) rule.
## :book: Rule Details
diff --git a/docs/rules/script-setup-uses-vars.md b/docs/rules/script-setup-uses-vars.md
index 3a8dc36e5..7f0eb15f7 100644
--- a/docs/rules/script-setup-uses-vars.md
+++ b/docs/rules/script-setup-uses-vars.md
@@ -10,7 +10,7 @@ since: v7.13.0
> prevent `',
- '',
- 'text
',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- '',
- `
-
-
-
-
-
-
- `,
- `
-
-
-
-
-
-
- `,
-
- // order
- {
- code: '',
- output: null,
- options: [{ order: ['script', 'template', 'style'] }]
- },
- {
- code: '',
- output: null,
- options: [{ order: ['template', 'script', 'style'] }]
- },
- {
- code: '',
- output: null,
- options: [{ order: ['style', 'template', 'script'] }]
- },
- {
- code: '',
- output: null,
- options: [{ order: ['template', 'docs', 'script', 'style'] }]
- },
- {
- code: '',
- output: null,
- options: [{ order: ['template', 'script', 'style'] }]
- },
- {
- code: 'text
',
- output: null,
- options: [{ order: ['docs', 'script', 'template', 'style'] }]
- },
- {
- code: '',
- output: null,
- options: [
- { order: ['script[setup]', 'script:not([setup])', 'template', 'style'] }
- ]
- },
- {
- code: '',
- output: null,
- options: [
- {
- order: [['script[setup]', 'script:not([setup])', 'template'], 'style']
- }
- ]
- },
- {
- code: '',
- output: null,
- options: [{ order: ['script', 'template', 'style'] }]
- },
- {
- code: '',
- output: null,
- options: [{ order: [['script', 'template'], 'style'] }]
- },
- {
- code: '',
- output: null,
- options: [
- { order: ['script:not([setup])', 'script[setup]', 'template', 'style'] }
- ]
- },
- {
- code: '',
- output: null,
- options: [
- {
- order: [['script:not([setup])', 'script[setup]', 'template'], 'style']
- }
- ]
- },
- {
- code: '',
- output: null,
- options: [
- {
- order: [
- ['script:not([setup])', 'script[setup]', 'template'],
- 'style[scoped]',
- 'style:not([scoped])',
- 'i18n:not([locale=en])',
- 'i18n:not([locale=ja])'
- ]
- }
- ]
- },
- {
- code: '',
- output: null,
- options: [
- {
- order: [
- 'template',
- 'script:not([setup])',
- 'script[setup]',
- 'style[scoped]',
- 'style:not([scoped])',
- 'i18n[locale=en]',
- 'i18n[locale=ja]'
- ]
- }
- ]
- },
- {
- code: '',
- output: null,
- options: [{ order: [['docs', 'script', 'template'], 'style'] }]
- },
- {
- code: '',
- output: null,
- options: [{ order: ['i18n[locale=en]', 'i18n[locale=ja]'] }]
- },
- {
- code: '',
- output: null,
- options: [{ order: ['style:not([scoped])', 'style[scoped]'] }]
- },
-
- ``,
-
- // Invalid EOF
- '' 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 f903a3f9b..000000000
--- a/tests/lib/rules/script-setup-uses-vars.js
+++ /dev/null
@@ -1,379 +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
- },
- {
- 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
- }
- ]
- },
-
- // Scope tests
- {
- filename: 'test.vue',
- code: `
-
-
-
- {{ msg }}
-
- `,
- errors: [
- {
- message: "'msg' is assigned a value but never used.",
- line: 5
- }
- ]
- },
- {
- 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: `
-
-
-
-
-
- `,
- output: null,
- options: ['never'],
- errors: [
- "Method calls without arguments inside of 'v-on' directives must not have parentheses.",
- "Method calls without arguments inside of 'v-on' directives must not have parentheses.",
- "Method calls without arguments inside of 'v-on' directives must not have parentheses.",
- "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: `
-
-
- `,
- 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.",
- "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: `
-
-
- `,
- options: ['never'],
- errors: [
- "Method calls without arguments inside of 'v-on' directives must not have parentheses."
- ]
- },
- {
- filename: 'test.vue',
- code: '\r\n',
- output: '\r\n',
- 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: `
-
- `,
- options: ['never'],
- errors: [
- "Method calls without arguments inside of 'v-on' directives must not have parentheses."
- ]
- }
- ]
-})
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy