Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: silence magic-string warnings and update usage (#571)
magic-string 0.17.0 deprecated insertLeft and insertRight in favor of more precise prepend/append names. See this issue for a discussion on that: Rich-Harris/magic-string#109 To silence that warning, this commit moves the code to the new API, which was pretty easy because there are only a few call sites. I also cleaned up that part of `NodePatcher`, which didn't make a lot of sense. Now, instead of `NodePatcher.insert` calling `NodePatcher.insertRight` calling `MagicString.insertLeft` and `NodePatcher.insertLeft` being unused, we just have `NodePatcher.insert` calling `MagicString.appendLeft`. At least for now, I think it's best to always use the same insert method so that inserts go in order. I also changed insertRight to appendRight in one case because it probably makes more sense anyway and the tests pass.
- Loading branch information
1 parent
22e704d
commit 969cb08
Showing
5 changed files
with
7 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters