Fra*_*rzi 3 lint webstorm typescript eslint tslint
我有一个由遗留 JavaScript 代码(包括 eslint)和新的 TypeScript 代码(包括 tslint)组成的大型网络应用程序。
我的问题是我的 IDE (WebStorm) 会自动将两个 linter 应用于所有文件,因此在 TypeScript 中,我从 eslint 收到了我不应该收到的错误。
如何确保 eslint 仅应用于 *.js 文件而不应用于 *.ts 文件(应该只由 tslint 检查)?
您可以尝试添加*.ts到.eslintignore. 见https://www.jetbrains.com/help/webstorm/2019.2/eslint.html#ws_eslint_suppress_linting_typescript
Webstorm 仅遵循您定义的配置(如果您在项目上激活了两个插件),您必须添加.eslintignore以下内容:
**/*.ts
Run Code Online (Sandbox Code Playgroud)
在你的tslint.json类似的东西中:
| 归档时间: |
|
| 查看次数: |
5954 次 |
| 最近记录: |