ESLint parsing error: originalKeywordKind has been deprecated
Parsing error: DeprecationError: 'originalKeywordKind' has been deprecated since v5.0.0 and can no longer be usedShort 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.
Fix it fast
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 eslintcache2Match what you see, then jump to its fix
- 1
The error persists although the packages look current, and you run eslint with --cacheA stale ESLint cacheFix - 2
npm 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
A warning about an unsupported TypeScript version is printed before the errorTypeScript is outside the version range typescript-eslint supportsFix
- 1
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 .eslintcache2Fix
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
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-plugin2Fix
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@latest3Verify
npm ls shows one current version of each, and the lint run is clean.
npm ls typescript-eslint
npx eslint .Confirmed by github.com
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 --version2Fix
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@latest3Verify
The warning is gone and linting passes.
npx eslint .Confirmed by typescript-eslint.io
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- TaskvareA task and project-management suite: React on the web, Flutter on mobile, TypeScript underneath.
Related fixes
Web apps
WARNING: You are running a version of TypeScript that typescript-estree does not support
WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree
The parser logs this warning when your TypeScript version is outside the range typescript-eslint supports.
3 causes, each with a fixWeb 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 fixWeb apps
TypeScript refuses JSX because the jsx option is not set
TS17004: Cannot use JSX unless the '--jsx' flag is provided.
TypeScript compiles JSX only when you name the file with a .tsx extension and enable the jsx compiler option.
2 causes, each with a fixWeb apps
TypeScript rejects a component that returns an array or other non-Element
Its return type 'Element[]' is not a valid JSX element.
TypeScript before 5.1 required every component to return JSX.Element or null, so arrays, strings and Promises were rejected even though React renders them.
2 causes, each with a fixWeb apps
Cypress refuses to start with 'Your configFile is invalid'
Your configFile threw an error from: /path/to/cypress.config.ts
Cypress could not load cypress.config.js or .ts, or found something wrong in it.
5 causes, each with a fixWeb apps
ESLint cannot decide which copy of the @typescript-eslint plugin to use
The message lists two file paths for the same plugin, each with the name of the config that loaded it
ESLint found the same plugin at two different file paths and will not pick one.
3 causes, each with a fix