Update rule `define-macros-order` for custom macros
⚠️ Newbie alert ⚠️ This is my very first contribution to this project so I hope I did the things well; but don't hesitate to tell me what is not right. 😄
This PR adds the ability to use the define macro order rule for any macro specified in the order array. This allows users to specify definePage for example or any macro wanted.
Basically, I added a CallExpression that checks whether the Identifier is included into the order array but not in the ORDER_SCHEMA as this is already checked with earlier events (onDefineExposeExit etc.)
I removed the enum from the properties of the rule as it's no longer limited to ORDER_SCHEMA. And finally, I've added new tests.
I also have some questions:
- If
defineExposeis declared inside theorder, I guess it should be ignored? Otherwise it would conflict withdefineExposeLastI guess. - Maybe the check could be more performant if there was no check against
ORDER_SCHEMAin the condition? (removing the callbacks and the call tohas()).
See #2499
You're welcome! Really happy to add this 😁