typescript-eslint and Prettier: the tools other projects use
Tell from a project's files which linter and formatter it uses, run Prettier and ESLint with typescript-eslint, and get typescript-eslint past npm's ERESOLVE on TypeScript 7 with an alias.
Node.js
TypeScript
`typescript-eslint` and Prettier: the tools other projects use. Read this lesson at .
Tested with TypeScript 7.x · Node.js LTS
TaskKit has Biome now, and one day you open a project that is not
yours, a friend's or a team's. There is no biome.json in it. There
is an eslint.config.mjs, a .prettierrc, or both. You want to run
those tools, and when you try to add ESLint to a project of your own
on TypeScript 7, npm (the Node package manager) refuses with a page
of npm error lines.
The ideas are the ones of the last lesson: a linter finds likely
mistakes, rule by rule, and a formatter lays out every file one way.
Only the tools differ. By the end of this lesson you can tell from a
project's files which tools it uses, run Prettier and ESLint in a
folder of their own, and read the error npm prints for
typescript-eslint beside TypeScript 7, with the way around it.
Two tools for two jobs
Where Biome does both jobs, many JavaScript projects use two tools.
ESLint is the linter, and on its own it reads JavaScript.
typescript-eslint is a plugin for it, an add-on that gives
ESLint a TypeScript reader and rules that use your types. One of them
is no-floating-promises, its rule for a promise nobody waits for,
the one Biome calls noFloatingPromises. Prettier is the
formatter; you met its name in lesson 9.2, as the example of a dev
dependency.
await store.save();warnIfHoliday(options.due);
no-floating-promises
ESLint
Does:
With typescript-eslint, finds likely mistakes, using your types
Never: It does not lay out your code
store.add("Buy milk");
Prettier
Does: Lays out every file one way, quotes included
Never: It does not look for mistakes
await store.save();warnIfHoliday(options.due);
noFloatingPromises
Biome
Does: Does both jobs, with one settings file
Never: It does not have every rule ESLint's plugins have
Two tools for two jobs, or one tool for both
A project's settings files tell you which tools it uses (each tool
also accepts a few other names for its file), and each tool runs from
the project's folder:
The project has
It uses
Run
eslint.config.mjs
ESLint
npx eslint .
.prettierrc
Prettier
npx prettier --check .
biome.json
Biome
npx biome lint ., npx biome format .
A project often names the same commands in its package.json
scripts, as TaskKit's lint and format do, so look there first. If
you did Part 1, taskkit-today has a .prettierrc: the tool that made
it set Prettier's layout for it, though it did not install Prettier,
so npx prettier there first offers to download it.
A folder to try them in
To try both tools without touching TaskKit, make a folder of their
own, lint-try, beside it, and give it TypeScript and Node's types,
as TaskKit got them in lessons 1.4 and 9.3. npm writes the
package.json itself on the first install, and
npm pkg set type=module tells Node the files use import, as in
lesson 5.11:
bash
mkdir ~/projects/lint-trycd ~/projects/lint-trynpm install --save-dev typescript @types/nodenpm pkg set type=module
The install's first linetext
added 4 packages in 809ms
Your numbers and times will differ. Then open lint-try in VS Code
(Visual Studio Code, your editor), make a file tsconfig.json in it,
and paste TaskKit's tsconfig.json from lesson 9.4 into it, so npx tsc checks here as it does in TaskKit.
Prettier: one layout, checked
Install Prettier, pinned as Biome was in the last lesson:
bash
npm install --save-dev --save-exact prettier
The first line of npm's outputtext
added 1 package, and audited 6 packages in 441ms
Then make a file say.ts in lint-try, written the way your friend's
editor writes, with single quotes and no semicolons:
say.tsts
const task = 'Buy milk'console.log(task)
--check asks Prettier which files it would change, and changes
none:
bash
npx prettier --check .
Outputtext
Checking formatting...[warn] say.ts[warn] Code style issues found in the above file. Run Prettier with --write to fix.
It lists only say.ts: tsconfig.json, package.json and
package-lock.json are already in its layout. The command ends with
exit code 1 (the number a command hands back when it ends: 0 means it
worked), so a script can stop on it. --write lays the files out and
saves them, as Biome's --write did.
Predict before you run
Predict
After npx prettier --write ., what is line 1 of say.ts?
say.tsts
const task = 'Buy milk'console.log(task)
Run it, then --check again:
bash
npx prettier --write .npx prettier --check .
The output of the second commandtext
Checking formatting...All matched files use Prettier code style!
The common mistake: ESLint on TypeScript 7
typescript-eslint's getting-started page gives one command to install
it. lint-try, like TaskKit, runs TypeScript 7, and typescript-eslint
8.74.0, the newest on 26 November 2026, was built for TypeScript 6 and
older.
A peer dependency is a package that another package needs but
does not install itself: it uses the copy your project already has,
and says which versions of it work, its peer range. typescript-eslint
names TypeScript as a peer. Before it installs anything, npm checks
that range against the project's typescript. Press Next step to
walk it, or let it play, and switch between the project as it is and
the project after the fix below:
npm install: reachedPeer range: 4.8.4 to below 6.1.0
The project's typescript: stops here✕7.0.2 refused, 6 accepted
Installed: never reachedESLint gets 6; tsc stays 7
The project's typescript stops herenpm error code ERESOLVE
npm reads typescript-eslint's peer range before it installs
anything
All 3 steps shown.Step 1 of 3: npm installStep 2 of 3: The project's typescriptStep 3 of 3: The project's typescript: stops here. npm error code ERESOLVE
All 3 steps shown.
npm install: reachedPeer range: 4.8.4 to below 6.1.0
The project's typescript: passes✓7.0.2 refused, 6 accepted
Installed: reachedESLint gets 6; tsc stays 7
npm reads typescript-eslint's peer range before it installs
anything
All 4 steps shown.Step 1 of 4: npm installStep 2 of 4: The project's typescriptStep 3 of 4: The project's typescript: passesStep 4 of 4: Installed
All 4 steps shown.
Common mistake
Installing typescript-eslint beside TypeScript 7
You copy the command from typescript-eslint's page, where
@eslint/js is ESLint's own set of rules for JavaScript, and run it
in lint-try:
npm error code ERESOLVEnpm error ERESOLVE unable to resolve dependency treenpm errornpm error While resolving: undefined@undefinednpm error Found: typescript@7.0.2npm error node_modules/typescriptnpm error dev typescript@"^7.0.2" from the root projectnpm errornpm error Could not resolve dependency:npm error peer typescript@">=4.8.4 <6.1.0" from typescript-eslint@8.74.0npm error node_modules/typescript-eslintnpm error dev typescript-eslint@"*" from the root projectnpm errornpm error Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.
ERESOLVE is npm's code for could not resolve: it could not find
versions that fit together, so it installed nothing. After these
lines npm names two log files. In the fourth line, undefined@undefined
stands for the project's name and version, which lint-try's
package.json does not have.
The line that explains it starts with peer: typescript-eslint
8.74.0 works with TypeScript from 4.8.4 up to, but not including,
6.1.0, and the project has 7.0.2. Do not take npm's advice to use
--force: that installs the very pair npm just said may not work.
npm error code ERESOLVE
The fix
TypeScript 7 runs tsc, but it does not yet offer the code that tools
like typescript-eslint call (on 26 November 2026; the TypeScript team
plans it for 7.1). The team publishes TypeScript 6 for those tools as
@typescript/typescript6, and recommends an npm alias, which is
not a type alias: npm installs a package under another name.
typescript@npm:@typescript/typescript6 means: install
@typescript/typescript6 under the name typescript, so typescript
becomes TypeScript 6 for ESLint. The second line gives TypeScript 7
the name @typescript/native, where it still gives you tsc. Install
the two in this order, then ESLint:
Each prints its added … packages line first and no ERESOLVE. The
order matters: TypeScript 6 brings a tsc of its own, and while you
add packages one by one, the package installed last decides which
tsc runs. Installed the other way round, the next command prints
Version 6.0.3 (a fresh npm install later sorts it out either way).
Ask which TypeScript tsc is now:
bash
npx tsc --version
Outputtext
Version 7.0.2
When npm says ERESOLVE, find the peer line: it names the package
that refused and the versions it accepts. When typescript-eslint
supports TypeScript 7, its plain install will work again; its
dependency versions page says which TypeScript it
supports, so look there before you reach for the alias.
ESLint at work
ESLint reads its settings from eslint.config.mjs in the project's
folder. It is a JavaScript file, and .mjs says its code uses
import whatever package.json says. Make it in lint-try with
these lines, the setup typescript-eslint's typed-linting page gives
(checked on 26 November 2026):
eslint.config.mjsjs
import js from "@eslint/js";import { defineConfig } from "eslint/config";import tseslint from "typescript-eslint";export default defineConfig({ files: ["**/*.{js,ts}"], extends: [ js.configs.recommended, tseslint.configs.recommended, tseslint.configs.recommendedTypeChecked, ], languageOptions: { parserOptions: { projectService: true, }, },});
export default hands the one object of the file to ESLint, which
imports it, and defineConfig is what lets the object use extends:
without it, ESLint 10 refuses the file. files names the files the
rules apply to, .js and .ts, so this .mjs file stays out.
extends lists the rule sets: ESLint's own, typescript-eslint's, and
recommendedTypeChecked, the set that reads your types,
no-floating-promises among them. projectService lets it find your
tsconfig.json.
Now save a file with a promise nobody waits for, the mistake of the
last lesson, as holiday.ts in lint-try:
holiday.tsts
async function warnIfHoliday(due: string): Promise<void> { const holiday = await Promise.resolve("Christmas Day"); console.log(`${due} is a public holiday: ${holiday}`);}warnIfHoliday("Fri 25 Dec");
npx tsc finds nothing in it: every type fits. Ask ESLint:
bash
npx eslint .
Outputtext
/Users/ana/projects/lint-try/holiday.ts 6:1 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises✖ 1 problem (1 error, 0 warnings)
C:\Users\ana\projects\lint-try\holiday.ts 6:1 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises✖ 1 problem (1 error, 0 warnings)
/home/ana/projects/lint-try/holiday.ts 6:1 error Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator @typescript-eslint/no-floating-promises✖ 1 problem (1 error, 0 warnings)
ESLint names the file, then each problem: line 6, column 1, why it
matters, and the rule's name last. It ends with exit code 1 while a
problem is left. Write await in front of the call, run it again,
and it prints nothing and ends with 0.
Pass all three tasks to complete the lesson with practice. Reach the end without them and it counts as read only.
Exercises
The page cannot run npm, ESLint or Prettier, so the setup is written
as console.log lines, and two questions ask about what you ran.
Exercise · Fix the error
ESLint beside TypeScript 7, in order
This program prints the commands that get ESLint working in
lint-try, beside TypeScript 7, but in an order that would not work.
Change the order of the lines, without changing any line itself, so
the commands work from top to bottom and npx tsc still runs
TypeScript 7 at the end, with no ERESOLVE line, error or warning.
Loading the editor…
Exercise · Read the code
Which tools, which commands
A project you join has an eslint.config.mjs and a .prettierrc,
and no biome.json. Which two commands check it without changing a
file?
Exercise · Read the code
Read the peer line
A friend's project prints
peer typescript@">=4.8.4 <6.1.0" from typescript-eslint@8.74.0
inside an ERESOLVE error, and the project has TypeScript 7.0.2.
What does the line tell you?
Recap
Recap · 3 questions
Check yourself
What is a peer dependency?
Check yourself
After the fix, why does npx tsc --version say 7.0.2?
Check yourself
What does typescript-eslint add to ESLint?
0 of 0 answered.
A cheat sheet to keep
Cheat sheet
typescript-eslint and Prettier
What things are
Word
What it means
ESLint
A linter; reads JavaScript on its own
typescript-eslint
ESLint's plugin: a TypeScript reader, typed rules
Prettier
A formatter; one layout for every file
Plugin
An add-on that gives a tool more rules
Peer dependency
A package another one needs but does not install
Alias
A package installed under another name
Commands and files
Write
To
eslint.config.mjs
ESLint's settings file
.prettierrc
Prettier's settings file
npx eslint .
Report every likely mistake
npx prettier --check .
List the files Prettier would change
npx prettier --write .
Lay them out and save them
typescript@npm:…typescript6
TypeScript 6 under the name typescript
Rules
Rule
What it means
Files name the tools
biome.json, eslint.config.mjs, .prettierrc
ERESOLVE
Read the peer line: who refused, which versions
No --force
It installs a pair that may not work
TypeScript 7 last
Installed last, it gives tsc
Where to go next
You can now tell from a project's files which linter and formatter it
uses, run Prettier and ESLint, and get typescript-eslint installed
beside TypeScript 7 with an alias.
Next is Bundlers and dev servers (Vite): the tools that turn a
page's many files into a few the browser can load quickly, and serve
the page while you change it.
Before you move on, add a .prettierrc to lint-try holding
{ "singleQuote": true }. Predict which files npx prettier --check .
lists now, then run it.