What is the difference between ESLint and TypeScript? Perhaps that feels like a strange question as ESLint is a, uhm, linter, and TypeScript is a language that compiles to JavaScript.
Josh Goldberg writes how there is some overlap:
While ESLint and TypeScript operate differently and specialize in different areas of code defects, there is some overlap. Specific types of code defects straddle the line between “best practices” and “type safety,” and so can be caught by both tools.
I could imagine asking (or having to answer) this in a job interview.
The two catch different areas of code defects and come with different philosophies around configurability and extensibility.
- ESLint checks that code adheres to best practices and is consistent, enforcing what you should write.
- TypeScripts checks that code is “type-safe”, enforcing what you can write.