类似于此问题
我正在运行以下命令来整理我的angular2 typeScript代码.
I am running the following command to linting my angular2 typeScript code.
ng lint它很好地证明了所有的掉毛错误.
It is proving all the linting error nicely.
但是我希望我的供应商文件夹(例如说"src/app/quote/services/generated/**/*")不包括在内.
But I want my vendor folder (let say "src/app/quote/services/generated/**/*") should not get included at the time of lining.
我知道可以使用tslint命令来完成此操作,如下所示(参考此处)
I know this can be done with tslint command as follows (Reference Here)
tslint \"src/**/*.ts\" -e \"**/__test__/**\"但是在角度cli中,参数是什么?如何从tslint中排除某些文件?
But in angular cli what will be the parameter? How to exclude some files from tslint?
注意:我的Angular Cli版本是:@ angular/cli:1.0.0-rc.0
Note: My Angular Cli version is : @angular/cli: 1.0.0-rc.0
推荐答案在 Angular6 + 中,.angular-cli.json已替换为angular.json,但是您仍然可以在其部分.
From Angular6+, .angular-cli.json has been replaced by angular.json, but you can still add the exclude path in its lint part.
"lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": [ "src/tsconfig.app.json", "src/tsconfig.spec.json" ], "exclude": [ "**/node_modules/**" // excluded directories ] } }
根据angular-cli issue#5063 ,您可以添加排除 .angular-cli.json 中的路径,如下所示:
According to the angular-cli issue#5063, you can add the exclude path in .angular-cli.json like this:
"lint": [ { "project": "src/tsconfig.app.json", "exclude": "**/node_modules/**/*" // the node_modules for example }]更多推荐
如何在Angular CLI中忽略/排除某些文件/目录
发布评论