-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[code-infra] Replace all instances of e
with event
and add eslint rule
#43866
Conversation
Netlify deploy previewhttps://deploy-preview-43866--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
e
with event
e
with event
In #41968 I proposed to use the |
Oh cool! I missed that conversation. I'll add that here then. |
e
with event
e
with event
e
with event
e
with event
and add eslint rule
cc @LukasTy Just a heads up, this will generate new lint errors on X |
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, I would suggest, before merging this, to do the same exercise on the X repo. To avoid monorepo upgrade in X being blocked on code changes.
Did it for toolpad here
I love to see this 👍 |
what about specifically targeting function/trycatch parameters? In 'no-restricted-syntax': [
'error',
{
selector: 'FunctionDeclaration > Identifier[name="e"]',
message: 'Don\'t use "e" as an identifier, it\'s too easy to confuse with "c" or "o".',
},
{
selector: 'ArrowFunctionExpression > Identifier[name="e"]',
message: 'Don\'t use "e" as an identifier, it\'s too easy to confuse with "c" or "o".',
},
{
selector: 'CatchClause > Identifier[name="e"]',
message: 'Don\'t use "e" as an identifier, it\'s too easy to confuse with "c" or "o".',
},
], |
Some drawbacks of that approach is that
Personally, If we have to add one or two ignore comments, I wouldn't bother complicating it too much. If it's more systemic, then it makes sense to me. |
We can use regex and selectors to make it more generic. I just went with easy ones. |
@JCQuintas I propose we merge this as-is now, and if/when the ignore comments become cumbersome then we should consider implementing the |
That works for me |
From the DevEx task backlog: https://www.notion.so/mui-org/core-Replace-all-references-of-event-as-e-event-bc82f57fbe8f4bfea10cc2fcebaee8c5