Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default linting does not work with TypeScript v4 #810

Open
aayani opened this issue Aug 21, 2020 · 5 comments
Open

Default linting does not work with TypeScript v4 #810

aayani opened this issue Aug 21, 2020 · 5 comments
Labels
scope: dependencies Pull requests that update a dependency file solution: workaround available There is a workaround available for this issue

Comments

@aayani
Copy link

aayani commented Aug 21, 2020

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)
@agilgur5
Copy link
Collaborator

Yea TS v4 was released <24 hours ago...

TSDX does not do it's own parsing and ESLint itself does not seem to fully support it yet.

@agilgur5 agilgur5 changed the title Default linting does not work when using TypeScript v4 Default linting does not work with TypeScript v4 Aug 21, 2020
@aayani
Copy link
Author

aayani commented Aug 21, 2020

Well that makes sense. Let's just hope they fix it soon enough.

@agilgur5
Copy link
Collaborator

agilgur5 commented Aug 21, 2020

@aayani I mean I think it's a bit unreasonable to expect super fast turnarounds for an entire ecosystem. Having to wait a month or more should be totally normal, much of the folks in open source, including me, are volunteers -- expecting volunteers to drop everything for every breakage in a dependency is asking for a lot.

It's also not always possible, e.g. I could not update TSDX to Rollup v2 as several common plugins weren't compatible (including ones I built integration tests for). TS private fields support (TS 3.8) is also lagging behind in various places (Rollup, ESLint) due to AST changes

@agilgur5
Copy link
Collaborator

agilgur5 commented 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 #890 (comment) . Its @next pre-release line has upgraded, but no one can tell how stable that will be 😕

@diegonvs
Copy link

diegonvs commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: dependencies Pull requests that update a dependency file solution: workaround available There is a workaround available for this issue
Projects
None yet
Development

No branches or pull requests

3 participants