Skip to content
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

Recursive glob patterns #201

Closed
chopfitzroy opened this issue Mar 26, 2017 · 3 comments
Closed

Recursive glob patterns #201

chopfitzroy opened this issue Mar 26, 2017 · 3 comments

Comments

@chopfitzroy
Copy link

Running 0.18.1 on Ubuntu 16.10 with Node v7.7.1.

I have the following command: xo resources/**/*.js.

I am trying to use it on the following structure:

├── admin
│   ├── assets
│       ├── main.js
└── webpack
    ├── config.js

Now that reports all linting failues in config.js but not main.js if I change that command to: xo resources/**/**/*.js. it now works but obviously I don't want to have to add a /** everytime I go one directory deeper.

I have looked at globby#24 and cpy#10 but neither seemed to really address the issue.

Is this by intentition or is this a bug?

In an ideal world xo resources/**/*.js would traverse all folders underneath resources recursively.

Cheers.

@Qix-
Copy link

Qix- commented Mar 27, 2017

What happens when you use xo 'resources/**/*.js' (in single quotes)?

Also, how are you running XO?

@chopfitzroy
Copy link
Author

Hey @Qix- that seems to have fixed it.

I am running as an npm script: "lint:scripts": "xo 'resources/**/*.js'",.

Cheers.

@Qix-
Copy link

Qix- commented Mar 27, 2017

Yep - without the single quotes, it's your shell trying to expand the double star, not XO. To get it to work otherwise, you'd need shopt -s globstar in your .bash_profile. But the single quotes is a better solution since it works for everyone. :)

marionebl added a commit that referenced this issue Apr 2, 2017
* fixes fallout of #195
* builds on #201, #202
* removes parse-gitignore in favor of node-ignore
marionebl added a commit that referenced this issue Apr 3, 2017
* fixes fallout of #195
* builds on #201, #202
* removes parse-gitignore in favor of node-ignore
marionebl added a commit that referenced this issue Apr 30, 2017
* fixes fallout of #195
* builds on #201, #202
* removes parse-gitignore in favor of node-ignore
marionebl added a commit that referenced this issue Apr 30, 2017
* fixes fallout of #195
* builds on #201, #202
* removes parse-gitignore in favor of node-ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants