codercup / unibest

unibest - 最好用的 uniapp 开发框架。unibest 是由 uniapp + Vue3 + Ts + Vite4 + UnoCss + UniUI 驱动的跨端快速启动模板,使用 VS Code 开发,具有代码提示、自动格式化、统一配置、代码片段等功能,同时内置了大量平时开发常用的基本组件,开箱即用,让你编写 uniapp 拥有 best 体验。
https://codercup.github.io/unibest-docs/
MIT License
1.29k stars 172 forks source link

怎么配置才能在import的时候省略组件的拓展名 #131

Open berial opened 4 days ago

berial commented 4 days ago

Bug report(问题描述)

import自定义组件的时候eslint报错

Steps to reproduce(问题复现步骤)

import AppCard from '@/components/app-card' // .vue' 不写.vue就会提示错误

Missing file extension for "@/components/app-card"eslintimport/extensions 找不到模块“@/components/app-card”或其相应的类型声明。ts-plugin(2307)

Screenshot or Gif(截图或动态图)

minimal reproduction(最小可还原代码)

System Info

npx envinfo --system --npmPackages vue --binaries --browsers

执行上面命令,将结果贴下面