首页 新闻 会员 周边 捐助

eslint 升级后出现错误:"all of the files matching the glob pattern "src/" are ignored"

0
悬赏园豆:30 [已解决问题] 解决于 2025-08-06 19:09

将 eslint 从 8.46 升级至 9.32,并将配置从 .eslintrc.json 迁移至 eslint.config.mjs,运行 npm run lint 时出现下面的错误

You are linting "src/", but all of the files matching the glob pattern "src/" are ignored.

If you don't want to lint these files, remove the pattern "src/" from the list of arguments passed to ESLint.

If you do want to lint these files, explicitly list one or more of the files from this glob that you'd like to lint to see more details about why they are ignored.

请问如何解决这个问题?

dudu的主页 dudu | 高人七级 | 园豆:24751
提问于:2025-08-06 18:23
< >
分享
最佳答案
0

在 eslint.config.mjs 中添加下面的配置解决了

{ files: ["**/*.ts"] }
dudu | 高人七级 |园豆:24751 | 2025-08-06 18:45
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册