mdn / short-descriptions

Short descriptions of web platform features, for flexible usage in applications.
Other
12 stars 6 forks source link

Lint short description text #4

Closed ddbeck closed 5 years ago

ddbeck commented 5 years ago

This adds some JS to check short descriptions against our writing guidelines https://github.com/mdn/short-descriptions/blob/master/writing-short-descriptions.md#writing-short-descriptions.

A few notes to help you review this:

Let me know if you've got any questions. Thanks, @wbamberg!

ddbeck commented 5 years ago

[insert discussion on wiki-fixable/source-fixable stuff] Does that make sense?

Yes, it does! I think maybe the right thing here is to leave checks here and remove them when we have an import script that deals with that particular issue.

I'd say in general, use the AirBnb style guide.

I've fixed the semicolons. I tried eslint with the Airbnb style and there are a few issues. Rather than overloading this review, I'll start a separate PR (after this one) to add a linter and clean up the issues it raises.

I'm hand-waving here, but perhaps you could consider having a standard form of "test function"

I sorta started this here. There's now a common function signature for the checks, but it's a little awkward to put the list of checks at the top of the file—JavaScript doesn't like references to undefined functions defined with const. Anyway, there's now a more concise list of checks just before they're invoked, so I think it helps a little. Let me know if you have any more ideas about this.

ddbeck commented 5 years ago

Hi @wbamberg, if you could take a look at this some time this week, I think we can wrap it up before the end of the sprint