-
Notifications
You must be signed in to change notification settings - Fork 3
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
Sortier not working on macintosh #352
Comments
Hmmm I don't think this has to do with OSX because I'm definitely using this on my mac right now. I'm also confused as to why you aren't seeing an error message being outputted because in general there should be something. I can look into that in a separate issue... let's get this working for you :-). Could you attempt to run sortier manually on the files being edited? Maybe you'll get a clearer error from sortier? First is to figure out the command being executed. To do this you can do is enable debug mode in lint-staged by passing the
Somewhere in the output there should be the command for sortier. Mine looks like this (I blanked out the project name)
With that, hopefully you can run sortier directly and see why it is failing. |
Opened #353 to determine how to get lint-staged to stop on failure. |
I've uploaded a log from my colleague when he's running sortier with the debug flag. Hope that helps a bit :) |
Thanks, I'm going to try a few attempts to repro this locally and hopefully come up with something for you. Considering package.json is a json file, I doubt the issue is there so odds are it's something to do with the storybook webpack config because I personally haven't tried that. While I'm trying that today, you're also welcome to run sortier directly on those files and see if it provides you some sort of error or not. To do that on OSX you can simply run it from the node_modules bin. For example, I've added a error in my package.json and this is the command I ran along with the output.
|
Okay, so I setup a
I also ran it over a package.json and that seemed to work fine as well. So I guess let me know how running it directly works for you. Another option is that the issue maybe with husky and lint-staged so I would check to make sure those are up to date as well. |
Just a reminder, waiting on a response here :-) |
Hi there, i've been following this since thread for a while and i'd like to chip in!
Using the VSCode plugin earlier everything worked great.
This stackoverflow drew my attention, as the answer seems to be related to having created the file on a windows machine. The output says Let me know how i can help further! |
Thanks @royderksroute42! I do sometimes publish from my windows machine so this could possibly be the issue which I'm thankful for because I was running out of ideas! I won't have a chance until tonight (12 hours from now) to see if I can resolve it but odds are if it is a carriage return at fault it is going to require a publish of 2.5.2. I'll keep this thread posted with my results :-) |
I could test it myself if you can give me a linenr and filename (not much time for digging in to find where it is located exactly). |
Hi, |
@RikardGehlin Wish you all the best! Based on what @royderksroute42 mentioned, this looks like there are two possible bugs
Overall it seems the issue is that since I mainly publish from my windows box my bin/index.js ends with /r/n. It doesn't seem to matter what the rest of the files are (based on other documentation I've read) just whatever file the bin is pointing to. I've followed the steps in a blog I found and created https://github.com/snowcoders/sortier/blob/master/.gitattributes then published @snowcoders/[email protected]. Hopefully this should fix up any and all issues If this doesn't fix up the problem (or we run into another line ending problem) I'm going to take the path of prettier and just apply lf line endings to everything, not just that one particular file. @royderksroute42 Can you pull down @snowcoders/[email protected] and give that a shot? |
🥇 |
Hmmm, using Husky/lintstaged doesn't seem to work yet.
|
Don't know what happend this morning, must have been reset to before 2.5.2 |
When you say json files are failing, are you talking about package.json or can you provide an example? I doubt it's related as well but just want to make sure. |
Closing this due to age and that the original issue was resolved. If you figure out what the JSON issue was, let me know! |
Our team is using sortier in our lint-staged. It works fine for the people ona windows machine but breaks for those on a macbook pro.
Expected output
For sortier to do its thing and sort stuff :)
Actual output (or error message)
The text was updated successfully, but these errors were encountered: