Default linting does not work with TypeScript v4
See original GitHub issueCurrent Behavior
The yarn lint
or tsdx lint src test
is not behaving as expected after I upgraded TypeScript from v3 to v4. Getting the error Parsing error: Cannot read property 'map' of undefined
(in some files) in my case when I run these scripts. This make the pre-commit checks fail, hence rendering the husky hook useless.
Expected behavior
The yarn lint
script should work with TypeScript v4 as it was with v3.
Suggested solution(s)
- Check for compatibility with the latest TypeScript version and see what’s causing it to break
Additional context
Works fine when I revert to TypeScript 3. Problem only lies with the new version.
Your environment
Software | Version(s) |
---|---|
TSDX | 0.13.2 |
TypeScript | 4.0.2 |
Browser | - |
Yarn | 1.22.4 |
Node | 12.18.3 |
Operating System | Ubuntu 20.04.1 LTS (Focal Fossa) |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:18
- Comments:5
Top Results From Across the Web
Default linting does not work with TypeScript v4 · Issue #810
Works fine when I revert to TypeScript 3. Problem only lies with the new version. Your environment. Software, Version(s). TSDX, 0.13.2.
Read more >How to fix Typescript linting not working in VSCode?
In your VS Code user or workspace settings, set "typescript.tsserver.log": "terse"; Open a TS file that you believe should have TSLint enabled.
Read more >Linting TypeScript | GoLand Documentation - JetBrains
By default, GoLand marks detected problems based on the severity levels from the TSLint configuration file. See Configuring TSLint highlighting ...
Read more >How to use ESLint with TypeScript | Khalil Stemmler
ESLint is a JavaScript linter that you can use to lint either TypeScript or JavaScript code. In this post, we'll walk through how...
Read more >Linting in TypeScript using ESLint and Prettier - LogRocket Blog
Compiling TypeScript code · Run the following command in the terminal: npx ts``c --init . This will generate a default TypeScript configuration ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I solved it adding
on my package.json file
So we actually can’t upgrade
typescript-eslint
because TSDX doesn’t require the plugin and parser directly, it does so indirectly as a peerDep ofeslint-config-react-app
, which has yet to upgrade per https://github.com/formium/tsdx/pull/890#issuecomment-700292943 . Its@next
pre-release line has upgraded, but no one can tell how stable that will be 😕