Add eslint-plugin-material-ui
Open
Nobody has claimed this yet.
discussion
scope: all components
type: new feature
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Summary 💡
This issue is mostly here as an opportunity to evaluate the opposite to have a linter for Material UI, Base UI, Pigment CSS, etc. This linter would very likely be implemented with eslint.
Examples 🌈
- https://www.npmjs.com/package/eslint-plugin-react-hooks
- https://nextjs.org/docs/app/building-your-application/configuring/eslint#eslint-plugin
- https://baseweb.design/getting-started/setup/#eslint-plugin-baseui
- https://tailwindcss.com/blog/introducing-linting-for-tailwindcss-intellisense
Motivation 🔦
Ideas:
- When using the unitless API, error with all non-integer or half-integer usage:
sx: { p: 1.4, m: 1.6 } - Warn when using an invalid import path, e.g. breaking https://mui.com/material-ui/guides/minimizing-bundle-size/
styled(Box)should really bestyled('div')- Providing render functions to slots, this is wrong:
<TimePicker
defaultValue={time}
slots={{
textField: (props) => (
<TextField sx={{ width: 100 }} {...props} size='small' />
),
}}
/>
Explored with a warning in #14748 but has false-positive, false-negative.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the linked ESLint plugin examples and the warning explored in #14748. Decide which Material UI, Base UI, or Pigment CSS linting scope is in bounds, then define the selected rules and expected diagnostics; done should mean an agreed plugin direction with the chosen cases validated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- eslint, javascript, react
- Domain
- frontend, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100