What’s the difference between ESLint and TypeScript?

Chris Coyier Chris Coyier on

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.

Wanna learn TypeScript deeply?

Frontend Masters logo

We have a complete learning path for TypeScript from Mike North, one of Stripe's deepest TypeScript experts, who will teach you from early fundamentals to production-grade TypeScript.

7-Day Free Trial

Leave a Reply

Your email address will not be published. Required fields are marked *

Did you know?

Frontend Masters Donates to open source projects. $363,806 contributed to date.