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

Configuration File #1

Closed
azz opened this issue Dec 7, 2017 · 2 comments
Closed

Configuration File #1

azz opened this issue Dec 7, 2017 · 2 comments

Comments

@azz
Copy link
Member

azz commented Dec 7, 2017

No cli repository yet, so opening it here

Obviously a configuration file is required. I had a few ideas rattling in my head so I thought I'd jot down some examples.

Equivalent of eslint-config-prettier and tslint-config-prettier:

// .linterrc
{
  "rules": [
    {
      "files": "*.tsx?",
      "use": ["tslint", "prettier"]
    },
    {
      "files": ["*.jsx?", "*.md"],
      "use": ["eslint", "prettier"]
    }
  ]
}

Equivalent of prettier-eslint and prettier-tslint:

{
  "rules": [
    {
      "files": "*.tsx?",
      "use": ["prettier", "eslint"]
    },
    {
      "files": ["*.jsx?", "*.md"],
      "use": ["prettier", "eslint"]
    }
  ]
}

Passing options to a linter:

{
  "rules": [
    {
      "files": "*.js",
      "use": [
        ["prettier", { "tabWidth": 4 }],
        ["eslint", { "extends": ["standard", "prettier"] }]
      ]
    }
  ]
}

Note that the resolution for names in "use" would be:

  1. resolve("@linter/" + name)
  2. resolve("linter-" + name)
  3. resolve(name)
@zimme
Copy link
Member

zimme commented Dec 7, 2017

I'm hoping we can do without a config file tbh.

For the linting part of this, the order in which the linters run is not important.
For formatting the code I'm thinking we should always run prettier first, if it's registered.

So you would basically configure @linterjs by installing the adapters that you're interested in and the adapters would run on all files they support and/or are configured to run on, via their respective config files.

Let's see how far we can get without a config file.

@zimme
Copy link
Member

zimme commented Dec 7, 2017

Let's keep the discussion going in linterjs/cli#1.

@zimme zimme closed this as completed Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants