fix: check exports exist before access to it
while this issue exist https://github.com/import-js/eslint-plugin-import/issues/2866, this fix helps to prevent eslint from crashing.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 81.81%. Comparing base (
2de78c1) to head (fa07557).
Additional details and impacted files
@@ Coverage Diff @@
## main #2990 +/- ##
=======================================
Coverage 81.81% 81.81%
=======================================
Files 77 77
Lines 3795 3795
Branches 1257 1260 +3
=======================================
Hits 3105 3105
Misses 690 690
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@ljharb
- Use webstorm
- create new js file and define variable and export it 'export default someVar'.
- see eslint error that export is not used anywhere.
Without PR eslint process crashes
I understand the repro, but we need a code regression test.
Is there an example in this repo of regression test with dynamically added code to mirror for this case?
Not that I know of. Unfortunately this is a really difficult failure case to reproduce in tests.