matype / stylefmt

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

npm run script help #89

Closed chrisblossom closed 8 years ago

chrisblossom commented 8 years ago

Please provide an example of how to get this working with npm run scripts. I am using SASS (and css-modules) but this is the error I am getting:

> stylefmt -R ./src/*.scss

/Users/chris/github/app/node_modules/stylefmt/bin/cli.js:72
    files.forEach(function (file) {
         ^

TypeError: Cannot read property 'forEach' of undefined

Appreciate it!

matype commented 8 years ago

I'm so sorry, I will fix it soon.

chrisblossom commented 8 years ago

Thanks for the quick reply! No problem at all. Assumed I was doing something wrong.

matype commented 8 years ago

fmm... I couldn't confirm this error. Please tell me your versions of Node.js, stylefmt and OS.

chrisblossom commented 8 years ago

npm script "lint:css:fix": "stylefmt -R 'src/**/*.scss'",

>node --version
v4.4.1

>npm -v
3.8.5

>sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.4
BuildVersion:   15E65

What command are you running?

matype commented 8 years ago

@chrisblossom The bug seems to have fixed in v3.2.1. Please confirm it.

chrisblossom commented 8 years ago

Fixed in https://github.com/morishitter/stylefmt/commit/3fcb0c63e98b013bddcb72ffa9a42b7875ad5fbc. See https://github.com/morishitter/stylefmt/issues/127 for more details.