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

Do not fail if the location of a warning is outside the original source #4922

Merged
merged 3 commits into from Mar 24, 2023

Conversation

lukastaegert
Copy link
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

When a plugin transforms a file without generating a source map, it can be that the location when reporting a warning or error is outside the original source. This fix does not detect this case (locations will still be wrong), but ensures the warning or error is not covered by an out-of-bounds error.

@github-actions
Copy link

github-actions bot commented Mar 24, 2023

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#gh-4920-out-of-bounds-warning-location

or load it into the REPL:
https://deploy-preview-4922--rollupjs.netlify.app/repl/?pr=4922

@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Merging #4922 (a572888) into master (b6c4fd8) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4922   +/-   ##
=======================================
  Coverage   99.01%   99.01%           
=======================================
  Files         221      221           
  Lines        8051     8052    +1     
  Branches     2215     2216    +1     
=======================================
+ Hits         7972     7973    +1     
  Misses         26       26           
  Partials       53       53           
Impacted Files Coverage Δ
src/utils/getCodeFrame.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@lukastaegert lukastaegert merged commit 1517d03 into master Mar 24, 2023
14 checks passed
@lukastaegert lukastaegert deleted the gh-4920-out-of-bounds-warning-location branch March 24, 2023 06:16
@rollup-bot
Copy link
Collaborator

This PR has been released as part of rollup@3.20.2. You can test it via npm install rollup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error is thrown when there's a warning in a file that is transformed into a bigger file
2 participants