microsoft / vscode-typescript-tslint-plugin

VS Code extension that provides TSLint support using the typescript-tslint-plugin
https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-tslint-plugin
MIT License
188 stars 35 forks source link

Setting tslint.configFile does not work #87

Closed yehudamakarov closed 5 years ago

yehudamakarov commented 5 years ago

I'm editing 1 .js file in VS Code. I downloaded this plugin, and already have a global install of the TSLint package. I noticed that semicolon's are not being added to my .js files on save.

I set tslint.jsEnable to true, and noticed some auto formatting happening, but still no semicolons. I tried to follow this:

tslint.configFile - The configuration file that tslint should use instead of the default tslint.json. A relative file path is resolved relative to the project root.

So I added a tslint.json to the project root with

{
    "jsRules": {
        "semicolon": true
    },
    "rules": {
        "semicolon": true
    }
}

and I set the tslint.configFile to ./tslint.json and I tried tslint.json too.

And no formatting in reference to semicolons.

Does anyone have any idea what I need to do?!

yehudamakarov commented 5 years ago

started working mysteriously after about an hour of frustration. No settings needed to be adjusted.

However, why on earth would I have to duplicate the jsrules and the rules sections?

{
    "jsRules": {
        "semicolon": true
    },
}

doesn't warn about missing semicolons, only

{
    "jsRules": {
        "semicolon": true
    },
    "rules": {
        "semicolon": true
    }
}

does.

Probably a TSLint issue, but they aren't taking any.