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

Space always missing when run cssfmt out of project folder #45

Closed
chemzqm opened this issue Dec 16, 2015 · 6 comments
Closed

Space always missing when run cssfmt out of project folder #45

chemzqm opened this issue Dec 16, 2015 · 6 comments
Labels

Comments

@chemzqm
Copy link

chemzqm commented Dec 16, 2015

When I pipe content to the executable bin/cli.js in cssfmt folder, the result is corrent:

~/l/cssfmt(master|✚1…) $ cat ~/component-dev/iscroll/iscroll.css  | ./bin/cli.js
.iscroll-handlebar {
  position: absolute;
  right: 0px;
  top: 0px;
  transition: background-color 0.2s ease-out, transform 0.1s ease-out, width 0.1s ease-out, height 0.1s ease-out;
  width: 4px;
  border-radius: 2px;
  background-color: rgba(0, 0, 0, 0);
  z-index: 9999;
  height: 0px;
}

but when I run the command in another folder (like parent folder), all indent space is gone:

~/lib $ cat ~/component-dev/iscroll/iscroll.css | cssfmt/bin/cli.js
.iscroll-handlebar {
position: absolute;
right: 0px;
top: 0px;
transition: background-color 0.2s ease-out, transform 0.1s ease-out, width 0.1s ease-out, height 0.1s ease-out;
width: 4px;
border-radius: 2px;
background-color: rgba(0, 0, 0, 0);
z-index: 9999;
height: 0px;
}

Same bug occurs when I run command cssfmt

~/c/iscroll(master|…) $ cat iscroll.css | cssfmt
.iscroll-handlebar {
position: absolute;
right: 0px;
top: 0px;
transition: background-color 0.2s ease-out, transform 0.1s ease-out, width 0.1s ease-out, height 0.1s ease-out;
width: 4px;
border-radius: 2px;
background-color: rgba(0, 0, 0, 0);
z-index: 9999;
height: 0px;
}

I've no idea of how this could happen😞

my system is OSX El Capitan, npm version 2.14.7, node version v4.2.3

Thanks for help

@matype
Copy link
Owner

matype commented Dec 17, 2015

Thanks for your report. I will confirm it :)

@matype matype added the bug label Dec 17, 2015
@matype
Copy link
Owner

matype commented Dec 25, 2015

@chemzqm What is the version of CSSfmt? I checked by latest version(v1.3.9), so I got correct output on node v4.2.3.

@chemzqm
Copy link
Author

chemzqm commented Dec 25, 2015

Version 1.3.9, I'm trying to figure it out, I will let you know when I'm done

@chemzqm
Copy link
Author

chemzqm commented Dec 25, 2015

It should be a problem with https://www.npmjs.com/package/editorconfig-indent
as my editorconfig looks like this:

; .editorconfig

root = true

[*]
charset = utf-8

[**.css]
indent_style = space
indent_size = 2

It doesn't parse [**.css] section and return { indentSize: 0, indentStyle: null } for this editorconfig, and the file cssfmt/lib/config not handling this situation correctly, it should use default value (two space) instead give empty string

@matype
Copy link
Owner

matype commented Dec 25, 2015

Wow, I see. Thanks.

@matype
Copy link
Owner

matype commented Dec 31, 2015

@chemzqm I just fixed this bug (ae726ca) and released v1.4.0.

Please update to the latest version :)

@matype matype closed this as completed Dec 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants