-
Notifications
You must be signed in to change notification settings - Fork 651
☂️ Create rome_json_analyze crate #4444
Description
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_analyzecrate - create a test suite inside
rome_json_analyze - wire the new crate with the workspace (
file_handlers/json.rs) - update
generate_configuration.rsto auto-generate the configuration and add these new rules - update
lintdocto emit and "check" the documentation of the rules insiderome_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.