我遇到这个错误:
Error: ../library/.eslintrc.js » ../app/.eslintrc.js » eslint-config-react-app/jest#overrides[0]:
Environment key "jest/globals" is unknown
at /home/project/node_modules/@eslint/eslintrc/lib/shared/config-validator.js:175:23
at Array.forEach (<anonymous>)
at ConfigValidator.validateEnvironment (/home/project/node_modules/@eslint/eslintrc/lib/shared/config-validator.js:169:34)
at ConfigValidator.validateConfigArray (/home/project/node_modules/@eslint/eslintrc/lib/shared/config-validator.js:319:18)
at CascadingConfigArrayFactory._finalizeConfigArray (/home/project/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:493:23)
at CascadingConfigArrayFactory.getConfigArrayForFile (/home/project/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js:299:21)
at FileEnumerator._iterateFilesRecursive (/home/project/node_modules/eslint/lib/cli-engine/file-enumerator.js:481:49)
at _iterateFilesRecursive.next (<anonymous>)
at FileEnumerator.iterateFiles (/home/project/node_modules/eslint/lib/cli-engine/file-enumerator.js:296:49)
at iterateFiles.next (<anonymous>)
我有一个有点不寻常的设置为遗留的原因:
- /home/project有两个(相关)文件夹:应用程序,库
- 应用程序是React应用程序的主包
- 库是包含一些共享代码的单独包,作为本地依赖项安装到应用程序中
- js扩展自React应用程序和React应用程序/jest
- 库/. eslintrc.js扩展自../app/.eslintrc.js,带有一些覆盖
当我从/home/project/app运行npm run lint
时,我得到了这个错误,/home/project/app运行eslint src ../library/src
是针对两个目录运行的。
有趣的是,在开发过程中从eslint-webpack-plugin运行时,我没有收到这个错误(也配置为对这两个目录运行)。
有什么想法吗?
1条答案
按热度按时间dw1jzc5e1#
以下是帮助我