简体   繁体   中英

How to configure tsline in settings.json?

I am using visual studio code

When i search for settings.json file it looks like this

{
    "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

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

but what should be the value for tsline on editor.defaultFormatter so it will use 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. Here's an article how to migrate for TSLint to ESLint ( https://github.com/typescript-eslint/typescript-eslint#typescript-eslint )

  1. Download and install ESLint extension
  2. Once you've downloaded the extension, hit gear icon to go into the Extension Settings
  3. In Extension Settings you will see Eslint > Format: Enable that needs to be checked (image attached below). 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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