Skip to content

Add getTestPackage to verify various attributes of packages #110

@romainmenke

Description

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:

  • name doesn't start with postcss-
  • postcss-plugin was missing from keywords
  • postcss was not a peer dependency

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:

  • it is easier for authors to be consistent
  • we can amend the guidelines and use this test as a way to communicate and promote the new guidelines

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions