Comments (23)
Is this still an issue? When testing locally using the latest version of XO (v0.23.0
), XO seems to correctly ignore a directory given that package.json
contains the following config:
{
...
"xo": {
"ignores": [
"dir"
]
},
...
}
from xo.
Could I get some more info about this? I think I could help, but not really sure what needs to be done exactly!
from xo.
@nevilgeorge, you'd need to check if the items in ignores
is a directory or not, and then append /**
to it.
from xo.
Should be done in globby
: sindresorhus/globby#33
from xo.
Should this issue be closed now that sindresorhus/globby#46 is merged?
from xo.
Yes, just needs to be mentioned in the docs first.
from xo.
After testing it doesn't works because globby expand directory only for the patterns
not for the ignores
.
That should works if we merge #288 though.
But it probably something that should be fixed in globby?
from xo.
But it probably something that should be fixed in globby?
Yes. Can you open an issue over there?
from xo.
from xo.
@issuehuntfest has funded $60.00 to this issue. See it on IssueHunt
from xo.
It was fixed by sindresorhus/globby#88
from xo.
Didn't mean to closed before someone else confirms
from xo.
@pvdlg I think we need to update globby
first. I haven't done so yet, as it drops support for Windows paths (or rather fast-glob
did), so we need to manually handle that here or wait for mrmlnc/fast-glob#240.
from xo.
Just to be sure I fully understand.
The problem is about passing a non glob windows path to XO such as:
$ xo C:\my-project\my-file.js
which fast-glob wrongly interprets as a glob.
But it's not related to use globs with windows backslashes such as:
$ xo C:\my-project\*.js
Is that right?
If yes we should be able to add the code you linked in sindresorhus/del@01da91f#diff-168726dbe96b3ce427e7fedce31bb0bcR41-R53 to globby?
from xo.
No, the inverse. xo C:\my-project\*.js
will no longer work as globbing patterns can only have forward slashes now. So we need to manually convert the backward slashes to forward slashes.
If yes we should be able to add the code you linked in sindresorhus/del@01da91f#diff-168726dbe96b3ce427e7fedce31bb0bcR41-R53 to globby?
Yes, but I'm not super excited about having to do that manually in every library that uses globby
. I would prefer to solve the problem at the globby
side with maybe a separate method that accepts both paths and globs, or an option, which would handle transforming the slashes.
from xo.
No, the inverse. xo C:\my-project*.js will no longer work as globbing patterns can only have forward slashes now. So we need to manually convert the backward slashes to forward slashes.
I'm confused then. sindresorhus/del@01da91f#diff-168726dbe96b3ce427e7fedce31bb0bcR45 make the transformation only if the pattern is not a glob.
The way I understand the code is that C:\my-project\*.js
will not be transformed while C:\my-project\my-file.js
will be.
Yes, but I'm not super excited about having to do that manually in every library that uses globby. I would prefer to solve the problem at the globby side with maybe a separate method that accepts both paths and globs, or an option, which would handle transforming the slashes.
What I meant was to call normalizePatterns
inside globby
before passing the patterns to fast-glob
so libraries using globby
wouldn't have to do anything.
from xo.
Ah, your right. I was just confused by your wording:
which fast-glob wrongly interprets as a glob.
It doesn't "wrongly interpret it as a glob", fast-glob
doesn't do anything wrong. Anything you pass it is a glob and the backslashes are interpreted as escapes.
So yes, we're on the same page.
What I meant was to call normalizePatterns inside globby before passing the patterns to fast-glob so libraries using globby wouldn't have to do anything.
👍
from xo.
eslint already supports ignoring patterns: https://eslint.org/docs/user-guide/configuring#ignorepatterns-in-config-files
Setting xo.ignorePatterns
should work, according to #428 (comment)
from xo.
This is fixed, we use this feature ourself
Lines 108 to 114 in 5ff95ad
from xo.
@fisker Do you know what commit fixed it? No worries if not, I just need to know who to give the bounty to.
from xo.
I don't know, but both globby
and eslint
seems
support that, and we run ignore check on both of them. So the one add support on globby
, the one update globby
, and the one update eslint
?
from xo.
@sindresorhus has rewarded $54.00 to @sindresorhus. See it on IssueHunt
- 💰 Total deposit: $60.00
- 🎉 Repository reward(0%): $0.00
- 🔧 Service fee(10%): $6.00
from xo.
I'll just put the bounty on some other issue then.
from xo.
Related Issues (20)
- [minor] Improve documentation
- Fails with eslint 8.40.0: TypeError: Cannot read properties of undefined (reading 'getAllComments') HOT 6
- Error with 'no-unsafe-*' rules in Vite project HOT 1
- Add `--max-warnings` flag (fail on warnings) HOT 1
- xo --fix: Multiple fails with TypeError: Cannot read properties of undefined (reading 'get') HOT 2
- Expected HOT 2
- Unexpected token with dynamic import with type assertion HOT 1
- In a monorepo with turborepo and typescript which is the best setup? HOT 1
- Support with reviewdog? HOT 1
- Replace native/deprecated stylistic rules with `eslint-stylistic` HOT 2
- Automatic ecmaVersion HOT 2
- Projects in a Turborepo monorepo not using workspace package.json config HOT 2
- Deprecation of Formatting Rules in ESLint v8.53 HOT 5
- Proposal: enable strict-boolean-expressions
- XO seems to not play well with Typescript's array `extends` HOT 1
- EACCESS: permission denied on ignored directory HOT 2
- Reintroduce "length" rules to catch excess HOT 3
- List typescript extensions as well for `extensions` config
- regression: `xo: false` in nested `package.json` is not supported any more HOT 9
- xo does not check for `.xo.config.js` (or any file with dot '.' prefix) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xo.