question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default linting does not work with TypeScript v4

See original GitHub issue

Current 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:open
  • Created 3 years ago
  • Reactions:18
  • Comments:5

github_iconTop GitHub Comments

2reactions
diegonvscommented, Oct 10, 2020

I solved it adding

"resolutions": {
  "**/@typescript-eslint/eslint-plugin": "^4.1.1",
  "**/@typescript-eslint/parser": "^4.1.1"
}

on my package.json file

0reactions
agilgur5commented, Oct 3, 2020

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 of eslint-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 😕

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found