tools
tools copied to clipboard
📎 Support source type overrides
Description
Rome enables JSX for *.js files by default:
https://github.com/rome/tools/blob/ac43cf02ee4ac86bb8303936247243f531f46335/crates/rome_js_syntax/src/source_type.rs#L242-L249
This is great to require minimal configuration but has the issue that not all valid JavaScript is valid JSX.
It should be possible for users to disable JSX (or module parsing).
How do we plan to support this? Rome classic had this option:
{
"parser": {
"jsxEverywhere": true
}
}
That's something that should be figured out as part of the issue.
I would favor a non parser specific option as we don't want that users must enable jsx in parsing, lintining.
Considering how our rome.json differs from the classic one, maybe
{
"javascript": {
"parser": {
"jsxEverywhere": true
}
}
}
Or
{
"javascript": {
"jsxEverywhere": true
}
}
Seem good candidates.
For the name, no strong options. It can be the classic name or a new one.
Seem good candidates.
For the name, no strong options. It can be the classic name or a new one.
A boolean is probably not sufficient because Rome must know the JSX dialect to decide whether to enable React lint rules and how to transform the files. Let's solve this when we start working on this issue.
👋 @rome/staff please triage this issue by adding one of the following labels: S-Bug: confirmed, S-Planned , S-Wishlist or umbrella