Skip to content

Adopt tslint in our development #2102

@egamma

Description

@egamma

We want to adopt tslint for checking our typescript code.

Most of our style guide should be checked by tslint.

General

  • Add initial tslint.json
  • Add tslint to our gulp script
  • Add a Code task with a problem matcher for tslint
  • Document its use in the Contribution Guidelines
  • Implement non externalised strings rule
  • Add tslint to the pre-commit hygene (wait until we are down to 0 with the warnigs)

Projects

Add tslint checking to other vscode projects

  • vscode-omnisharp
  • vscode-node-debugger-adapter

Others non-core projects

  • vsce
  • vscode-vscode

Extensions

  • vscode-tslint
  • vscode-eslint
  • vscode-jslint
  • vscode-editorConfig

Rules

  • no-unused-expression
  • no-unreachable
  • no-duplicate-variable
  • no-unexternalized-strings
  • no-duplicate-key (in object literals)
  • no-unused-variable (includes imports) - 500 instances
  • curly (braces for if/do/while, in style guide) - 70 instances
  • class-name (PacalCased class and interface names), in style guide) - 3
  • semicolon (semicolon at end of statements) - 220 instances
  • no-unnecessary-semicolons - 60 instances
  • no-duplicate-case - 3 instances
  • tripple-equals - 10 instances

Candidates

  • promise-must-complete - 10 instances (false positives?)
  • no-switch-case-fall-through - 25
  • forin (for ... statement must be filtered with an if) - 80 instances
  • prefer-const (rule is in the TS repository) - ???

Future

  • no-var-keyword - 5800
  • indent tabs (covered by hygene tasks, in style guide)
  • jsdoc-format - 200
  • no-trailing-whitespace
  • whitespace ...

Rejected

  • no-shadowed-variable - 300 instances
  • no-string-literal (disallow object access via string literals) - 16
  • no-unused-imports (subset of no-unused-variables) - 170 instances
  • no-function-expression (use arrow functions, in style guide) - 190 instances
  • missing-optional-annotation - 10 instances
  • no-use-before-declare
  • no-empty-interfaces (we them in our service injection patterns)
  • no-multiple-var-decl
  • no-missing-visibility-modifiers

Metadata

Metadata

Assignees

Labels

plan-itemVS Code - planned item for upcoming

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions