Open qnp opened 3 weeks ago
Yes that's totally suitable. Based on stylus-supremacy, we can keep up with the ongoing development of Stylus at a lower cost, maintaining our project as a lightweight plugin. And I’d really appreciate your contribution!
Thanks for your response.
By the meantime, I dug into stylus-supremacy codebase and they are using Stylus lexer exactly as you do in the plugin for the parsing / lexing. So using stylus supremacy for that won't make a difference. Then, stylus supremacy uses its own rules, and conditions, based on its own options, to format the output. The output is made with string concatenating which is quite different from what is done for prettier (which relies on prettier’s internal builder). I wonder if we could use the string output from stylus supremacy, directly to send it to prettier ?
Otherwise, it may be better to author directly in stylus-supremacy a support for prettier plugin 🤔
What's your opinion on that ?
I wonder if we could use the string output from stylus supremacy, directly to send it to prettier ?
There's a problem here: If we directly use the string output from stylus-supremacy as the result, we won't be able to handle prettier-ignore.
Greetings @lsdsjy,
I'm looking forward to this project for a while. In my previous pipelines, I used stylus-supremacy to format stylus independently of prettier. Yet, a prettier plugin would be very much more convenient.
Stylus-supremacy is a very accomplished project, started a long time ago and recently received more attention since Stylus seems to be reborn, and reached 4.0.0 lately. It is a very advanced parser and formatter and I think
prettier-plugin-stylus
could benefit from directly using it instead of rewriting an entire parser / formatter.Do you think it is a suitable direction ? If yes, I would be happy to contribute to your projet by making the necessary developments to use stylus-supremacy.
Best regards