@notnedm/eslint-plugin-mui
v1.0.3
Published
Collection of custom built ESLint rules targeted towards `@mui/*` dependencies.
Readme
@notnedm/eslint-plugin-mui
Collection of custom built ESLint rules targeted towards @mui/* dependencies.
Installation
- Add the package dependency
npm install @notnedm/eslint-plugin-mui - Update your ESLint configuration file
// eslint.config.js
module.exports = {
files: ["**/*.{jsx,tsx}"],
plugins: ["@notnedm/mui"],
rules: {
"@notnedm/mui/enforce-icon-variant": "error", // e.g. Enforced Filled (default) icon variants
"@notnedm/mui/enforce-icon-variant": ["error", "Rounded"], // e.g. Enforced Rounded icon variants
},
};Contributing
Contributors are very welcome to raise PRs, the main requirement is that you add tests to demonstrate what your rule achieves.
Development
git clone https://github.com/notnedm/eslint-plugin-mui.gityarn
Building
yarn buildwill put files for deployment into./dist
Adding a new rule
- Add a new file in the
rulesdirectory following the naming pattern${ruleName}.jse.g.rules/enforce-icon-variant.js - Add an example configuration to
rules/README.md - Import the rule to
./index.js
Testing
To run tests use yarn test
When added tests, add the new test file in the tests directory following the naming pattern ${ruleName}.test.js e.g. tests/enforce-icon-variant.test.js.
This will ensure it gets handled correctly by the test runner in
tests/index.js
