Skip to content

[code-infra] Add plugin to check for index file access #46178

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

Merged
merged 6 commits into from
May 29, 2025
Merged

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented May 19, 2025

Guard against #46177
Created a custom plugin that works similar to the no-unresolved-imports, but that looks at the resolved specifier.

@Janpot Janpot added the scope: code-infra Specific to the core-infra product label May 19, 2025
@mui-bot
Copy link

mui-bot commented May 19, 2025

Netlify deploy preview

https://deploy-preview-46178--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 6e4b6f4

@Janpot Janpot marked this pull request as ready for review May 28, 2025 09:56
@Janpot Janpot requested a review from a team May 28, 2025 09:56
@JCQuintas
Copy link
Member

Haven't reviewed the code yet, but should this be in public? We might benefit from it in X as well

@Janpot
Copy link
Member Author

Janpot commented May 28, 2025

We will move all eslint config into mui-public eventually. I didn't create a full plugin, just added a rule to the existing material ui plugin. you'll be able to use this in X.

@JCQuintas
Copy link
Member

just added a rule to the existing material ui plugin.

Derp, I missed that totally 😆

Copy link
Member

@JCQuintas JCQuintas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one comment

Comment on lines 66 to 70
const regexPattern = new RegExp(
pattern
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') // Escape special regex chars except *
.replace(/\*/g, '.*'), // Convert * to .* for wildcard matching
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit sketchy, don't we have a glob util we can use?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eslint uses minimatch, I'll do the same

@Janpot Janpot enabled auto-merge (squash) May 29, 2025 07:59
@Janpot Janpot disabled auto-merge May 29, 2025 08:02
@Janpot Janpot merged commit 25131d6 into mui:master May 29, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Specific to the core-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants