Skip to content

Demonstrates that the TSLint extension for VSCode fails to show some errors

Notifications You must be signed in to change notification settings

JamesMessinger/tslint-vscode-bug-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bug Repro

This repo is a minimalistic reproduction of a bug in the TSLint extension for VSCode. It demonstrates that some linter errors don't appear in VSCode, but do appear when TSLint is run from the command-line.

Explanation

TSLint Config

This project only has two TSLint rules enabled:

tslint.yaml

rules:
  no-empty: true
  no-void-expression: true

TypeScript Code

This project has a single TypeScript code file that contains a violation of each of these rules:

index.ts

export function add(a: number, b: number): number {
  console.log(empty());                             // <--- violates the "no-void-expression" rule
  return a + b;
}

export function empty(): void { }                   // <--- violates the "no-empty" rule

TSLint Results

When running TSLint from the command-line, it shows both errors, as expected:

screenshot

VSCode Results

The TSLint Extension for VSCode correctly shows the "no-empty" error on line 6, but notice that it does not show the "no-void-expression" error on line 2:

screenshot

About

Demonstrates that the TSLint extension for VSCode fails to show some errors

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published