Configuration file #2632
Replies: 7 comments 19 replies
-
config.formatterThis is the section related to the formatter. Here's my suggestion of how section should be: {
"formatter": {
"enabled": true,
"indentStyle": "space",
"spaceNumber": 4,
"lineWidth": 120,
"js": {
"quote_style": "double"
},
"ignore": [ "./path", "./path/to/file.js" ]
}
} The reason why I moved Inside
I am not sure about the shape of {
"formatter": {
"indentStyle": {
"type": "space",
"quantity": 4
}
}
}
|
Beta Was this translation helpful? Give feedback.
-
config.lintThis is the section related to the linter. Here's my suggestion of the config could be: {
"lint": {
"enabled": true,
"globals": ["$"],
"ignore": [""],
"requireSuppressionExplanations": true,
"disabledRules": {
"js": [
"noVar"
],
"jsx": [
"noPropSpreading"
]
}
}
}
In theory we should be able to codegen the struct that will support |
Beta Was this translation helpful? Give feedback.
-
config.parserConfiguration related to our internal parsers. Here's my suggestions: {
"parser": {
"jsxEverywhere": true
}
}
Not sure if, for now, we could have more configuration options for the parser. |
Beta Was this translation helpful? Give feedback.
-
config.dependenciesThis configuration tells rome if it should check dependencies too. This is not a signal to Rome to build the dependency graph. {
"dependencies": {
"enabled": true,
"invalidLicenses": ""
}
} Enabling this tools will tell to rome to check if a dependency actually exists, run some health check on their manifests, and emit a diagnostic during Let's suppose we have import { ReactDOM } from "react-dom"; But it's not installed, then Rome will emit a diagnostic. It will emit a diagnostic if the dependency has an invalid license. |
Beta Was this translation helpful? Give feedback.
-
Currently the configuration schema I've implemented for the language-specific settings in {
"formatter": {
"enabled": true,
"indentStyle": "space",
"spaceNumber": 4,
"lineWidth": 120
},
"linter": {
"enabled": true
},
"languages": {
"javascript": {
"formatter": {
"indentStyle": "tabs",
"quoteStyle": "double"
}
},
"css": {
"linter": {
"enabled": false
}
}
}
} The main difference with the proposed Additionally in this schema each language can specify not just their specific options but also override the entire set of supported global settings, for instance to only enable the linter or formatter for specific languages. I'm not entirely certain this is something we actually want to support though, or if it fits with the "configuration philosophy" of the project |
Beta Was this translation helpful? Give feedback.
-
Should we consider putting a version number in the config to allow for future breaking changes? |
Beta Was this translation helpful? Give feedback.
-
Should/can support for the In general, I think it would be nice to have all of the CLI flags supported in Right now you either have to full commit to CLI flags in
Ideal world:
|
Beta Was this translation helpful? Give feedback.
-
Rome will have to support a configuration file, where the user can store their preferences and rome will pick it up and apply all the information to the tools.
Here's a link to the configuration of the rome classic:
https://github.com/rome/tools/blob/archived-js/internal/project/types.ts#L58-L104
This the "default" config file, where Rome classic provides its defaults:
https://github.com/rome/tools/blob/archived-js/internal/project/types.ts#L251-L320
Below, there's a thread for each big section that we will have inside the configuration file.
Beta Was this translation helpful? Give feedback.
All reactions