Skip to content

typescript-eslint/tsgolint

 
 

Repository files navigation

✨ tsgolint ✨

tsgolint is an experimental proof-of-concept typescript-go powered JS/TS linter written in Go.

Important

tsgolint is in the early stages of development. Expect breaking changes to happen.

Running tsgolint on microsoft/typescript repo

What's done so far

  • Primitive linter engine
  • Lint rules tester
  • Source code fixer
  • 40 type-aware typescript-eslint's rules
  • Basic tsgolint CLI

Speedup over ESLint

tsgolint is 20-40 times faster than ESLint + typescript-eslint.

Most of the speedup is due to the following facts:

  • Native speed parsing and type-checking (thanks to typescript-go)
  • No more TS AST -> ESTree AST conversions. TS AST is directly used in rules.
  • Parallel parsing, type checking and linting. tsgolint uses all available CPU cores.

See benchmarks for more info.

Implemented rules

Name Status
await-thenable
no-array-delete
no-base-to-string
no-confusing-void-expression
no-duplicate-type-constituents
no-floating-promises
no-for-in-array
no-implied-eval
no-meaningless-void-operator
no-misused-promises
no-misused-spread
no-mixed-enums
no-redundant-type-constituents
no-unnecessary-boolean-literal-compare
no-unnecessary-template-expression
no-unnecessary-type-arguments
no-unnecessary-type-assertion
no-unsafe-argument
no-unsafe-assignment
no-unsafe-call
no-unsafe-enum-comparison
no-unsafe-member-access
no-unsafe-return
no-unsafe-type-assertion
no-unsafe-unary-minus
non-nullable-type-assertion-style
only-throw-error
prefer-promise-reject-errors
prefer-reduce-type-parameter
prefer-return-this-type
promise-function-async
related-getter-setter-pairs
require-array-sort-compare
require-await
restrict-plus-operands
restrict-template-expressions
return-await
switch-exhaustiveness-check
unbound-method
use-unknown-in-catch-callback-variable

What hasn't been done yet

  • Non-type-aware rules
  • Editor extension
  • Rich CLI features
  • Config file
  • Plugin system

Building tsgolint

git submodule update --init

cd typescript-go
git am --3way --no-gpg-sign ../patches/*.patch
cd ..

cd goja
git am --3way --no-gpg-sign ../goja-patches/*.patch
cd ..

go build -o tsgolint ./cmd/tsgolint

About

✨ Experimental proof-of-concept typescript-go powered JS/TS linter written in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages