Giter VIP home page Giter VIP logo

Comments (23)

itaisteinherz avatar itaisteinherz commented on May 18, 2024 2

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.

nevilgeorge-zz avatar nevilgeorge-zz commented on May 18, 2024

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.

kevva avatar kevva commented on May 18, 2024

@nevilgeorge, you'd need to check if the items in ignores is a directory or not, and then append /** to it.

from xo.

sindresorhus avatar sindresorhus commented on May 18, 2024

Should be done in globby: sindresorhus/globby#33

from xo.

pvdlg avatar pvdlg commented on May 18, 2024

Should this issue be closed now that sindresorhus/globby#46 is merged?

from xo.

sindresorhus avatar sindresorhus commented on May 18, 2024

Yes, just needs to be mentioned in the docs first.

from xo.

pvdlg avatar pvdlg commented on May 18, 2024

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.

sindresorhus avatar sindresorhus commented on May 18, 2024

But it probably something that should be fixed in globby?

Yes. Can you open an issue over there?

from xo.

pvdlg avatar pvdlg commented on May 18, 2024

See sindresorhus/globby#62

from xo.

IssueHuntBot avatar IssueHuntBot commented on May 18, 2024

@issuehuntfest has funded $60.00 to this issue. See it on IssueHunt

from xo.

pvdlg avatar pvdlg commented on May 18, 2024

It was fixed by sindresorhus/globby#88

from xo.

pvdlg avatar pvdlg commented on May 18, 2024

Didn't mean to closed before someone else confirms

from xo.

sindresorhus avatar sindresorhus commented on May 18, 2024

@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.

pvdlg avatar pvdlg commented on May 18, 2024

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.

sindresorhus avatar sindresorhus commented on May 18, 2024

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.

pvdlg avatar pvdlg commented on May 18, 2024

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.

sindresorhus avatar sindresorhus commented on May 18, 2024

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.

fregante avatar fregante commented on May 18, 2024

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.

fisker avatar fisker commented on May 18, 2024

This is fixed, we use this feature ourself

xo/package.json

Lines 108 to 114 in 5ff95ad

"xo": {
"ignores": [
"test/fixtures",
"test/temp",
"coverage"
]
},

from xo.

sindresorhus avatar sindresorhus commented on May 18, 2024

@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.

fisker avatar fisker commented on May 18, 2024

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.

issuehunt-oss avatar issuehunt-oss commented on May 18, 2024

@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.

sindresorhus avatar sindresorhus commented on May 18, 2024

I'll just put the bounty on some other issue then.

from xo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.