-
-
Notifications
You must be signed in to change notification settings - Fork 10
Add support for two package.json structure #37
Comments
We need that over at https://github.com/zeit/hyperterm |
@matheuss What do you suggest we do? |
We could check if the parent directory has a Also we could check if the current directory is an |
I guess... Only really need to check for |
Ohh that's true, my bad. So checking if the current directory is named |
Yes, except the |
Does it have to have anything to do with electron? Couldn't it just recurse upwards until it found a package.json with XO in it? Maybe with a few safety checks, like stopping whenever it finds a package.json with any eslint dependencies in them at all? |
@ekmartin That sounds nice in theory, but would be surprising when it suddenly starts using a XO config far up in the directory tree because none other contained XO. Another more generic solution would be to support skipping a package.json by just defining |
That would work too. I'm struggling to see a situation where users would have deeply nested package.json folders without wanting to impose some kind of structure though. A few scenarios I see are:
What do you think? If not maybe something like |
You might but right, but who knows. You'd be surprised how many weird and unexpected things people do. I've seen people accidentally put a config file that is meant to be local in their home directory and getting all kinds of weird hard to debug problems because it was walking all the way up to the home directory. I was kinda hoping to just make it work for this actual use-case, instead of trying to come up with a more generic solution for other imaginary use-cases. |
Yeah, that makes sense as well. Up to you! |
Ok, I've decided. I think PR welcome on the main XO project :) |
New XO version is out: https://github.com/sindresorhus/xo/releases/tag/v0.17.0 |
Ugh, I was wrong. This it not totally done. I forgot that this plugin reads the package.json too. That logic should really be moved to XO itself, but I'd be ok adding a quick workaround for now. Can just check if the package.json contains A pull request would be appreciated, as I don't think I'll get to this until next week. |
If you're viewing files inside an
app
folder on a twopackage.json
structure, you'll not see any XO reporting 😕We just need some better logic here https://github.com/sindresorhus/atom-linter-xo/blob/master/index.js#L32
The text was updated successfully, but these errors were encountered: