The solution below achieves:

  1. Does not lint *.js files (important in my use case)
  2. Avoids the tseslint.config() wrapper (I will rarely ever edit the configuration file and don't need the IDE help)
  3. Keeps it clean and simple

eslint.config.js

import eslint   from '@eslint/js';
import tseslint from 'typescript-eslint';

export default [
   eslint.configs.recommended,
   ...tseslint.configs.strict,
   { ignores: ['**/*.js'] },
   {
      rules: {
         '@typescript-eslint/no-non-null-assertion': 'off',
      },
   },
];
Answer from Pilaf T. Pilafian on Stack Overflow
🌐
TypeScript ESlint
typescript-eslint.io
typescript-eslint
The parser and services for linting TypeScript code with ESLint, as well as how tools such as Prettier read TypeScript code.
Playground
Skip to main content
Overview
@typescript-eslint/eslint-plugin includes over 100 rules that detect best practice violations, bugs, and/or stylistic issues specifically for TypeScript code. All of our rules are listed below.
Getting Started
Next, create an eslint.config.mjs config file in the root of your project, and populate it with the following: ... // @ts-check import eslint from '@eslint/js'; import { defineConfig } from 'eslint/config'; import tseslint from 'typescript-eslint'; export default defineConfig( eslint.confi...
🌐
ESLint
eslint.org › blog › 2025 › 01 › differences-between-eslint-and-typescript
Differences between ESLint and TypeScript - ESLint - Pluggable JavaScript Linter
By adding in rules from plugins, ESLint configurations can be tailored to the specific best practices and common issues to the frameworks a project is built with. TypeScript, on the other hand, is configured by a set list of compiler options on a project level. The tsconfig.json file allows you to set compiler options that change type checking for all files in the project.
🌐
Medium
medium.com › @robinviktorsson › setting-up-eslint-and-prettier-for-a-typescript-project-aa2434417b8f
Setting Up ESLint and Prettier for a TypeScript Project | by Robin Viktorsson | Medium
March 10, 2025 - ts-node is a TypeScript execution environment for Node.js that allows you to run TypeScript code without needing to compile it manually. Now, let’s install and configure ESLint to enforce coding standards and catch potential issues in our TypeScript code.
🌐
Eslint-react
eslint-react.xyz › docs › getting-started › typescript
TypeScript | ESLint React
import tseslint from "typescript-eslint"; export default [ { languageOptions: { parser: tseslint.parser, parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname, }, }, }, ];
🌐
Jack Franklin
jackfranklin.co.uk › blog › typescript-eslint
Configuring ESLint on a TypeScript project - Jack Franklin
First up, we're going to need to install some packages. We'll install eslint itself, but also two plugins we need to allow ESLint to lint TypeScript: a parser (so ESLint can understand TypeScript's syntax) and the plugin (to enable linting on TS files):
Find elsewhere
🌐
npm
npmjs.com › package › typescript-eslint
typescript-eslint - npm
Tooling which enables you to use TypeScript with ESLint. Latest version: 8.56.1, last published: 13 days ago. Start using typescript-eslint in your project by running `npm i typescript-eslint`. There are 2845 other projects in the npm registry ...
      » npm install typescript-eslint
    
🌐
TypeScript ESlint
typescript-eslint.io › getting-started
Getting Started | typescript-eslint
Next, create an eslint.config.mjs config file in the root of your project, and populate it with the following: ... // @ts-check import eslint from '@eslint/js'; import { defineConfig } from 'eslint/config'; import tseslint from 'typescript-eslint'; export default defineConfig( eslint.confi...
🌐
Eslint
eslint.style › packages › ts
stylistic/eslint-plugin-ts
Stylistic rules for ESLint, works for both JavaScript, TypeScript and JSX.
🌐
ESLint
eslint.org › docs › latest › use › configure › configuration-files
Configuration Files - ESLint - Pluggable JavaScript Linter
For Deno and Bun, TypeScript configuration files are natively supported; for Node.js, you must install the optional dev dependency jiti in version 2.2.0 or later in your project (this dependency is not automatically installed by ESLint): ... You can then create a configuration file with a .ts, .mts, or .cts extension, and export an array of configuration objects.
🌐
LogRocket
blog.logrocket.com › home › linting in typescript using eslint and prettier
Linting in TypeScript using ESLint and Prettier - LogRocket Blog
October 8, 2024 - You can tell ESLint to lint your code using the following command: eslint --ext .js,.ts. The ext flag is used to specify which file extensions ESLint should consider when searching for files in the target directory.
🌐
Nx
nx.dev › docs › technologies › eslint › guides › eslint
Configuring ESLint with TypeScript | Nx
Learn how to properly configure ESLint with TypeScript in your Nx workspace, including setting up type-checking and managing parser options for optimal performance.
🌐
ESLint
eslint.org › blog › 2019 › 01 › future-typescript-eslint
The future of TypeScript on ESLint - ESLint - Pluggable JavaScript Linter
A couple of weeks ago, the TypeScript team shared their roadmap in which they described formally adopting ESLint in their repo and working to improve TypeScript compatibility for ESLint: ... In a survey we ran in VS Code a few months back, the most frequent theme we heard from users was that the linting experience left much to be desired. Since part of our team is dedicated to editing experiences in JavaScript, our editor team set out to add support for both TSLint and ESLint.
🌐
Khalil Stemmler
khalilstemmler.com › blogs › typescript › eslint-for-typescript
How to use ESLint with TypeScript | Khalil Stemmler
December 19, 2021 - ESLint is a JavaScript linter that enables you to enforce a set of style, formatting, and coding standards for your codebase. It looks at your code, and tells you when you're not following the standard that you set in place.
🌐
GitHub
github.com › typescript-eslint › typescript-eslint › releases
Releases · typescript-eslint/typescript-eslint
:sparkles: Monorepo for all the tooling which enables ESLint to support TypeScript - typescript-eslint/typescript-eslint
Author   typescript-eslint
🌐
Reddit
reddit.com › r/typescript › do you guys use eslint on your typescript projects?
r/typescript on Reddit: Do you guys use eslint on your typescript projects?
August 21, 2018 -

I used to use eslint with the plugins it suggested to me to install after executing :

npx eslint --init;

and chooseing the option : I use typescript , but I have found it to produce some akward linting errors recently like not allowing me to put type any on a function parameter.

I have stopped using eslint since then.

If you use eslint then what you use it for?

I was using it just because it was linting errors while I was writing js and so I believed it will also be useful in typescript.

Top answer
1 of 2
2

But, after removing typescript-eslint, esLint appears to function normally.

When you say it functions normally do you mean functions in your IDE (like vscode) or when you run the eslint command? Because most IDEs come with eslint either built in or available as a package and will lint your code in-editor (using a typescript parser under the hood). Without typescript-eslint eslint can't actually parse your typescript files. Try running eslint without it and see if it lets you.

My understanding is that tsc compiles TypeScript to JavaScript unless --noEmit tag is added. With options like "strict": true, it's possible to configure TypeScript rules to check.

ESLint and tsc do different things.

  • Running tsc will inform you of type errors, something eslint does not do.
  • Running eslint will inform you of linting errors (violations of defined rules) not type errors, something tsc does not do.

ESLint only reports errors from its own linters, it does not report typescript compilation failures. See: https://stackoverflow.com/a/60758789/14073449

The typescript-eslint page explains why it exists pretty well:https://typescript-eslint.io/

ESLint and TypeScript represent code differently internally. ESLint's default JavaScript parser cannot natively read in TypeScript-specific syntax and its rules don't natively have access to TypeScript's type information.

2 of 2
0

tsc compiles the project and will detect build errors (as the one in your example). ESLint is used for detecting (bad) patterns. You want to run ESLint on your code, not on the code that is produced as output of the Typescript compiler, as you suggest. Therefore having typescript-eslint is a good idea, when you write Typescript code, since it provides the capability to 'understand' Typescript to ESLint as stated on their homepage:

The tooling that enables ESLint and Prettier to support TypeScript.