You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Default linter and/or linting configuration cannot parse various TypeScript features (e.g. modifiers like readonly) #6420
changed the title [-]Default linter and/or linting configuration cannot parse TypeScript's modifiers (e.g. readonly)[/-][+]Default linter and/or linting configuration cannot parse various TypeScript features (e.g. modifiers like readonly)[/+]on Feb 15, 2019
ESLint is not currently running on .ts or .tsx files. Any errors you're seeing are from the TypeScript compiler type checking. If you're seeing errors today it's likely because it's not valid TypeScript.
That's strange, because simply creating a new project with yarn create react-app test --typescript, adding an .eslintrc.json to the project root containing only { "extends": "react-app" } and using the ESLint plugin for VS Code shows this error for perfectly valid TS code:
Not sure how it would be running on typescript files. May be worth trying our 3.0 alpha to see if it resolves your issue as it includes typescript ESLint support.
Activity
AlphaHydrae commentedon Feb 13, 2019
I just stumbled over another similar problem. The following valid TypeScript also causes the linter's parsing to fail:
Although this works fine:
[-]Default linter and/or linting configuration cannot parse TypeScript's readonly modifier[/-][+]Default linter and/or linting configuration cannot parse TypeScript's modifiers (e.g. readonly)[/+]Nimelrian commentedon Feb 15, 2019
eslint also trips over this:
It seems like the babel-eslint parser configured in the config doesn't handle TypeScript. Here's the config from the eslint-config-react-app package:
https://github.com/facebook/create-react-app/blob/319cf9b9e1833a4b31209b9dea0d03e89b996d71/packages/eslint-config-react-app/index.js#L29
https://github.com/facebook/create-react-app/blob/319cf9b9e1833a4b31209b9dea0d03e89b996d71/packages/eslint-config-react-app/index.js#L41-L47
[-]Default linter and/or linting configuration cannot parse TypeScript's modifiers (e.g. readonly)[/-][+]Default linter and/or linting configuration cannot parse various TypeScript features (e.g. modifiers like readonly)[/+]sbusch commentedon Feb 22, 2019
I have a similar (the same?) problem, see #6360. Tested with CRA 2.1.5 and current HEAD.
nsmithdev commentedon Mar 11, 2019
Add TypeScript linting support
Issue #5641
Pull #6513
ianschmitz commentedon Mar 11, 2019
ESLint is not currently running on
.tsor.tsxfiles. Any errors you're seeing are from the TypeScript compiler type checking. If you're seeing errors today it's likely because it's not valid TypeScript.Nimelrian commentedon Mar 11, 2019
That's strange, because simply creating a new project with

yarn create react-app test --typescript, adding an.eslintrc.jsonto the project root containing only{ "extends": "react-app" }and using the ESLint plugin for VS Code shows this error for perfectly valid TS code:JustinTRoss commentedon Mar 31, 2019
Same for
keyof.ianschmitz commentedon Apr 1, 2019
Interesting! Here's our ESLint setup in webpack as of 2.1.8: https://github.com/facebook/create-react-app/blob/c17e25bf7f9dd60c49cd491535114beb5592ff81/packages/react-scripts/config/webpack.config.js#L307.
Not sure how it would be running on typescript files. May be worth trying our 3.0 alpha to see if it resolves your issue as it includes typescript ESLint support.
JustinTRoss commentedon Apr 1, 2019
Wow. That is weird. I was able to resolve the issues by defining my own eslint config with typescript parser and plugin.
foffer commentedon Jan 1, 2021
Is there any update on this, I'm seeing the same issue using react-scripts 4.0.1