matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

recursive option with npm scripts ignoring matched files #245

Closed chrisblossom closed 7 years ago

chrisblossom commented 7 years ago

When using npm scripts to recursively fix all files in a directory ignores files. Running the same command directly works as expected.

I am not sure if this is a npm/node issue or stylefmt. I have put together a simple repo to demonstrate what I am seeing.

chrisblossom/stylefmt-recursive

stylefmt-recursive ➜ npm run fix

> stylefmt-recursive@1.0.0 fix /Users/chris/github/stylefmt-recursive
> stylefmt --config .stylelintrc.js --recursive src/**/*.css

src/dir1/dir1.css

1 files are formatted.

stylefmt-recursive ➜ stylefmt --config .stylelintrc.js --recursive src/**/*.css
src/dir1/dir2/dir2.css, src/src.css

2 files are formatted.

stylefmt-recursive ➜ npm -v
3.10.8
stylefmt-recursive ➜ node -v
v6.9.1

Thank you!

seka commented 7 years ago

Is it the same problem?

https://github.com/morishitter/stylefmt/issues/223#issuecomment-263537119

chrisblossom commented 7 years ago

Yes, looks like it. The following change in the package.json script section fixed the issue "fix": "stylefmt --config .stylelintrc.js --recursive src/**/*.css" --> "fix": "stylefmt --config .stylelintrc.js --recursive 'src/**/*.css'"

Thank you for the response!