我正在使用配置了 tslint 的 angular2 webpack starter。
我也使用ngx-datables(直接在node_modules中的目录@swimlane)。
我有很多警告,例如:
@ ./~/@swimlane/ngx-datatable/src/utils/index.ts 14:0-32
@ ./~/@swimlane/ngx-datatable/src/components/datatable.component.ts
@ ./~/@swimlane/ngx-datatable/src/components/index.ts
@ ./~/@swimlane/ngx-datatable/src/index.ts
@ ./src/app/adherent/list/adherent-list.component.ts
@ ./src/app/adherent/list/index.ts
@ ./src/app/adherent/index.ts
@ ./src/app/app.module.ts
@ ./src/app/index.ts
@ ./src/main.browser.ts
@ multi (webpack)-dev-server/client?http://localhost:3000 ./src/main.browser.ts
但是,我的配置应该做得很好:
tsconfig.json :
...
"exclude": [
"node_modules",
"dist"
],
...
tsconfig.webpack.json :
...
"exclude": [
"node_modules",
"dist",
"src/**/*.spec.ts",
"src/**/*.e2e.ts"
],
...
tslint.json :
...
"exclude": [
"node_modules"
],
...
我也试过 "**/node_modules/**"
。但是什么都没有改变,我仍然有警告。
最佳答案
您应该对其中的所有文件夹使用/**
"exclude": [
"node_modules/**"
],
...
关于angular - TSLINT 配置 : exclude external modules,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43273171/