Check if it's needed for `toStringWithSourceMap` to produce mapping for eol

Open
#478 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript
Domain
tooling

Research direction

Start at lib/source-node.js#L396-L417 and inspect how end-of-line mappings are added by toStringWithSourceMap. Compare sourcemaps produced with and without those mappings, then use SourceMapConsumer to determine whether both forms remain valid and record whether the mappings are needed.

Written by the indexing model from the issue text.

Description

We add a mapping for each end of line here:
https://github.com/mozilla/source-map/blob/4e304db915cecd42505feb007766a034395c6eb7/lib/source-node.js#L396-L417

in a project of mine, I overridden this and was not doing this, and the SourceMapConsumer seems to be fine with the sourcemap that is being generated.

Dominant language
JavaScript
Stars
3.7k
Forks
370
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mozilla/source-map

All issues in mozilla/source-map

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.