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

feat(rome_json_analyze): noDuplicateKeys #4592

Merged
merged 9 commits into from
Jun 21, 2023
Merged

feat(rome_json_analyze): noDuplicateKeys #4592

merged 9 commits into from
Jun 21, 2023

Conversation

ematipico
Copy link
Contributor

@ematipico ematipico commented Jun 18, 2023

Summary

Part of #4444

I created a new crate and rule under the nursery group. Updated all the configuration scripts too.

Test Plan

Added new test cases.

Changelog

  • The PR requires a changelog line

Documentation

  • The PR requires documentation
  • I will create a new PR to update the documentation

@netlify
Copy link

netlify bot commented Jun 18, 2023

Deploy Preview for docs-rometools ready!

Name Link
🔨 Latest commit 6cf78d5
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/6492e2ed78c6c90008eedb0c
😎 Deploy Preview https://deploy-preview-4592--docs-rometools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added A-Diagnostic Area: errors and diagnostics A-Linter Area: linter A-Project Area: project configuration and loading A-Tooling Area: our own build, development, and release tooling labels Jun 18, 2023
@ematipico ematipico marked this pull request as ready for review June 18, 2023 16:49
@github-actions
Copy link

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 48863 48863 0
Passed 47810 47810 0
Failed 1053 1053 0
Panics 0 0 0
Coverage 97.84% 97.84% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6212 6212 0
Passed 1763 1763 0
Failed 4449 4449 0
Panics 0 0 0
Coverage 28.38% 28.38% 0.00%

ts/babel

Test result main count This PR count Difference
Total 639 639 0
Passed 573 573 0
Failed 66 66 0
Panics 0 0 0
Coverage 89.67% 89.67% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 17224 17224 0
Passed 13121 13121 0
Failed 4103 4103 0
Panics 0 0 0
Coverage 76.18% 76.18% 0.00%

@ematipico ematipico requested a review from Conaclos June 19, 2023 08:26
@ematipico ematipico force-pushed the feat/json-analyze branch 2 times, most recently from 2b09f59 to b58acb2 Compare June 19, 2023 08:41
Copy link
Contributor

@Conaclos Conaclos left a comment

Choose a reason for hiding this comment

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

While we keep adding rules, I am wondering how a user knows if a rule is for a language A or a language B.

For instance, the current rule noDuplicateKeys could easily be confused with noDuplicateObjectKeys. Should we rename it to noDuplicateJsonKeys?

EDIT: However, this could result in adding Json in any JSON lint rules?

@ematipico
Copy link
Contributor Author

ematipico commented Jun 21, 2023

While we keep adding rules, I am wondering how a user knows if a rule is for a language A or a language B.

That's the good thing about that rome, a rule is language agnostic. In the previous version of rome (the TS one), some rules were able to run in JSX and HTML (mainly the a11y ones) :)

I believe we are not there yet though, in terms of architecture.

@Conaclos
Copy link
Contributor

Since we have noDuplicateJsxProps, I think it could be good to rename the rule to noDuplicateJsonKeys.

@ematipico ematipico requested a review from Conaclos June 21, 2023 11:45
@ematipico
Copy link
Contributor Author

ematipico commented Jun 21, 2023

Going to merge this. I'll follow up with a PR to integrate it with the workspace, and I am going to add some documentation too. Changelog as well, obviously

@ematipico ematipico merged commit 50eb45f into main Jun 21, 2023
18 checks passed
@ematipico ematipico deleted the feat/json-analyze branch June 21, 2023 13:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Diagnostic Area: errors and diagnostics A-Linter Area: linter A-Project Area: project configuration and loading A-Tooling Area: our own build, development, and release tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants