Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Forces editor to open tslint.json file as "JSON with Comments" instead of "JSON" regardless of editor file association settings #68

Closed
jolexxa opened this issue Mar 10, 2019 · 1 comment

Comments

@jolexxa
Copy link

jolexxa commented Mar 10, 2019

The linter plugin forces VSCode to open the tslint.json file with the language set to "JSON with Comments" regardless of the user's VSCode file associations settings.

  • VSCode Version: 1.32.1
  • OS Version: macOS Mojave 10.14.3

Steps to Reproduce:

  1. Open a tslint.json file with vscode-typescript-tslint-plugin enabled.
  2. Notice that vscode-typescript-tslint-plugin has incorrectly sets the language to "JSON with Comments"

I can verify that it is the plugin causing the language change. Running code --disable-extensions produces the correct behavior where the file is opened only as "JSON." I manually disabled extensions one-by-one until I confirmed that vscode-typescript-tslint-plugin is causing the issue.

This would not be a problem except that vscode-typescript-tslint-plugin overrides my settings as mentioned in #45 (comment)

"files.associations": {
  "tsconfig.json": "json"
}

I understand that comments are allowed in tslint.json files, but trailing commas cost me far more in productivity and I never utilize comments in those files. I would guess that many other developers feel the same way as evidenced by #45.

I would much rather be warned about a trailing comma and lose my ability to use comments until the tslint JSON parser becomes more forgiving.

@mjbvz
Copy link
Contributor

mjbvz commented May 22, 2019

Fixed by 4748ba7

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants