Closed ddbeck closed 5 years ago
I didn't find the naming of
sourceRules
intuitive.jsonFormatRules
, maybe?
Yep, that's a good idea.
since
contentRules
andsourceRules
don't seem to share much code, and given that "lint-short-descriptions" only usescontentRules
, consider splitting "linting-rules" into two files?
Yeah that makes sense. Or maybe just move sourceRules
(future jsonFormatRules
) to lint-json.js
. I'll play with this a little.
I found the
wiki
attribute incontentRules
a bit weird. That is, I think of it as the choice of the application (i.e. "lint-short-descriptions") which rules it wants to use. So encoding that in the rules themselves seems like the wrong place. Instead perhaps "lint-short-descriptions" could contain an array containing the descriptions of the rules it wants to use?
Also a good idea. I'll give each rule a short identifier (like eslint rules) on which to filter.
also naming, but "lint-short-descriptions" is a bit confusing now that "lint-json" is also linting short descriptions. Perhaps "lint-wiki-summaries" or something?
👍
To do list:
sourceRules
to jsonFormatRules
lint-short-descriptions
to lint-wiki
wiki
rule property; add rule identifiersjsonFormatRules
and contentRules
OK, fixes applied. I also changed package.json
such that npm test
will:
This PR mostly fixes #10. It adds
npm run lint-json
. It gives output like this (though in your terminal you'll get some highlighting):Additional notes:
lint-json
andlint-short-descriptions
into/test/linting-rules.js
. This is probably slightly easier to follow if you step through the two commits in this PR.node ./test/linting-rules.js
.Let me know what you think! Thanks!