-
-
Notifications
You must be signed in to change notification settings - Fork 665
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
Update rule define-macros-order
for custom macros
#2501
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
defineExpose
is declared inside theorder
, I guess it should be ignored? Otherwise it would conflict withdefineExposeLast
I guess.
Yeah, it would conflict. However, it's better to not fail silently, but to validate the options: If defineExposeLast
is true and defineExpose
is declared inside the order
, throw an error.
Anyway, thanks for picking this up so fast!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now. Thank you for your first contribution!
You're welcome! Really happy to add this 😁 |
Changing items accepted by the rule. Co-authored-by: Flo Edelmann <[email protected]>
Tests formatting Co-authored-by: Flo Edelmann <[email protected]>
It does not look for any "CallExpression" but for more specific contexts that target macros.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
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 specifydefinePage
for example or any macro wanted.Basically, I added a
CallExpression
that checks whether the Identifier is included into theorder
array but not in theORDER_SCHEMA
as this is already checked with earlier events (onDefineExposeExit
etc.)I removed the
enum
from theproperties
of the rule as it's no longer limited toORDER_SCHEMA
. And finally, I've added new tests.I also have some questions:
defineExpose
is declared inside theorder
, I guess it should be ignored? Otherwise it would conflict withdefineExposeLast
I guess.ORDER_SCHEMA
in the condition? (removing the callbacks and the call tohas()
).See #2499