question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gaps between tslint-language-service and vscode-tslint

See original GitHub issue
  • Show the user tslint warnings like ‘rule not found’. blocked - currently shown in the server log only, which is intended for plugin authors but not users, see Microsoft/TypeScript#15913
  • The no-unused-variable-rule is disabled by default blocked - the rule has side effects and triggers an assertion failure palantir/tslint#2649. There is a fix for the side effect, that will be available in a next version. Even with the fix the rule requires to re-analyze a file for linting and it is too expensive to enable.
  • Auto fix on save blocked - the TypeScript language server has no notion of a pre save hook Microsoft/TypeScript#15917
  • Automatically revalidate open files when the tslint.json configuration file changes. blocked - requires an API to trigger a revalidation of the open files Microsoft/TypeScript#15914
  • Revalidate open files when the plugin settings inside the tsconfig.json changes. blocked - Microsoft/TypeScript#15915

Settings

  • tslint.autoFixOnSave - fix auto fixable warnings when a file is saved. blocked see above
  • tslint.run - run the linter onSave or onType, default is onType. blocked - typescript always creates diagnostics as the user types

Commands contributed by vscode-tslint

from Microsoft/vscode-ts-tslint#1:

  • tslint.fixAllProblems - which also enables to define a key binding, requires to send a event to a plugin.
  • tslint.createConfig - should be created using tslint --init
  • tslint.showOutputChannel - depends on TS support for channel specific logging from a plugin see above

Custom quick fixes

vscode-tslint provides some custom quick fixes. Rather than providing quick fixes the better approach is to make PRs against the tslint rules.

  • quotemark - quick fix has been added in tslint 5
  • triple-equals - no quick fix provided by tslint
  • comment-format - no quick fix provided by tslint
  • whitespace - no quick fix provided by tslint

Should be provided by tslint editor extension

  • Intellisense/validation for language service plugins contributions in the tsconfig.json
  • tslint status indicator the vscode typescript status indicator should show status/provide access to the status of extensions
  • tslint.json schema validation
  • support to create a default tslint.json

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:10
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
DimitryDushkincommented, Jun 19, 2018

Hey! Is auto-fix available now?

1reaction
angelozerrcommented, May 15, 2017

I work on a PR that addresses several of the above issues.

Very cool!

Quick fix for fixing all auto fixable rule failures Quick fix for fixing all rule failures for a particular rule

I think this feature should be supported by tsserver, no? But for the moment we could implement it.

Auto fix on save

I tell me more and more if getSemanticDiagnostics should have a context parameter. The context parameter is filled by the editor client and in our case we could ignore error or not. In Eclipse, I would like to have this parameter too to ignore compute of tslint fix when there is compile on save which is executed (in this case I don’t need to compute fix for ts files which depends of the ts file which is saved).

I see several values for this context:

  • onType
  • onSave
  • onCompile

Those values could be filled with a tsserver request when semantic command is called.

Revalidate open files when the tslint.json configuration file changes.

Could you create an issue at TypeScript please?

Intellisense for language service plugins

What do you mean?

support to create a default tslint.json

In typescript.java I provide a wizard which generates tslint.json with tslint --init

custom path to node modules directory, used to load tslint from a different location than the default of the current workspace or the global node modules directory.

It seems that TypeScript 2.4 will provide “global” plugins, perhaps it will fix this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode not recognizing tslint-language-service · Issue #40 - GitHub
I'm not sure if I've configured something incorrectly or if vscode is just ... Your tslint-language-service is installed in the same folder than...
Read more >
TSLint - Visual Studio Marketplace
This extension works using VS Code's built-in version of TypeScript and a local or global install of tslint. You do not need to...
Read more >
Version mismatch between tsc compiler and VS Code's ...
A version mismatch between the globally installed tsc compiler (1.0.3.0) and VS Code's language service (1.8.10) has.
Read more >
10 Awesome VS Code Extensions - Ionic Blog
Note: It was recently announced by the TSLint team that they plan on deprecating TSLint and focus on making TypeScript work better for...
Read more >
TSLint in Visual Studio Code - YouTube
In this video we will discuss, How to display linting errors in Visual Studio Code Healthy diet is very important both for the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found