Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

ESLint parsing error: originalKeywordKind has been deprecated

ErrorParsing error: DeprecationError: 'originalKeywordKind' has been deprecated since v5.0.0 and can no longer be used

Short answer

Some code in your ESLint toolchain still calls a TypeScript API that TypeScript 5 removed. Delete the .eslintcache file first, as that fixed a reported case. Then update typescript-eslint and any plugin that reads the TypeScript AST to current versions, and check TypeScript is inside the supported range.

  • Applies to typescript-eslint 8, TypeScript 5.x, ESLint 9
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    List the versions of the parser, plugins and TypeScript. An old copy of any of them is the usual source.

    npm ls typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin typescript-eslint
    ls -a | grep eslintcache
  2. 2Match what you see, then jump to its fix

    1. 1The error persists although the packages look current, and you run eslint with --cacheA stale ESLint cacheFix
    2. 2npm ls shows an old @typescript-eslint package, or the stack trace names a third-party plugintypescript-eslint or another plugin is older than your TypeScriptFix
    3. 3A warning about an unsupported TypeScript version is printed before the errorTypeScript is outside the version range typescript-eslint supportsFix

What does the error look like?

  • Parsing error: DeprecationError: 'originalKeywordKind' has been deprecated since v5.0.0 and can no longer be used

Cause 1 of 3

A stale ESLint cache

1Check

A maintainer-confirmed case in the typescript-eslint repository was solved by removing the cache file.

ls -la .eslintcache

2Fix

Delete the cache and lint again.

rm -f .eslintcache
npx eslint .

3Verify

ESLint finishes without the parsing error.

npx eslint . ; echo exit=$?

Confirmed by github.com

Did this fix it?

Cause 2 of 3

typescript-eslint or another plugin is older than your TypeScript

1Check

The error comes from code that still uses the API TypeScript 5 deprecated. The same thread advises using the latest version of the tooling.

npm outdated typescript-eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin

2Fix

Update the parser and plugin together. For plugins you do not control, update to their latest release or ask the maintainer.

npm install --save-dev typescript-eslint@latest eslint@latest

3Verify

npm ls shows one current version of each, and the lint run is clean.

npm ls typescript-eslint
npx eslint .

Confirmed by github.com

Did this fix it?

Cause 3 of 3

TypeScript is outside the version range typescript-eslint supports

1Check

typescript-eslint supports a window of TypeScript versions and warns when it sees one outside it. Beta releases are not supported.

npx tsc --version

2Fix

Move typescript to a version inside the supported range listed in the docs, or update typescript-eslint until it supports yours.

npm install --save-dev typescript@latest typescript-eslint@latest

3Verify

The warning is gone and linting passes.

npx eslint .

Confirmed by typescript-eslint.io

Did this fix it?

How do I stop it coming back?

  • Update typescript, typescript-eslint and eslint together, in one commit.
  • Delete .eslintcache in CI or do not enable --cache there.
  • Pin nothing to an old @typescript-eslint v5 or v6 line without a reason.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Web apps

tsconfig rejects allowImportingTsExtensions

An error that allowImportingTsExtensions needs noEmit or emitDeclarationOnly

allowImportingTsExtensions lets files import each other with .ts or .tsx extensions, and TypeScript only allows it together with noEmit or emitDeclarationOnly.

2 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.