TypeScript ESLint
Tooling which enables ESLint to support TypeScript
What are ESLint and TypeScript, and how do they compare?
ESLint is an awesome linter for JavaScript code.
Behind the scenes, it uses a parser to turn your source code into a data format called an Abstract Syntax Tree (AST). This data format is then used by plugins to create assertions called lint rules around what your code should look or behave like.
TypeScript is an awesome static code analyzer for JavaScript code, and some additional syntax that it provides on top of the underlying JavaScript language.
Behind the scenes, it uses a parser to turn your source code into a data format called an Abstract Syntax Tree (AST). This data format is then used by other parts of the TypeScript Compiler to do things like give you feedback on issues, allow you to refactor easily, etc.
They sound similar, right? They are! Both projects are ultimately striving to help you write the best JavaScript code you possibly can.
Why does this project exist?
As covered by the previous section, both ESLint and TypeScript rely on turning your source code into a data format called an AST in order to do their jobs.
However, it turns out that ESLint and TypeScript use different ASTs to each other.
The reason for this difference is not so interesting or important and is simply the result of different evolutions, priorities, and timelines of the projects.
This project, typescript-eslint
, exists primarily because of this major difference between the projects.
typescript-eslint
exists so that you can use ESLint and TypeScript together, without needing to worry about implementation detail differences wherever possible.