Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config file structure changes #354

Open
4 tasks
SimenB opened this issue Oct 8, 2016 · 4 comments
Open
4 tasks

Config file structure changes #354

SimenB opened this issue Oct 8, 2016 · 4 comments
Milestone

Comments

@SimenB
Copy link
Owner

SimenB commented Oct 8, 2016

  • Move reporterOptions under reporter node.
  • Move all rules under rules node as eslint does.
  • Consolidate rule settings that are used together i.e. namingConventionStrict and namingConvention.
  • Normalize config on load, not in multiple different places
@SimenB
Copy link
Owner Author

SimenB commented Oct 8, 2016

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

@wojciechczerniak
Copy link
Collaborator

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
   }
}

@SimenB
Copy link
Owner Author

SimenB commented Oct 8, 2016

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?

@SimenB
Copy link
Owner Author

SimenB commented Oct 11, 2016

Didn't receive any response on Gitter, tried opening an issue: eslint/eslint#7339. Hopefully they are positive towards it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants