Skip to content
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 eslint rules to prohibit importing from the root of @mui/material #613

Open
daileytj opened this issue Dec 19, 2022 · 1 comment
Open
Assignees
Labels
brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering enhancement Request for improvement or new feature good first issue A good issue for first-time contributors

Comments

@daileytj
Copy link
Contributor

Describe the desired behavior

Add ESLint rules to prohibit importing from the root of @mui/material (using deep imports instead) to keep the bundle size down

Describe the current behavior

There is no rule in place

Is this request related to a current issue?

Additional Context

@joebochill can help with the structure for this

@daileytj daileytj added enhancement Request for improvement or new feature needs-review Issues that we would like to revisit/review labels Dec 19, 2022
@joebochill
Copy link
Collaborator

// .eslintrc.json
    "rules": {
        // MUI import restrictions
        // https://mui.com/material-ui/guides/minimizing-bundle-size/#option-one-use-path-imports
        "@typescript-eslint/no-restricted-imports": [
            "error",
            {
                "paths": [
                    {
                        "name": "@mui/material",
                        "message": "Import [module] from @mui/material/[module] instead"
                    }
                ]
            }
        ]
    },

@joebochill joebochill added the brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering label Jan 5, 2023
@joebochill joebochill removed the needs-review Issues that we would like to revisit/review label Jan 26, 2023
@joebochill joebochill added the good first issue A good issue for first-time contributors label May 23, 2023
@yazadsidhwa-eaton yazadsidhwa-eaton self-assigned this May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering enhancement Request for improvement or new feature good first issue A good issue for first-time contributors
Development

No branches or pull requests

3 participants