⚠️ 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 defineExpose is declared inside the order, I guess it should be ignored? Otherwise it would conflict with defineExposeLast I guess.
Maybe the check could be more performant if there was no check against ORDER_SCHEMA in the condition? (removing the callbacks and the call to has()).
⚠️ 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 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 theenum
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