-
Notifications
You must be signed in to change notification settings - Fork 17
U - Write a linter ingredient handler for class and namespace members #348
Comments
I've been thinking a bit about this today and it raises a question. So far the linter only lints mandatory ingredients, so the ingredient must (1) exist and (2) be well-formed to pass, and there isn't really a separation between these questions. But for optional ingredients: they don't have to exist, but if they do, they must be well-formed. So the linter has to ask, first, does this page try to include static methods (say) or an interactive example? If it doesn't, move on, but if it does, check it's valid. A question here is: is it likely that a given ingredient will be mandatory in one recipe but optional in another? If the answer is no (which I think it is) we could push this problem into the ingredient handlers. So, say, the Then It might still be worth logging missing optional ingredients, to help us catch false negatives. |
I also believe the answer is no. It looks like we have
I think this makes sense. |
Yeah, that sounds reasonable to me. If we wanted to support optional and required ingredients with the same handler, we could have the plugin pass an argument to the handler. |
The linter should validate the following ingredients:
I think it should be practical to do these all together, since they are very similar.
Acceptance criteria
The linter checks that 'javascript-class' and 'javascript-namespace' pages contain the correct structures for these ingredients, according to the specification agreed in mdn/sprints#3075.
The text was updated successfully, but these errors were encountered: