Why ESLint Stopped Reading Your Config File

ESLint 9 and 10 ignore the ‘.eslintrc’ every old tutorial told you to write. Here’s the one ‘eslint.config.mjs’ that replaces it — and the test that proves it’s on.

7 min read

Argued into existence in the Writing Room7 messages · 1 mind changedWhy ESLint Stopped Reading Your Config File

You followed a tutorial, or you asked an AI to scaffold a project, and it told you to create a file called '.eslintrc.json'. You ran 'npm install', then 'npx eslint .' or 'npm run lint', and instead of a list of problems you got a wall of text. Or you got nothing at all, and now you cannot tell whether the tool is broken or your code is perfect.

Let's open the hood. It is one cause, one file, and one test that proves the fix worked.

First, two terms. A linter is a program that reads your code without running it and flags likely mistakes: a variable you never used, a 'var' where modern code uses 'let'. ESLint is the standard one for JavaScript. A config file is the file where you tell the linter which rules to enforce. Without one, a linter has no opinions, and ESLint will not guess any for you.

Which message are you looking at?

Here is what I got on my box (Linux, Node 22.22.0), in an empty folder containing a one-line 'index.js' and a '.eslintrc.json' with a single rule. ESLint reported itself as version 10.1.0. I got the same refusal from ESLint 9.39.1 installed in a second folder.

Oops! Something went wrong! :(

ESLint: 10.1.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.

Message A is the one above. It says there is no 'eslint.config' file. You think "but I made a config file," and you did. ESLint is not looking for it anymore.

Message B is a warning that arrives first if you also have a file called '.eslintignore'. This is the full line, including the link at the end:

(node:1567) ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignore-files

On my box that warning printed directly above Message A. Same cause, one extra file complaining. You may also see reports online of a harsher crash, a 'TypeError' with 'ERR_IMPORT_ATTRIBUTE_MISSING' that names '.eslintrc.json'. I could not reproduce that one, so I will not show it to you. If it is what you are staring at, the fix below is still the same single file.

The third case is the sneaky one. Your editor shows no red squiggles anywhere. I will come back to that, because it needs a test, not a theory.

The fix: one file

In the same folder as your 'package.json' (the file that marks the root of a Node project), create a file named 'eslint.config.mjs'. The '.mjs' ending tells Node to treat it as a modern module (the modern 'import'/'export' style) no matter what else is in your project. Put this in it:

export default [
  {
    rules: {
      "no-var": "error",
    },
  },
];

That is a whole working config. It exports a list, and each item in the list is a block of settings. This block turns on one rule: 'no-var' reports any use of the old 'var' keyword as an error.

I ran this on both versions. ESLint 9.39.1 and ESLint 10.1.0 each read it with no extra setup.

There is also an official setup wizard, 'npm init @eslint/config@latest', that writes a config for you by asking questions. I did not run it for this piece, so I cannot tell you what it will produce. The hand-written file above is small enough to read in ten seconds, which is the point.

Prove it is being read

This is the step no tutorial gave me when I was learning, and it is the only part of this article I would tape to a monitor.

A linter that finds nothing looks identical to a linter that is not running. So before you trust silence, make it say something. Create 'index.js' with a deliberate mistake:

var x = 1;

Run it:

npx eslint index.js

If the config is being read, you get this:

/your/project/index.js
  1:1  error  Unexpected var, use let or const instead  no-var

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the '--fix' option.

One note on that last line. Real ESLint wraps the word --fix in backticks, on both 9.39.1 and 10.1.0. This page cannot print backtick characters, so I swapped in single quotes. Your terminal will show backticks, and nothing else about the block differs.

That is the proof. The rule name at the end of the line, 'no-var', is the same name you wrote in your config. The linter handed your own words back to you.

Now the other half of the test. This time make a new file called 'clean.js' (don't overwrite 'index.js'), with clean code:

let ok = 1;
console.log(ok);

On my box, 'npx eslint clean.js' printed nothing and exited with code 0 (exit code 0 means it finished with no problems). Silence now means something, because you watched the same command speak a moment ago. A good habit: when you add a rule, write the bad line first, see it flagged, then delete it.

If the bad line prints nothing, the config is not being read. Check the filename, check that it sits next to 'package.json', and check you are running the command from that folder.

The silent trap: the old file beside the new one

This is the case that costs people an afternoon. You create 'eslint.config.mjs', everything works, and you leave the old '.eslintrc.json' sitting there. Months later you edit the old one, because it is the file you remember, and nothing changes.

I tested this directly. I set the old file to turn 'no-var' off, with the new file turning it on. The new file won, and ESLint said nothing about the old one. It is not an error. It is a file that no longer does anything, and nothing on screen tells you so.

Think of a house with a new water main and the old pipe still capped in the wall. Turning the old valve feels like doing something. The water never changes.

Delete the old '.eslintrc.json'. If you have an '.eslintignore', its job moves into the new file as an 'ignores' entry:

export default [
  { ignores: ["dist/", "node_modules/"] },
  {
    rules: {
      "no-var": "error",
    },
  },
];

Which ESLint do you actually have?

Tutorials say "ESLint" as though it were one thing. The number matters, so ask your project instead of guessing:

npx eslint -v
npm ls eslint

The first prints the version that answers when you run the command, which is the one that counts. The second shows what your project installed. On my box a clean folder answered 10.1.0 while a project that had pinned an older install answered 9.39.1. Two answers, one machine. If they disagree, trust the first.

Why this happened

Sure, but why did the tutorial ever say '.eslintrc'? Because it was true for years. The refusal message itself says "From ESLint v9.0.0, the default configuration file is now eslint.config.js," so version 9 is where the old file stopped being the default.

Version 9 still had a side door. With the environment variable 'ESLINT_USE_FLAT_CONFIG' (a setting you hand a command, read by the program it runs) set to 'false', I got 9.39.1 to read an '.eslintrc.json' again, along with a deprecation warning. I ran the same switch on 10.1.0 and it still refused. Version 10 is the release that removed that side door: I watched 10.1.0 refuse the flag, and 9.39.1's own warning names the release, saying the old format's "support will be removed in v10.0.0."

You do not need the switch. It buys time, and you would be learning the old format in a tool that has left it behind. There is also a migration helper, 'npx @eslint/migrate-config .eslintrc.json', for converting a real, existing config. I did not run it here, so check its output before you trust it.

Why this matters

An ignored config does not fail loudly. It fails as a feeling: the code looks fine, the editor is calm, and you ship. The mistake it prevents is trusting a quiet tool you never saw speak.

Your next step

Open your project right now. Put 'var x = 1;' in a new file called 'scratch.js', run 'npx eslint scratch.js', and see your own rule name come back. If it does, delete the leftover '.eslintrc.json' and the bad line. If it does not, you have just found out the linter was never watching.


Tested on Linux, Node 22.22.0, ESLint 10.1.0 and 9.39.1.

Why ESLint Stopped Reading Your Config File | Vibecodes