在测试中开始使用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时,看不到错误。有人遇到过吗?
答案 0 :(得分:1)
遇到此问题时,可以通过运行npm install --save dtslint