无法解析绒毛级配置

发布于 2025-02-05 16:10:44 字数 434 浏览 2 评论 0原文

在运行lint阶段时,我会收到以下错误 -

”在此处输入图像说明“

这是我的lint阶段配置文件 -

module.exports = {
    'src/**/*.ts': ['eslint --fix', () => 'tsc --noEmit'],
    '**/*.{ts,js,json,yaml}': 'prettier --write',
    '**/*': 'inflint -c inflint.config.ts',
};

When running lint-staged I get the following error -

enter image description here

This is my lint-staged config file -

module.exports = {
    'src/**/*.ts': ['eslint --fix', () => 'tsc --noEmit'],
    '**/*.{ts,js,json,yaml}': 'prettier --write',
    '**/*': 'inflint -c inflint.config.ts',
};

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

随风而去 2025-02-12 16:10:45

使用debug标志运行,然后查看相应的配置被挑选的位置,因为看不到package。

在我的情况下,已将早期的node_modules备份到node_modules.bk,它的备份在第三方package.json中选择它工作正常。

NPX绒毛级 - D

lint-staged:loadConfig Successfully loaded config from ...react-i18next/package.json`:
  lint-staged:loadConfig {
  lint-staged:loadConfig   linters: { '*.{ts,tsx,js,json,md}': [ 'prettier --write', 'git add' ] },
  lint-staged:loadConfig   ignore: [
  lint-staged:loadConfig     '**/dist/**/*.js',
  lint-staged:loadConfig     '**/react-i18next.js',
  lint-staged:loadConfig     '**/react-i18next.min.js'
  lint-staged:loadConfig   ]
  lint-staged:loadConfig } +0ms

Run with the debug flag and see where the corresponding config is being picked up as don't see it taken from package.json

In my case, had taken a backup of earlier node_modules to node_modules.bk and it's picking the lint-staged config in third-party package.json as it might be ignoring only node_modules, after deleting node_modules.bk it worked fine.

npx lint-staged -d

lint-staged:loadConfig Successfully loaded config from ...react-i18next/package.json`:
  lint-staged:loadConfig {
  lint-staged:loadConfig   linters: { '*.{ts,tsx,js,json,md}': [ 'prettier --write', 'git add' ] },
  lint-staged:loadConfig   ignore: [
  lint-staged:loadConfig     '**/dist/**/*.js',
  lint-staged:loadConfig     '**/react-i18next.js',
  lint-staged:loadConfig     '**/react-i18next.min.js'
  lint-staged:loadConfig   ]
  lint-staged:loadConfig } +0ms
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文