8000 fix(rome_js_analyze): fix a false positive for `noDuplicateCase` by Conaclos · Pull Request #4709 · rome/tools · GitHub
[go: up one dir, main page]

Skip to content
This repository was 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
Conaclos merged 1 commit into
rome:mainfrom
Conaclos:noDuplicateCase4706
Jul 19, 2023
Merged

Conaclos merged 1 commit into
rome:mainfrom
Conaclos:noDuplicateCase4706

Conversation

@Conaclos
Copy link
Copy Markdown
Contributor

Summary

Fix #4706

Test Plan

Regression test included.

@netlify
netlify Bot commented Jul 18, 2023 •
Copy link
Copy Markdown

✅ 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
/// 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
Copy Markdown
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
Copy Markdown
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?

@ematipico ematipico Jul 19, 2023 •
Copy link
Copy Markdown
Contributor

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

0