stylelint / jest-preset-stylelint

Common configuration options for Jest in Stylelint environments.
MIT License
14 stars 4 forks source link

Add `getTestPackage` to verify various attributes of packages #110

Open romainmenke opened 2 months ago

romainmenke commented 2 months ago

What is the problem you're trying to solve?

see:

testRule and testRuleConfigs help people to write rule tests (as the name suggess :D ) but maintaining a good npm package with a Stylelint rule goes beyond writing rules.

For the PostCSS plugins we author under @csstools we found that we make the same mistakes over and over again and that we weren't following the PostCSS guidelines for plugins.

Things we often did wrong:


In Stylelint we also have guidelines and docs for writing rules and they contain similar aspects: https://github.com/stylelint/stylelint/blob/main/docs/developer-guide/plugins.md#peer-dependencies

What solution would you like to see?

Maybe we can create a getTestPackage function that contains tests for package.json?

This has two benefits:

Mouvedia commented 2 months ago
ybiquitous commented 2 months ago

@romainmenke Thanks for opening the request. Sounds great. ๐Ÿ‘๐Ÿผ

If the new check works, we should want to port it to stylelint-test-rule-node.

@Mouvedia Thanks for the additional suggestions. They sound good to me. We can include them or start with minimal checks for baby steps. ๐Ÿ‘๐Ÿผ

ybiquitous commented 2 months ago

I've labeled the issue as ready to implement. Please consider contributing if you have time.

If you still have any concerns about starting the work, feel free to comment. We can go back anytime. ๐Ÿ˜ƒ