linterjs / cli

2 stars 0 forks source link

Configuration support #1

Open zimme opened 6 years ago

zimme commented 6 years ago

My initial thinking on this is that we won't have any configuration for the cli, but fully depend on the respective linter's config files.

npm i -D @linterjs/cli @linterjs/prettier @linterjs/eslint

In this case I would be required to have a .eslintrc file in my project, otherwise linter would fail because eslint actually expects a config file to be present, prettier would still run as it has defaults. However if you wanted to configure prettier you would do so with it's configuration files.

zimme commented 6 years ago

I hope this will make the implementation of the adapters easier and once the concept is proven and we kill it on twitter and trending on GitHub, we can start discussing configuration options.

zimme commented 6 years ago

Link to related issue: linterjs/core#1

azz commented 6 years ago

For the linting part of this, the order in which the linters run is not important.

It is very important which order the linters are ran. If prettier is run before eslint then the ESLint rules will take precedence. If Prettier is ran last the ESLint rules will be overwritten. The latter is currently achieved with eslint-config-prettier and eslint-plugin-prettier.

For formatting the code I'm thinking we should always run prettier first, if it's registered.

How do you make that determination?

zimme commented 6 years ago

It is very important which order the linters are ran. If prettier is run before eslint then the ESLint rules will take precedence. If Prettier is ran last the ESLint rules will be overwritten. The latter is currently achieved with eslint-config-prettier and eslint-plugin-prettier.

When it comes to showing linting errors, I'm thinking we just give the same filePath and text to all linters and give back and array of output to the cli which it displays grouped by file. This way we should be able to show all errors for all linters for each file, right?

How do you make that determination?

prettier > all other linters 😄 No but on a serious note, how about we start there and add support for specific ordering later if there's a reason to do so?