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

问题描述 投票:6回答:3

是否可以从webstorm中的Settings => Editor => Code Style => Typescript文件导入格式设置(tslint.json)?我在"node_modules/codelyzer"文件中使用规则目录tslint.json

webstorm tslint
3个回答
11
投票

自2017年WebStorm版本以来,可以应用代码样式。

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

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


2
投票

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


0
投票

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

  • 在编辑器或文件树中找到您的tslint.json文件(也可以是tslint.yaml
  • 右键单击该文件(同样,这可以是编辑器窗格或树中的文件)
  • 选择“应用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

© www.soinside.com 2019 - 2024. All rights reserved.