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

☂️ Create rome_json_analyze crate #4444

@ematipico

Description

@ematipico

Description

Now that Rome "knows" JSON files, we should be able to create rules to lint JSON files.

The new crate should be similar to what we have inside rome_json_analyze.

A rule that we could create for this new crate could be suspicious/noDoubleKeys (name subject to change), which should check for the presence
of double keys inside a JSON file:

{
	"foo": "bar",
	"foo": "baz"
}

Here's a list of tasks (not in order, maybe something is missing):

  • create a new rome_json_analyze crate
  • create a test suite inside rome_json_analyze
  • wire the new crate with the workspace (file_handlers/json.rs)
  • update generate_configuration.rs to auto-generate the configuration and add these new rules
  • update lintdoc to emit and "check" the documentation of the rules inside rome_json_analyze
  • create suspicious/noDoubleKeys

@rome/core-contributors are you interested in implementing the feature? I am very interested in this, because it would allow us to create excellent rules.

For example, I am currently working on plugging the package.json into rome, and we could have rules that emit diagnostics/warnings. For example, I am thinking of creating a rule that checks the licenses, and it will emit an error/warning.

Metadata

Metadata

Assignees

Labels

A-LinterArea: linterHelp wantedHelp would be really appreciatedI-NormalImplementation: normal understanding of the tool and awarenessL-JSONLanguage: JSONumbrellaIssue to track a collection of other issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions