typescript - 无法提交,因为 Prettier 无法识别新文件
问题描述
在提交之前,我正在使用 bazelisk 构建和测试我的代码。但是,我遇到了提交中止并出现错误的问题:
[0 / 8] [Prepa] BazelWorkspaceStatusAction stable-status.txt
INFO: Build completed successfully, 3 total actions
INFO: Build completed successfully, 3 total actions
Running frontend prettier
proj/dir1/dir2/src/components/ui/TextField.tsx 7ms
[error] No files matching the pattern were found: "proj/dir1/dir2/src/forms".
[error] No files matching the pattern were found: "proj/dir1/dir2/src/forms/myForm.tsx".
这是一个更漂亮的问题吗?我正在使用 WebStorm,我的 IDE 也无法识别任何本地文件。我可以运行应用程序并进行更改,但我的导入是红色的,并带有错误
TS2307: Cannot find module 'src/components/ui/Button' or its corresponding type declarations.
这个问题与提交问题有关吗?由于 TS 错误消息,我相信这是一个打字稿问题,但是当它运行得更漂亮时提交失败,所以我不确定它们是相同的问题还是 2 个不同的问题。我该如何解决这个问题?
我尝试删除我的 node_modules 和 package-lock.json 以尝试使用 npm i 进行重置,但它遇到了这个问题。
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
运行 npm i --legacy-peer-deps 创建节点模块和包锁,所以这不是一个大问题,但这是我的 IDE 和 prettier 无法识别本地文件的原因吗?外部导入中不存在错误,这使我相信 node_modules 和 package-lock 已正确设置。
任何指导表示赞赏。
解决方案
推荐阅读
- java - @Bean 注解在 Spring Boot 中不起作用
- python - 如何解决有关 TensorFlow 环境的此错误?
- vue.js - 等待并从全局类 Vue 获取异步数据
- graphdb - 询问 GraphDB 中存储库之间的推断
- kubernetes - 具有 GPU 工作节点的 Kubernetes 上的 Jupyterhub
- python - add() 和 create() 函数的区别以及 save() 方法的功能
- azure-functions - 如何使用 java 在 Cosmos DB 中设置重试策略?
- python - 我怎样才能立即获得这个 itertools.product() 的长度,因为 len(list()) 将花费无限长的时间来做到这一点?
- python - 在python中总结数组的浮动元素是在答案的末尾添加垃圾值吗?
- c# - XDocument 按属性日期值过滤