Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bushuai
Copy link
Contributor

@bushuai bushuai commented May 3, 2025

Summary

closes #5856

this pr creates a new node that has the same leading trivia as the old one, and then uses the new node to perform the action mutation.

Test Plan

  1. added a test case
  2. updated snapshots

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels May 3, 2025
@bushuai bushuai force-pushed the fix/no-redundant-use-strict branch from 1c01f40 to 3b9f155 Compare May 3, 2025 09:52
@codspeed-hq
Copy link

codspeed-hq bot commented May 3, 2025

CodSpeed Performance Report

Merging #5868 will not alter performance

Comparing bushuai:fix/no-redundant-use-strict (3b9f155) with main (8e77d65)

Summary

✅ 95 untouched benchmarks

[],
))
.build()
.with_leading_trivia_pieces(value_token.leading_trivia().pieces())?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should reuse the same trivia piece only if there are comments. If you check the snapshots, all of them have been updated. Instead of deleting the whole line, we remove the directive but we keep the indentation that belonged to the directive.

@ematipico ematipico merged commit 2db73ae into biomejs:main Oct 15, 2025
13 checks passed
@github-actions github-actions bot mentioned this pull request Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 Code action of noRedundantUseStrict removes leading comment lines

5 participants