简体   繁体   English

如何在settings.json中配置tsline?

[英]How to configure tsline in settings.json?

I am using visual studio code我正在使用视觉工作室代码

When i search for settings.json file it looks like this当我搜索 settings.json 文件时,它看起来像这样

{
    "liveServer.settings.donotVerifyTags": true,
    "liveServer.settings.donotShowInfoMsg": true,
    "javascript.updateImportsOnFileMove.enabled": "always",
    "editor.insertSpaces": false,
    "editor.detectIndentation": false,
    "editor.codeActionsOnSave": {},
    "diffEditor.ignoreTrimWhitespace": false,
    "settingsSync.ignoredSettings": [
    
    ]
}

how can i configure my vs code so every time when i format my document It will use my tsline rules我如何配置我的 vs 代码,所以每次我格式化我的文档时它都会使用我的 tsline 规则

for prettier i already found answer for that reference here https://stackoverflow.com/questions/49640469/how-do-you-determine-which-formatter-is-being-used-for-vs-code为了更漂亮,我已经在这里找到了该参考的答案https://stackoverflow.com/questions/49640469/how-do-you-determine-which-formatter-is-being-used-for-vs-code

but what should be the value for tsline on editor.defaultFormatter so it will use tslint?但是 editor.defaultFormatter 上editor.defaultFormatter的值应该是多少,所以它会使用 tslint?

Firstly I'd like to mention that TSLint has been deprecated and all the functionality added/replaced in ESLint and I recommend you use that.首先,我想提一下 TSLint 已被弃用,并且在 ESLint 中添加/替换了所有功能,我建议您使用它。 Here's an article how to migrate for TSLint to ESLint ( https://github.com/typescript-eslint/typescript-eslint#typescript-eslint )这是一篇如何将 TSLint 迁移到 ESLint 的文章( https://github.com/typescript-eslint/typescript-eslint#typescript-eslint

  1. Download and install ESLint extension下载并安装 ESLint 扩展
  2. Once you've downloaded the extension, hit gear icon to go into the Extension Settings下载扩展后,点击齿轮图标 go 进入扩展设置
  3. In Extension Settings you will see Eslint > Format: Enable that needs to be checked (image attached below).扩展设置中,您将看到Eslint > Format: Enable需要检查(下图)。 在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM