-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create rule schema to support "allowComments" #87
Conversation
eslint v9 made schema mandatory for options supported by rules: https://eslint.org/docs/latest/extend/custom-rules#options-schemas Previously we didn't use the meta object on the rules so now we create the meta object and populate the `schema` property. Thanks to @BePo65 for providing context, docs and the schema itself.
@Standard8 and @BePo65 let me know if you have any thoughts on this PR. I plan to land it during the week and push a new major release next weekend. |
The pr looks good. Only test coverage for lines 58-62 and 150-154 is missing. So I am trying to add 1 or more tests for the Perhaps you could give me a hint, where in the |
I don't think there is an easy way. The unit tests appear to be testing only the processor, not from the rule level (i.e. they're not using However, I would note that the integration tests are covering comments, it just doesn't show up on the code coverage. |
So perhaps it would be the best solution to add rules test (with coverage) in a new pr. That would give me a little bit more time for this topic (at the moment I'm quite busy in my main project). But nevertheless I would like to get a deeper understanding of custom eslint rules anyway and testing the rule algorithm (with coverage) would be a good reason to do that. @azeemba is this an acceptable way you are willing to live with? |
Prepared a pr (extending this pr) that adds tests for the rules to the unit tests. These tests bring coverage back to 100%. Should we add this modification to this pr here or create a new pr (or simply drop the idea 😄 )? |
@BePo65 thanks for looking into it! A separate PR would be awesome. I will go ahead and merge this PR for now and prep a release. |
eslint v9 made schema mandatory for options supported by rules:
https://eslint.org/docs/latest/extend/custom-rules#options-schemas
Previously we didn't use the meta object on the rules so now we create the meta object and populate the
schema
property.Thanks to @BePo65 for providing context, docs and the schema itself.