-
-
Notifications
You must be signed in to change notification settings - Fork 285
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
Ignore rules with sub-projects don't seem to work #469
Comments
Can you share the |
Here it is: "xo": {
"ignores": [
"lib/frontend/client/**/*"
],
"extends": "plugin:mocha/recommended",
"plugins": [
"mocha"
],
"rules": {
"func-names": [
"error",
"as-needed"
],
"no-use-extend-native/no-use-extend-native": "off",
"func-name-matching": "off",
"no-console": "error"
},
"overrides": [
{
"files": "test/**/*.js",
"envs": [
"node",
"mocha"
],
"global": [
"expect",
"sinon",
"testUtils"
],
"rules": {
"func-names": "off",
"prefer-arrow-callback": "off",
"no-unused-expressions": "off"
}
},
{
"files": "_commands/**/*.js",
"rules": {
"unicorn/no-process-exit": "off",
"no-console": "off"
}
},
{
"files": "scripts/**/*.js",
"rules": {
"no-console": "off"
}
}
]
} |
This definitely looks like a bug in XO's TypeScript handling. I'm not sure why it's trying to resolve a // @pvdlg |
Please let me know if there's anything you need from me! I tried to create a minimal use case, but I'm not sure what's causing the issue. I'm happy to run any modified versions to debug or |
Hi, I think I just came across this same problem but not with TypeScript, just a submodule with an older version of XO. Running
The root config, running "xo": {
"ignores": [
"submodules/**/*.js"
],
"prettier": true,
"rules": {
"no-await-in-loop": "off"
},
"space": true
} The submodule config, running "xo": {
"prettier": true,
"rules": {
"no-await-in-loop": "off"
},
"space": true
} This will probably be "fixed" for me after I update the submodule's XO to the same version, but I figured I'd comment here anyway since I was expecting the files to be ignored completely. Edit: Confirmed my suspicion that updating the submodule XO "fixes" it. |
@sindresorhus I've narrowed the issue to config files - when globby generates [
{
// This config is the one I want to be used (contains `ignores: ["lib/frontend/**/*"]`)
filepath: "{root}/package.json",
},
{
// This is a discovered config that should be ignored
filepath: "{root}/lib/frontend/client/package.json",
},
{
// This is a discovered config that should be ignored
filepath: "{root}/.../out-tsc/package.json",
},
] So How do you suggest the issue be fixed (either from an XO side, or flag / config side)? I'm more than happy to take a stab at creating a PR if needed. Do you know if there are other config issues that this could be similar to? Relevant lines: Lines 100 to 105 in a5ff341
|
@sindresorhus wanted to follow up since it's been a bit 😄 The concise version of the issue is this:
Is this something that needs to be fixed in the config or in xo? If it's an xo issue, I'd be more than happy to create a PR to fix it if you point me in the right direction |
Looks like this was fixed in the latest release(s), I'm guessing because of #534 |
Hey 👋
I'm working on a project that's written in JS, but has a submodule that uses typescript. I'm trying to bump xo from 0.25.3 to 0.30.0, but I'm running into a bunch of errors.
The submodule is rooted at
lib/frontend/client
and no matter what I set in the ignore flag, I get a bunch of errors from the compiled output of the submodule:Partial screenshot of terminal output
I've tried the following combinations:
--ignore lib
,--ignore lib/frontend/client
,--ignore lib/frontend/client/\*\*
,--ignore lib/frontend/client/\*\*/\*
I had the ignore pattern
"lib/frontend/client/**/*.js"
in my package config for 0.25.3 which was fully functional, and I changed it to"lib/frontend/client/**/*"
for 0.30.0 to reflect the added typescript support, but that's still failing. I ran into this issue while trying to bump xo to 0.28.x and 0.29.x as well.I checked the docs, and didn't see anything about this, and I couldn't find any issues with a similar problem.
I also see a bunch of these warnings at the end:
Let me know if you'd like any more info! Thanks
The text was updated successfully, but these errors were encountered: