Skip to content

Commit e36ed66

Browse files
committedMar 12, 2024
feat: upgrade vue and ts plugins
1 parent 4c9adaa commit e36ed66

File tree

15 files changed

+166
-66
lines changed

15 files changed

+166
-66
lines changed
 

‎fixtures/input/vue-ts.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import { ref } from 'vue';
1313
1414
const greeting = ref('Hello, Vue 3!');
15-
let counter = ref<number | string>(0);
15+
let counter = ref<number | 1>(0);
1616
1717
// Define a function
1818
const incrementCounter = () => {

‎fixtures/input/vue.vue

+3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ import { ref } from '@vue/reactivity';
1313
1414
const greeting = ref('Hello, Vue 3!' + 1);
1515
let counter = ref(0)
16+
let doubled = computed(() => counter.value * 2);
1617
1718
// Define a function
1819
const incrementCounter = () => {
1920
counter.value++;
2021
};
22+
23+
let _zero = doubled + counter
2124
</script>

‎fixtures/output/all/vue-ts.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { ref } from 'vue'
44
55
const greeting = ref('Hello, Vue 3!')
6-
const counter = ref<number | string>(0)
6+
const counter = ref<number | 1>(0)
77
88
// Define a function
99
function incrementCounter() {

‎fixtures/output/all/vue.vue

+3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ import { ref } from 'vue'
44
55
const greeting = ref(`Hello, Vue 3!${1}`)
66
const counter = ref(0)
7+
const doubled = computed(() => counter.value * 2)
78
89
// Define a function
910
function incrementCounter() {
1011
counter.value++
1112
}
13+
14+
const _zero = doubled.value + counter.value
1215
</script>
1316

1417
<template>

‎fixtures/output/no-style/vue-ts.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { ref } from 'vue';
44
55
const greeting = ref('Hello, Vue 3!');
6-
const counter = ref<number | string>(0);
6+
const counter = ref<number | 1>(0);
77
88
// Define a function
99
const incrementCounter = () => {

‎fixtures/output/no-style/vue.vue

+3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ import { ref } from 'vue';
44
55
const greeting = ref(`Hello, Vue 3!${ 1}`);
66
const counter = ref(0)
7+
const doubled = computed(() => counter.value * 2);
78
89
// Define a function
910
const incrementCounter = () => {
1011
counter.value++;
1112
};
13+
14+
const _zero = doubled.value + counter.value
1215
</script>
1316

1417
<template>

‎fixtures/output/tab-double-quotes/vue-ts.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { ref } from "vue"
44
55
const greeting = ref("Hello, Vue 3!")
6-
const counter = ref<number | string>(0)
6+
const counter = ref<number | 1>(0)
77
88
// Define a function
99
function incrementCounter() {

‎fixtures/output/tab-double-quotes/vue.vue

+3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ import { ref } from "vue"
44
55
const greeting = ref(`Hello, Vue 3!${1}`)
66
const counter = ref(0)
7+
const doubled = computed(() => counter.value * 2)
78
89
// Define a function
910
function incrementCounter() {
1011
counter.value++
1112
}
13+
14+
const _zero = doubled.value + counter.value
1215
</script>
1316

1417
<template>

‎fixtures/output/ts-override/vue-ts.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { ref } from 'vue'
44
55
const greeting = ref('Hello, Vue 3!')
6-
const counter = ref<number | string>(0)
6+
const counter = ref<number | 1>(0)
77
88
// Define a function
99
function incrementCounter() {

‎fixtures/output/ts-override/vue.vue

+3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ import { ref } from 'vue'
44
55
const greeting = ref(`Hello, Vue 3!${1}`)
66
const counter = ref(0)
7+
const doubled = computed(() => counter.value * 2)
78
89
// Define a function
910
function incrementCounter() {
1011
counter.value++
1112
}
13+
14+
const _zero = doubled.value + counter.value
1215
</script>
1316

1417
<template>

‎fixtures/output/with-formatters/vue-ts.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { ref } from 'vue'
44
55
const greeting = ref('Hello, Vue 3!')
6-
const counter = ref<number | string>(0)
6+
const counter = ref<number | 1>(0)
77
88
// Define a function
99
function incrementCounter() {

‎fixtures/output/with-formatters/vue.vue

+3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ import { ref } from 'vue'
44
55
const greeting = ref(`Hello, Vue 3!${1}`)
66
const counter = ref(0)
7+
const doubled = computed(() => counter.value * 2)
78
89
// Define a function
910
function incrementCounter() {
1011
counter.value++
1112
}
13+
14+
const _zero = doubled.value + counter.value
1215
</script>
1316

1417
<template>

‎package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@
9292
"@eslint-types/typescript-eslint": "^7.0.2",
9393
"@eslint-types/unicorn": "^51.0.1",
9494
"@stylistic/eslint-plugin": "^1.6.3",
95-
"@typescript-eslint/eslint-plugin": "^7.1.1",
96-
"@typescript-eslint/parser": "^7.1.1",
95+
"@typescript-eslint/eslint-plugin": "^7.2.0",
96+
"@typescript-eslint/parser": "^7.2.0",
9797
"eslint-config-flat-gitignore": "^0.1.3",
9898
"eslint-merge-processors": "^0.1.0",
9999
"eslint-plugin-antfu": "^2.1.2",
@@ -109,7 +109,7 @@
109109
"eslint-plugin-unicorn": "^51.0.1",
110110
"eslint-plugin-unused-imports": "^3.1.0",
111111
"eslint-plugin-vitest": "^0.3.25",
112-
"eslint-plugin-vue": "^9.22.0",
112+
"eslint-plugin-vue": "^9.23.0",
113113
"eslint-plugin-yml": "^1.12.2",
114114
"eslint-processor-vue-blocks": "^0.1.1",
115115
"globals": "^14.0.0",
@@ -130,7 +130,7 @@
130130
"@stylistic/eslint-plugin-migrate": "^1.6.3",
131131
"@types/eslint": "^8.56.5",
132132
"@types/fs-extra": "^11.0.4",
133-
"@types/node": "^20.11.25",
133+
"@types/node": "^20.11.26",
134134
"@types/prompts": "^2.4.9",
135135
"@types/yargs": "^17.0.32",
136136
"@unocss/eslint-plugin": "^0.58.5",

‎pnpm-lock.yaml

+118-56
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/configs/vue.ts

+20
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,26 @@ export async function vue(
3434

3535
return [
3636
{
37+
// This allows Vue plugin to work with auto imports
38+
// https://github.com/vuejs/eslint-plugin-vue/pull/2422
39+
languageOptions: {
40+
globals: {
41+
computed: 'readonly',
42+
defineEmits: 'readonly',
43+
defineExpose: 'readonly',
44+
defineProps: 'readonly',
45+
onMounted: 'readonly',
46+
onUnmounted: 'readonly',
47+
reactive: 'readonly',
48+
ref: 'readonly',
49+
shallowReactive: 'readonly',
50+
shallowRef: 'readonly',
51+
toRef: 'readonly',
52+
toRefs: 'readonly',
53+
watch: 'readonly',
54+
watchEffect: 'readonly',
55+
},
56+
},
3757
name: 'antfu:vue:setup',
3858
plugins: {
3959
vue: pluginVue,

0 commit comments

Comments
 (0)
Please sign in to comment.