eslint-plugin-import icon indicating copy to clipboard operation
eslint-plugin-import copied to clipboard

fix: check exports exist before access to it

Open headfire94 opened this issue 1 year ago • 5 comments

while this issue exist https://github.com/import-js/eslint-plugin-import/issues/2866, this fix helps to prevent eslint from crashing.

headfire94 avatar Mar 27 '24 11:03 headfire94

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.

codecov[bot] avatar Mar 27 '24 11:03 codecov[bot]

@ljharb

  1. Use webstorm
  2. create new js file and define variable and export it 'export default someVar'.
  3. see eslint error that export is not used anywhere.

Without PR eslint process crashes

headfire94 avatar Mar 27 '24 15:03 headfire94

I understand the repro, but we need a code regression test.

ljharb avatar Mar 27 '24 15:03 ljharb

Is there an example in this repo of regression test with dynamically added code to mirror for this case?

headfire94 avatar Mar 27 '24 15:03 headfire94

Not that I know of. Unfortunately this is a really difficult failure case to reproduce in tests.

ljharb avatar Mar 27 '24 15:03 ljharb