jo-sm/stylelint_d

why different CLI args between stylelint_d and stylelint?

Closed this issue · 6 comments

stylelint uses the --stdin-filename argument to assign a filename to files read via stdin. stylelint_d requires the --stdin argument to read from stdin plus the --file argument to specify a filename. I was curious to find out if that difference in arguments was deliberate, and if you would be open to removing that difference.

for context, I'm writing an auto-lint plugin for my editor and I was hoping I could allow users to simply specify stylelint or stylelint_d as the linter without having to set any special command-line arguments. I was able to do this when writing a plugin for eslint/eslint_d but I seem to be unable to do this for stylelint/stylelint_d without updates to stylelint_d .

jo-sm commented

Hey @orzechowskid, thanks for the issue. Looking back, it seems the --stdin-filename flag came right before I had started creating this and I missed it, and unfortunately since I haven't been using this as much as when I first made it, I haven't kept things up to date. I don't believe it was deliberate, just accomplishing the same thing in a different way, so I should be able to switch it.

stylelint_d also doesn't support most of the flags that stylelint does, so let me see how much it would take to add support for more flags as well.

jo-sm commented

Hey again @orzechowskid, after doing some preliminary investigation I've come to the conclusion that, while it is easy to support this specific issue, that a more thorough rewrite to bring stylelint_d close to parallel with the options from stylelint makes more sense. This means that it will take a little bit of time to close this issue but the end result will be more robust, supporting not just this but most/all other options I've missed.

ah, makes sense. I'd certainly love to see that rewrite of course, but since you said you don't use it so much these days I'm fully prepared to ship the workaround I built :)

jo-sm commented

I think that would be the best way to handle it in the interim period, until I get a chance to do the rewrite. I'll keep this issue open and write back here once the change has been published.

jo-sm commented

Hi @orzechowskid , the long awaited rewrite is finally here! I've just published a major rewrite of the entire daemon and the CLI arguments are aligned now. In your specific case, --stdin-filename now worked as expected.

Please update to version 2.0.0 at your earliest convenience. Cheers 🍻

awesome, thanks for the update! I'll take a look when I get a chance.