如何在webstorm中导入tslint.json的代码格式设置?

How to import code formatting settings from tslint.json in webstorm?

是否可以从我在 webstorm 中的 tslint.json 文件导入格式设置 (Settings => Editor => Code Style => Typescript)?我在 tslint.json 文件

中使用规则目录 "node_modules/codelyzer"

暂时不能。您可以投票支持并关注此功能请求的更新:https://youtrack.jetbrains.com/issue/WEB-19481

自2017年WebStorm版本,可以应用代码风格

只需打开tslint.json,WebStorm会询问是否可以导入。

阅读 WebStorm 2017.1 EAP, 171.2455: improved integration with TSLint

自 2018 年起,您可以手动应用 TsLint 设置:

  • 在编辑器或文件树中找到您的 tslint.json 文件(也可以是 tslint.yaml
  • 右键单击文件(同样,这可以是编辑器窗格或树中的文件)
  • Select 应用 TSLint 代码样式规则。 (应该是最后一个选项)

事件日志应更新为:

TSLint: The project code style and editor settings were updated based on 'tslint.json'.

来自 JetBrains 的更多内容(带图片): WebStorm Help | Importing code style from a TSLint configuration file