Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_js_analyze): fix a false positive for noDuplicateCase #4709

Merged
merged 1 commit into from
Jul 19, 2023
Merged

fix(rome_js_analyze): fix a false positive for noDuplicateCase #4709

merged 1 commit into from
Jul 19, 2023

Conversation

Conaclos
Copy link
Contributor

Summary

Fix #4706

Test Plan

Regression test included.

@netlify
Copy link

netlify bot commented Jul 18, 2023

Deploy Preview for docs-rometools canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 209f724
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/64b70346c1dfb30007c8d143

@github-actions github-actions bot added A-Linter Area: linter A-Parser Area: parser labels Jul 18, 2023
@Conaclos Conaclos changed the title fix(rome_js_analyze): fix fals epositive for noDuplicateCase fix(rome_js_analyze): fix a false positive for noDuplicateCase Jul 18, 2023
@Conaclos Conaclos merged commit 9360776 into rome:main Jul 19, 2023
18 checks passed
/// let b = JsSyntaxToken::new_detached(JsSyntaxKind::CONST_KW, "const", [], []);
/// assert!(inner_text(&a) != inner_text(&b));
/// ```
pub fn inner_text(token: &JsSyntaxToken) -> &str {
Copy link
Contributor

Choose a reason for hiding this comment

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

Two questions:

  • we have some inner_text functions already, weren't they sufficient?
  • why did you implement it as a function not inside as impl for syntax tokens?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is JS-spêcific, while SyntaxToken is more general. It is not possible to write an impl on a type-alias such as JsSyntaxToken?

Which inner_text do you refer to?

Copy link
Contributor

@ematipico ematipico Jul 19, 2023

Choose a reason for hiding this comment

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

We have a bunch of them: https://github.com/search?q=repo%3Arome%2Ftools+%22inner_string_text%22&type=code

So maybe there is some overlap, and if there isn't we should choose e better name to avoid confusion. Their names are very similar

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter A-Parser Area: parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 noDuplicateCase false positive on quotes
2 participants