Closed
Description
As documented here, you can create custom queries which extend the functionality of the basic query types. The rules of the eslint plugin should apply the same rules to these custom queries as they also apply.
I've identified the two lines that are the root cause of this issue:
- This line causes the
await-async-query
rule to be hard-coded to only specifically named queries and thus won't support any custom ones. - This line specifies the only libraries which are valid to import from. This prevents you to wrap testing-library and re-export it's functionality under a new name (as documented here).
I'm happy to submit a PR to fix this but I don't know how to best approach it.
- Should these restrictions be more laxed so that anything which matches the general pattern is included? This would be easier on the developer because there's less to configure and it "just works" but could have some false positives.
- Or should an additional configuration option be added to specify the names of imports and queries which should be added to the rule? This would be more flexible but require the developer to manually configure it whenever they add/change something.
I'm inclined to go with the first option as generally you want your tooling to be smart enough to just work. Any thoughts on this approach or any other recommended approaches?
Oh and let me know if this problem affects any other rules that I haven't run into.