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

experimental-utils v3.0 requires TS 3.8 compiler and ES2015 target #2114

Closed
adidahiya opened this issue May 26, 2020 · 2 comments · Fixed by #2133
Closed

experimental-utils v3.0 requires TS 3.8 compiler and ES2015 target #2114

adidahiya opened this issue May 26, 2020 · 2 comments · Fixed by #2133
Labels
bug Something isn't working has pr there is a PR raised to close this package: utils Issues related to the @typescript-eslint/utils package

Comments

@adidahiya
Copy link

I just upgraded to typescript-eslint 3.0 in a TypeScript project which uses @typescript-eslint/experimental-utils and got a slightly surprising compile error. The usage of ES private field syntax introduced in #2023 requires downstream TypeScript consumers to target ES2015 / ES6 or newer (TS docs).

../../node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.d.ts:7:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
7     #private;
      ~~~~~~~~

This isn't a big problem for me, since I can update my "target" compiler option, but I just wanted to note this slight breaking change.

Versions

package version
@typescript-eslint/experimental-utils 3.0.1
TypeScript 3.9.3
node 12.16.2
@adidahiya adidahiya added package: utils Issues related to the @typescript-eslint/utils package triage Waiting for maintainers to take a look labels May 26, 2020
@bradzacher
Copy link
Member

bradzacher commented May 27, 2020

Interesting. I didn't realise that the truly private fields would even output in the .d.ts file.

there's no such thing as private field clashes, so it seems weird that they're even output in the .d.ts.

I was leveraging them because there was some stuff that I didn't want to leak, and I've made heavy use of them in the new scope manager #1939.

This means that consumers of the package must be on TS 3.8 or newer as well.
I might have to remove them then? Hmmm... I'll need to think a bit

@bradzacher bradzacher added documentation Documentation ("docs") that needs adding/updating and removed triage Waiting for maintainers to take a look labels May 27, 2020
@Etheryte
Copy link

Ran into the same issue unexpectedly when adding experimental utils to an existing project. Downgrading to 2.34.0 worked out well for us for now because we can't upgrade TS on a whim.

@adidahiya adidahiya changed the title experimental-utils v3.0 requires ES2015 environment experimental-utils v3.0 requires TS 3.8 compiler and ES2015 target May 27, 2020
@bradzacher bradzacher added bug Something isn't working and removed documentation Documentation ("docs") that needs adding/updating labels May 30, 2020
@bradzacher bradzacher added the has pr there is a PR raised to close this label May 30, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working has pr there is a PR raised to close this package: utils Issues related to the @typescript-eslint/utils package
Projects
None yet
3 participants