-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
Better interop with ESLint? #122
Comments
…so maybe all that is needed is a command that destructively sets the equivalent eslint config in package.json based on the xo config. That allows all modes of use. |
Why? Is there anything missing that you can only get by using ESLint? There are XO plugins (IMHO better than the ESLint ones) for most editors, so not really sure what you would gain. |
Well, the editor plugin for VSCode is a bit lacking, and it seems that if an editor officially supports a linter, it is likely to be eslint. Then there is also the npm thing, where it's a bit unclear what eslint deps to declare. If you use the extra config for React, you get a warning for missing deps. The only way around that would be if all eslint plugins/configs would be wrapped as being xo plugins/configs… |
Ok, so basically, consider this a feature request for a command that dumps the current eslint config as defined by xo into |
Lacking how? → https://github.com/SamVerschueren/vscode-linter-xo/issues/new // @SamVerschueren
Don't like discussing hypotheticals. Any decent editor would have plugin support.
I'm not following. You never declare ESLint as a dependency. That's bundled for you in XO.
That's the first time I'm hearing about this. Can you elaborate?
I'm open to it if there's an actual use-case. That's what I'm trying to investigate above. |
Isn't this exactly what |
|
Probably referring to this one xojs/vscode-linter-xo#7. Currently don't really have much time to reimplement the entire plugin. But PR is always more then welcome ;). I actually rarely use the |
|
I think this idea is sort of interesting. He is right that there is no XO config for WebStorm/IDEA, and the existing eslint plugin can't be forced to work with XO. I think this would probably only work for Still, it would be great if I could add (Or I could finally get around to writing a WebStorm plugin. But that means Java, which slows my productivity to a crawl). |
Can you elaborate? A flat node_modules dir is not guaranteed with npm3, only if it was freshly installed. There are alternatives that don't do this. I think the only real fix is adding eslint deps into devDependencies… |
I'm aware, but if you're installing eslint plugins directly into devDependencies, they should probably take precedence anyways.
Perhaps that's the most robust solution, but I wouldn't want it to do that. I'm more interested in a band-aid that works to provide editor support in most projects until native XO plugins are more ubiquitous. |
Yes, I hate it too, I am sad that we can't have comments in package.json to indicate what a dep is used for. So how would you solve the problem of |
I wonder if eslint can use relative paths as config and plugin names… |
So, for now, installing XO with any external config means also installing On Tue, Jun 7, 2016 at 6:24 PM James Talmage [email protected]
Wout. |
@wmertens We can probably make use of the |
I just found another use for this: codeclimate.com uses eslint as part of their analysis, and they need an eslintrc… |
Funny, on the day you made the comment about The initial code is https://github.com/eslint/eslint/pull/5145/files btw, it uses |
Since XO can best be described as an eslint wrapper, but you can't tell npm that, how about making XO edit the package.json to require eslint and all its dependencies? That way you would edit the XO config, and it would automatically install all the required plugins. |
This sounds like the That command expands the wrapper's dependencies and config into the project, and then disappears. XO (or more likely a secondary tool for it) could apply the config to eslintrc and package.json but still stay around to be the "source of truth" of the configuration. This way if you only have ESLint (for example in a non-xo-supporting editor), it should automatically behave the same as XO. |
I agree with @wmertens -- CodeClimate integration for XO would be awesome. More to the point, however, is that when |
Here's another example: https://github.com/relekang/lint-filter only shows you linter errors from your changes since you branched from However, it needs to read the eslint configuration… |
Continued in #272 |
Closing this old issue in favor of more actionable ones: |
Ok, this is hard to explain. I really like XO, but it is just a very thin wrapper around eslint nowadays, with eslint config in package.json and the various editor plugins for eslint having also discovered the fix capabilities of eslint.
Furthermore, eslint plugins have npm dependencies for eslint, but XO pulls in eslint so it is missing from the project's package.json, leading to warnings, or else you have to manage eslint anyway.
It is really nice that XO plays the role of curator, pulling in useful eslint configs and plugins as they become available (:heart: AVA) .
So I am wondering if it would not be better if XO was only a CLI tool to run eslint and manage the eslint config and dependencies in package.json, but as far as npm and the editors are concerned, there is only eslint… I would like to run
xo update-config
and it would do all the things that would have happened with xo as a direct dependency, except that the rest of the eslint ecosystem understands what's going on…The text was updated successfully, but these errors were encountered: