Skip to content

Commit 195a35e

Browse files
authored
fix: more accurate types for URL and vue-router (#23)
1 parent 9deb3e9 commit 195a35e

File tree

52 files changed

+106
-88
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+106
-88
lines changed

playground/default/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/jsx-pinia-with-tests/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/jsx-pinia/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/jsx-router-pinia-with-tests/src/App.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup>
2+
import { RouterLink, RouterView } from 'vue-router'
23
import HelloWorld from '@/components/HelloWorld.vue'
34
</script>
45

@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
1011
<HelloWorld msg="You did it!" />
1112

1213
<nav>
13-
<router-link to="/">Home</router-link>
14-
<router-link to="/about">About</router-link>
14+
<RouterLink to="/">Home</RouterLink>
15+
<RouterLink to="/about">About</RouterLink>
1516
</nav>
1617
</div>
1718
</header>
1819

19-
<router-view />
20+
<RouterView />
2021
</template>
2122

2223
<style>

playground/jsx-router-pinia-with-tests/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/jsx-router-pinia/src/App.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup>
2+
import { RouterLink, RouterView } from 'vue-router'
23
import HelloWorld from '@/components/HelloWorld.vue'
34
</script>
45

@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
1011
<HelloWorld msg="You did it!" />
1112

1213
<nav>
13-
<router-link to="/">Home</router-link>
14-
<router-link to="/about">About</router-link>
14+
<RouterLink to="/">Home</RouterLink>
15+
<RouterLink to="/about">About</RouterLink>
1516
</nav>
1617
</div>
1718
</header>
1819

19-
<router-view />
20+
<RouterView />
2021
</template>
2122

2223
<style>

playground/jsx-router-pinia/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/jsx-router-with-tests/src/App.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup>
2+
import { RouterLink, RouterView } from 'vue-router'
23
import HelloWorld from '@/components/HelloWorld.vue'
34
</script>
45

@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
1011
<HelloWorld msg="You did it!" />
1112

1213
<nav>
13-
<router-link to="/">Home</router-link>
14-
<router-link to="/about">About</router-link>
14+
<RouterLink to="/">Home</RouterLink>
15+
<RouterLink to="/about">About</RouterLink>
1516
</nav>
1617
</div>
1718
</header>
1819

19-
<router-view />
20+
<RouterView />
2021
</template>
2122

2223
<style>

playground/jsx-router-with-tests/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/jsx-router/src/App.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup>
2+
import { RouterLink, RouterView } from 'vue-router'
23
import HelloWorld from '@/components/HelloWorld.vue'
34
</script>
45

@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
1011
<HelloWorld msg="You did it!" />
1112

1213
<nav>
13-
<router-link to="/">Home</router-link>
14-
<router-link to="/about">About</router-link>
14+
<RouterLink to="/">Home</RouterLink>
15+
<RouterLink to="/about">About</RouterLink>
1516
</nav>
1617
</div>
1718
</header>
1819

19-
<router-view />
20+
<RouterView />
2021
</template>
2122

2223
<style>

playground/jsx-router/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/jsx-with-tests/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/jsx/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/pinia-with-tests/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/pinia/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/router-pinia-with-tests/src/App.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup>
2+
import { RouterLink, RouterView } from 'vue-router'
23
import HelloWorld from '@/components/HelloWorld.vue'
34
</script>
45

@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
1011
<HelloWorld msg="You did it!" />
1112

1213
<nav>
13-
<router-link to="/">Home</router-link>
14-
<router-link to="/about">About</router-link>
14+
<RouterLink to="/">Home</RouterLink>
15+
<RouterLink to="/about">About</RouterLink>
1516
</nav>
1617
</div>
1718
</header>
1819

19-
<router-view />
20+
<RouterView />
2021
</template>
2122

2223
<style>

playground/router-pinia-with-tests/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/router-pinia/src/App.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup>
2+
import { RouterLink, RouterView } from 'vue-router'
23
import HelloWorld from '@/components/HelloWorld.vue'
34
</script>
45

@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
1011
<HelloWorld msg="You did it!" />
1112

1213
<nav>
13-
<router-link to="/">Home</router-link>
14-
<router-link to="/about">About</router-link>
14+
<RouterLink to="/">Home</RouterLink>
15+
<RouterLink to="/about">About</RouterLink>
1516
</nav>
1617
</div>
1718
</header>
1819

19-
<router-view />
20+
<RouterView />
2021
</template>
2122

2223
<style>

playground/router-pinia/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/router-with-tests/src/App.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup>
2+
import { RouterLink, RouterView } from 'vue-router'
23
import HelloWorld from '@/components/HelloWorld.vue'
34
</script>
45

@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
1011
<HelloWorld msg="You did it!" />
1112

1213
<nav>
13-
<router-link to="/">Home</router-link>
14-
<router-link to="/about">About</router-link>
14+
<RouterLink to="/">Home</RouterLink>
15+
<RouterLink to="/about">About</RouterLink>
1516
</nav>
1617
</div>
1718
</header>
1819

19-
<router-view />
20+
<RouterView />
2021
</template>
2122

2223
<style>

playground/router-with-tests/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/router/src/App.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup>
2+
import { RouterLink, RouterView } from 'vue-router'
23
import HelloWorld from '@/components/HelloWorld.vue'
34
</script>
45

@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
1011
<HelloWorld msg="You did it!" />
1112

1213
<nav>
13-
<router-link to="/">Home</router-link>
14-
<router-link to="/about">About</router-link>
14+
<RouterLink to="/">Home</RouterLink>
15+
<RouterLink to="/about">About</RouterLink>
1516
</nav>
1617
</div>
1718
</header>
1819

19-
<router-view />
20+
<RouterView />
2021
</template>
2122

2223
<style>

playground/router/vite.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/typescript-jsx-pinia-with-tests/vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/typescript-jsx-pinia/vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/typescript-jsx-router-pinia-with-tests/src/App.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup lang="ts">
2+
import { RouterLink, RouterView } from 'vue-router'
23
import HelloWorld from '@/components/HelloWorld.vue'
34
</script>
45

@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
1011
<HelloWorld msg="You did it!" />
1112

1213
<nav>
13-
<router-link to="/">Home</router-link>
14-
<router-link to="/about">About</router-link>
14+
<RouterLink to="/">Home</RouterLink>
15+
<RouterLink to="/about">About</RouterLink>
1516
</nav>
1617
</div>
1718
</header>
1819

19-
<router-view />
20+
<RouterView />
2021
</template>
2122

2223
<style>

playground/typescript-jsx-router-pinia-with-tests/vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/typescript-jsx-router-pinia/src/App.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup lang="ts">
2+
import { RouterLink, RouterView } from 'vue-router'
23
import HelloWorld from '@/components/HelloWorld.vue'
34
</script>
45

@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
1011
<HelloWorld msg="You did it!" />
1112

1213
<nav>
13-
<router-link to="/">Home</router-link>
14-
<router-link to="/about">About</router-link>
14+
<RouterLink to="/">Home</RouterLink>
15+
<RouterLink to="/about">About</RouterLink>
1516
</nav>
1617
</div>
1718
</header>
1819

19-
<router-view />
20+
<RouterView />
2021
</template>
2122

2223
<style>

playground/typescript-jsx-router-pinia/vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/typescript-jsx-router-with-tests/src/App.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup lang="ts">
2+
import { RouterLink, RouterView } from 'vue-router'
23
import HelloWorld from '@/components/HelloWorld.vue'
34
</script>
45

@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
1011
<HelloWorld msg="You did it!" />
1112

1213
<nav>
13-
<router-link to="/">Home</router-link>
14-
<router-link to="/about">About</router-link>
14+
<RouterLink to="/">Home</RouterLink>
15+
<RouterLink to="/about">About</RouterLink>
1516
</nav>
1617
</div>
1718
</header>
1819

19-
<router-view />
20+
<RouterView />
2021
</template>
2122

2223
<style>

playground/typescript-jsx-router-with-tests/vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath, URL } from 'url'
22

33
import { defineConfig } from 'vite'
44
import vue from '@vitejs/plugin-vue'

playground/typescript-jsx-router/src/App.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup lang="ts">
2+
import { RouterLink, RouterView } from 'vue-router'
23
import HelloWorld from '@/components/HelloWorld.vue'
34
</script>
45

@@ -10,13 +11,13 @@ import HelloWorld from '@/components/HelloWorld.vue'
1011
<HelloWorld msg="You did it!" />
1112

1213
<nav>
13-
<router-link to="/">Home</router-link>
14-
<router-link to="/about">About</router-link>
14+
<RouterLink to="/">Home</RouterLink>
15+
<RouterLink to="/about">About</RouterLink>
1516
</nav>
1617
</div>
1718
</header>
1819

19-
<router-view />
20+
<RouterView />
2021
</template>
2122

2223
<style>

0 commit comments

Comments
 (0)