angular - 如何在节点模块包上跳过 typescript 的 noImplicitAny=true 规则?

标签 angular typescript webpack typescript2.0 webpack-2

我正在使用 Typescript 2 和 Webpack 2 构建 Angular 2 应用程序。作为加载程序,我使用 awesome-typescript-loader。我在 tsconfig.json 中设置了 noImplicitAny = true。但是我隐式使用的一些 npm 包具有“任何”类型。 (例如 angular2-platform-node)。所以我只想在 npm 包上跳过该规则,而不是在我的应用程序源上。我该如何配置?

最佳答案

您可以使用 skipLibCheck 编译器选项 ( added in typescript 2.0 ) 跳过所有声明文件的类型检查

{
  "compilerOptions": {
    "noImplicitAny": true,
    "skipLibCheck": true,
    ...
}

关于angular - 如何在节点模块包上跳过 typescript 的 noImplicitAny=true 规则?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40836657/

相关文章:

angular - 如何使用angular 2将我的json数据导出为pdf,excel

angular - 无法解析 [Component] 的所有参数

javascript - RxJS(和 Angular ): Attempting to cache one-time HTTP requests still causes multiple requests

css - 如何在 ReactJS 中将 JSON 传递给 Sass?

python - Django Rest Framework 和 Angular 2 文件上传

angular - Angular 9 的 PrimeNG Quill Editor 自定义字体大小设置问题

javascript - TypeScript 中的方法名称

javascript - TypeScript + Cucumber 问题 : Error: function timed out after 10000 milliseconds

ruby-on-rails - (发出值而不是错误实例)bulma css 中的 postcss-custom-properties

javascript - Webpack,less-loader - 意外的 token - 为什么?