Skip to content
This repository was archived by the owner on May 12, 2025. It is now read-only.

[no-undef]: consider regression #144

Closed
guilhermetod opened this issue Oct 8, 2020 · 3 comments · Fixed by #150
Closed

[no-undef]: consider regression #144

guilhermetod opened this issue Oct 8, 2020 · 3 comments · Fixed by #150
Labels

Comments

@guilhermetod
Copy link
Contributor

guilhermetod commented Oct 8, 2020

Hey, I just upgraded to v11 and got a lot of 'no-undef' errors in my TypeScript files. I went to investigate what happened and realized that the lines that disabled the 'no-undef' rule were removed in #129.

I figured that it's because typescript-eslint's parser now allows users to specify "libs" available in the global scope, which may have lead to the conclusion this would fix the no-undef duplication error.

However, it doesn't allow users to specify external type packages. So if a user has any packages that declare global variables, you'll still get no-undef rules (e.g. .spec files).

I decided not to PR because I think this should be evaluated by the team before, but I can definetly help if you guys agree.

@Zamiell
Copy link
Contributor

Zamiell commented Oct 9, 2020

I just came across this bug myself; thanks guilhermetod for bringing it up. I was very surprised that this config shipped with the no-undef rule on, since it seems to make no sense in conjunction with TypeScript (at least if you are using TypeScript's strict mode anyway, which I presume most people use).

In my use-case, I am using the somewhat-popular TypeScriptToLua transpiler, which uses type declarations to imply global variables. So I immediately had to turn off the no-undef rule.

@iamturns
Copy link
Owner

Thanks for this reporting this. Removing no-undef was unintentional. Sorry about that. This rule has been restored, along with some other rules already checked by the TypeScript compiler. Cheers!

@iamturns
Copy link
Owner

🎉 This issue has been resolved in version 11.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants