Prevent importing from @gitlab/ui/src
What does this MR do and why?
This change prevents code from importing directly from the @gitlab/ui source code.
The components should only be imported from /dist packages provided by @gitlab/ui.
Why?
Depending on the build process config (by webpack or vite) we may or may not duplicate code imported from either source, most of our code imports from dist/ and we should consistent in the imports.
I suspect most imports of src/* started by copying from other places, so an eslint rule will help folks import correctly moving forward.
References
- I found this while working on !196982 (merged).
- Gitlab UI can/should be consumed from source while we upgrade to Vue 3, however this should be done via bundling configuration (see #554202 (closed)) not arbitrarily in some of our code.
Screenshots or screen recordings
NA
How to set up and validate locally
Scroll down in the diff to see changes to eslint.config.mjs.
A green pipeline should be enough, you can also check the branch out and try the rule in your IDE.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #554202 (closed)