Open alistair-hmh opened 5 years ago
Apologies, I just saw this: https://github.com/xojs/xo#monorepo - trying this now...
The suggestion in the XO documentation only seems to work if the root package.json
contains the XO config. In the mono-repo I'm working with, I have to have different settings for each package, for example, one package is a React app, another is a standard Node module.
Is XO just the wrong tool for the job here?
Is there a way to make the closest package.json to the file being edited - as the package.json the rules are picked from?
That's how it should work. Otherwise it's a bug. It uses the closest package.json as long as it doesn't contains {"xo": false}
.
This might be related to https://github.com/xojs/xo/pull/279.
Thanks. Yes, that looks like the exact same thing I'm experiencing.
For now, I'm forced to drop Sublime for VSCode for this mono-repo project. Not a huge deal, but I'll look forward to switching back.
(In case it's useful to know, I am using the {xo: false}
in the root package, and not in the sub-packages. Also, I open the Sublime project from the Lerna mono-repo root. I can open Sublime from each subpackage and the linting works fine, but then my desktop gets littered with windows.)
I am using a Lerna repo which puts a
package.json
in the root of the repo, as well as all the subprojects for the repo inpackages/
.Example:
Each of my sub-packages in the Lerna repo has different XO rules.
When I edit the code in Sublime for a sub-package, it shows me default XO rules, when I would expect to see the rules working from the package I'm editing.
Is there a way to make the closest
package.json
to the file being edited - as the package.json the rules are picked from?