Stack from [ghstack](https://github.com/ezyang/ghstack) (oldest at bottom): * #33060 * __->__ #33051 Inspired by #32950. Specifically from https://github.com/facebook/react/issues/32950#issuecomment-2837887871, it sounds like Babel by default emits source map information for all nodes, even when they don't have a `loc` property set. Code coverage tools then pick up the synthesized source location information for this, leading to the issue described. It wasn't super clear how to omit nodes from the source map. A few google searches didn't turn up any documented way to do so: the user can do so via a function supplied to babel, but plugins can't. Entire files can be opted out, but not nodes. I asked an LLM which answered that explicitly setting `node.loc = null` omits the node from source maps, but that didn't work. What did work was explicitly setting the `loc` property to an object that follows the shape of a source location, but with all properties nulled out. With that, we get the desired result: <img width="553" alt="Screenshot 2025-04-30 at 10 50 30 AM" src="https://github.com/user-attachments/assets/cf55fd32-8375-4cfa-8202-49b45ef02931" /> I'm going to feature-flag this since setting some of these properties in this way might break in other versions of Babel or have other issues.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by josephsavona and has received 1 comments.