apisyouwonthate / style-guide

A shared and somewhat opinionated style guide for everyone to enjoy.
141 stars 20 forks source link

How can i test a JS/TS ruleset, without publishing to npm ? #46

Closed dishatkr closed 9 months ago

dishatkr commented 10 months ago

[Newbie in spectral] I'm trying to built set of rules using JS/TS, followed a similar pattern in this project -> src/ruleset.ts How can i test the rules locally on my machine using spectral lint?

If I add the rules in yaml its easy to test using spectral lint, but for javascript ones, the doc says publish to npm. Has anyone tried using yalc, publish it locally and test ?

philsturgeon commented 9 months ago

Just run npm test without publishing to NPM. None of the docs tell you you have to publish to NPM just to see if it works.

Hopefully this article helps.

https://apisyouwonthate.com/blog/distribute-spectral-style-guides-with-npm/#publish-your-spectral-style-guide-to-npm