Open SimenB opened 7 years ago
IMO, we should copy the config format of eslint for rules. A name, and error
, warn
or off
, or an array of the same, plus options.
Not necessarily because I think it looks good, but it's something people should be familiar with, and eslint probably use some module internally we could leverage. Alternatively extract, then leverage.
EDIT: Seems to be internal: https://github.com/eslint/eslint/tree/master/lib/config Asked about extracting it in their gitter room: https://gitter.im/eslint/eslint?at=57f8e381a7c618cd26f3f20f
While we wait I've got another question here. With #365 in mind, how should we structure reporter
configuration?
{
"reporter": {
"formatter": "json",
}
}
for short (should we?):
{
"reporter": "json"
}
If we want to change reporter from console.log
can we still format with json
?
{
"reporter": {
"name": "default",
"formatter": "json"
}
}
Well, default is default 🎉 and unnecessary here, but this will call require(name) as it does now?
Should options be flat or under options
node?
{
"reporter": {
"formatter": "json",
"options": {
"columns": ["lineData", "severity", "description", "rule"],
"columnSplitter": " ",
"showHeaders": false,
"truncate": true
}
}
}
vs :
{
"reporter": {
"formatter": "json",
"columns": ["lineData", "severity", "description", "rule"],
"columnSplitter": " ",
"showHeaders": false,
"truncate": true
}
}
Or... those are totally unrelated
{
"reporter": {
"name": "default"
},
"formatter": {
"name": "json",
"columns": ["lineData", "severity", "description", "rule"],
"columnSplitter": " ",
"showHeaders": false,
"truncate": true
}
}
Let's just go formatter
for now, and keep reporter
out of it. If people don't want output to stdout, I'm thinking we wait for the feature request. I don't see the use case for it, personally.
So then you have "formatter": "custom-formatter"
being shorthand for "formatter": {"name": "custom-formatter"}
, and just chuck config in there.
If it's called default
, just special case it?
Didn't receive any response on Gitter, tried opening an issue: eslint/eslint#7339. Hopefully they are positive towards it!
reporterOptions
underreporter
node.rules
node as eslint does.namingConventionStrict
andnamingConvention
.