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

fix(eslint-plugin): [no-require-imports] report only global require #3871

Merged
merged 3 commits into from Sep 21, 2021

Conversation

rafaelss95
Copy link
Contributor

Fixes #3713.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @rafaelss95!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@codecov
Copy link

codecov bot commented Sep 12, 2021

Codecov Report

Merging #3871 (954124c) into master (4195919) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3871   +/-   ##
=======================================
  Coverage   93.50%   93.51%           
=======================================
  Files         151      151           
  Lines        8134     8137    +3     
  Branches     2580     2581    +1     
=======================================
+ Hits         7606     7609    +3     
  Misses        167      167           
  Partials      361      361           
Flag Coverage Δ
unittest 93.51% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ages/eslint-plugin/src/rules/no-require-imports.ts 100.00% <100.00%> (ø)

@rafaelss95 rafaelss95 changed the title fix(eslint-plugin): [no-require-imports] report only global 'require' fix(eslint-plugin): [no-require-imports] report only global require Sep 12, 2021
@bradzacher bradzacher added the bug Something isn't working label Sep 13, 2021
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for doing this!
a few comments

@bradzacher bradzacher added the awaiting response Issues waiting for a reply from the OP or another party label Sep 20, 2021
@rafaelss95
Copy link
Contributor Author

rafaelss95 commented Sep 21, 2021

instead of copy-pasting it - let's move this to an internal util within the util folder and share the code.

https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/src/util

@bradzacher, do you want me to do this in this PR (and also use it in no-shadow)?

Actually I just realized we can simply use ASTUtils.findVariable here and even in no-shadow (I can send another PR addressing this or maybe amend it to #3868). Let me know your thoughts.

@bradzacher
Copy link
Member

(I can send another PR addressing this or maybe amend it to #3868). Let me know your thoughts.

Feel free to make another PR - keeps it clear and attributes each contribution to you :)

@bradzacher bradzacher removed the awaiting response Issues waiting for a reply from the OP or another party label Sep 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[no-require-imports] require created by createRequire should be ignored
2 participants