-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore(eslint-plugin): deprecate no-var-requires in favor of no-require-imports #8334
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
Conversation
Thanks for the PR, @arka1002! 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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi, I just have one doubt, just to make sure I understood the problem correctly In example - /* eslint "@typescript-eslint/no-require-imports": ["error", { "allowAsImport": true } ] */
import foo = require("foo"); // no error (??) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly solid! A bit around config recommendations & unit tests, and this'll be good to go...
...once v7 v8 is ready to go. Which will be in a few months. So this'll have to wait 😅. But thanks in the interim!
Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Progress!
Note that I retargeted this against the v8
branch.
options: [{ allowAsImport: true }], | ||
}, | ||
{ | ||
code: 'require(foo);', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I'm not positive that this should be allowed with allowAsImport
. There's no import()
in there. The intersection of folks using import =
syntax and needing to require()
in globals and using this rule seems pretty low to me. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typescript-eslint#8920) * fix(typescript-estree): add TSEnumBody node for TSEnumDeclaration body * Fixed up tests and their snapshots * More about enums * Indent too * Update packages/ast-spec/src/special/TSEnumBody/spec.ts Co-authored-by: Brad Zacher <brad.zacher@gmail.com> * parent types touchups * Update packages/visitor-keys/src/visitor-keys.ts Co-authored-by: Brad Zacher <brad.zacher@gmail.com> --------- Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v8 #8334 +/- ##
==========================================
- Coverage 87.42% 87.32% -0.11%
==========================================
Files 386 252 -134
Lines 13094 12438 -656
Branches 3788 3918 +130
==========================================
- Hits 11448 10862 -586
+ Misses 1354 1305 -49
+ Partials 292 271 -21
Flags with carried forward coverage won't be shown. Click here to find out more.
|
packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swell, thanks! Looks great to me. Thanks for making the changes 🙂
Leaving with 1 approval
, since @auvred was reviewing too.
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
The tests which failed in this pr, failed in the v8 branch too ? c0bf6fc , see the CI check in this commit. |
BREAKING CHANGE:
Deprecates a previously-recommended rule.
PR Checklist
Overview