tslint - Nock - 无效的“扩展”配置值 tslint 错误
问题描述
在我开始在测试中使用 nock 后,我收到以下 tslint 错误。
Failed to load <project-folder>\node_modules\nock\types\tslint.json: Invalid "extends" configuration value - could not require "dtslint/dtslint.json". Review the Node lookup algorithm (https://nodejs.org/api/modules.html#modules_all_together) for the approximate method TSLint uses to find the referenced configuration file.
节点版本 - 10.16.2 Nock 版本 - 11.3.5
TSLint 配置
"defaultSeverity": "error",
"extends": ["tslint:recommended", "tslint-config-prettier"],
"jsRules": {},
"rules": {
"ordered-imports": [false],
"object-literal-sort-keys": false
},
"rulesDirectory": [],
"linterOptions": {
"exclude": ["node_modules/**"]
}
}
json包中的测试脚本
tslint --project tsconfig.json **/*.ts && jest --colors --coverage --passWithNoTests
当我使用 nock 版本 10.0.6 时,我没有看到错误。有没有人遇到过这个问题?
解决方案
当我遇到这个问题时,它通过运行修复:npm install --save dtslint
推荐阅读
- html - 修复了标题重叠的内容
- flask - 查找其数组属性包含字符串的实体
- rust - 修改单元格
> 通过多个所有者 - UB 与否? - c# - 如何解决 C# web api 错误 404 未找到
- java - 无法使执行器端点在旧 Spring 引导项目中工作 - 获取身份验证页面
- c - FFMPEG encode_audio.c 与 g722 编码器一起崩溃
- java - RestTemplate.exchange 方法中的 uriVariable 问题
- postgresql - Postgres 上的表膨胀
- command-line - 如果“.EXE”后缀缺失,所有内容都不能识别为内部或外部命令、可运行程序或批处理文件
- email - Auth0 - Sendgrid 不发送电子邮件但处理测试电子邮件