SimenB / stylint

Improve your Stylus code with Stylint
https://simenb.github.io/stylint/
GNU General Public License v2.0
348 stars 62 forks source link

Support inputting contents via stdin #378

Open Arcanemagus opened 7 years ago

Arcanemagus commented 7 years ago

It would be great for integrating the results of this tool into other programs (such as the linter-stylint Atom package) if stylint supported input via stdin.

When adding this a method of specifying a filename to associate with the stdin contents should probably be added as well, in other linters this is usually accomplished with a parameter such as --stdin-filename (Used by ESLint and Stylelint).

Arcanemagus commented 7 years ago

Looks like this is related to, if not already solved, by #274 (#161).

SimenB commented 7 years ago

Definitely want this! It might be cleaner for you to use the programmatic lintString API yes, but I still want you to be able to cat a file and pipe it into styllint (which internally could just call lintString) 😄 Having --stdin-filename as well sounds like a good idea.

It would be great if you could provide a PR for this, otherwise it might be a while before we get to it, unless @wojciechczerniak feels this should be in 2.0? If so, feel free to add it to the milestone and project

But hold on until I've completed the ESLint migration, otherwise the conflicts will be horrible done

Arcanemagus commented 7 years ago

Sorry, what time I have to spare is put into keeping the packages in the AtomLinter org running so I can't really commit to implementing this.

As to why that package isn't using the Node.js API in the first place I have no idea, you'd have to ask the original author for that 😛.

SimenB commented 7 years ago

Fair enough!

SimenB commented 7 years ago

Just a quick heads up that eslint requires stdin option to parse from stdin