Renamed based on feedback

Signed-off-by: Andre Wanlin <awanlin@spotify.com>
This commit is contained in:
Andre Wanlin
2023-12-22 06:56:15 -06:00
parent 995d2809b8
commit 37867e0c2c
10 changed files with 16 additions and 16 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
'@backstage/eslint-plugin': patch
---
Added new `@backstage/no-top-level-mui4-imports` rule that forbids top level imports from Material UI v4 packages
Added new `@backstage/no-top-level-material-ui-4-imports` rule that forbids top level imports from Material UI v4 packages
+1 -1
View File
@@ -56,7 +56,7 @@ For current known issues with the Material UI v5 migration, follow our [Mileston
To migrate your plugin to Material UI v5, you can build on the resources available.
1. Manually fix the imports from named to default imports to match the new [linting rules for minimizing bundle size](https://mui.com/material-ui/guides/minimizing-bundle-size). Note: you can use the [new `@backstage/no-top-level-mui4-imports` ESLint](https://github.com/backstage/backstage/blob/master/packages/eslint-plugin/docs/rules/no-top-level-mui4-imports.md) rule to help with this.
1. Manually fix the imports from named to default imports to match the new [linting rules for minimizing bundle size](https://mui.com/material-ui/guides/minimizing-bundle-size). Note: you can use the [new `@backstage/no-top-level-material-ui-4-imports` ESLint](https://github.com/backstage/backstage/blob/master/packages/eslint-plugin/docs/rules/no-top-level-material-ui-4-imports.md) rule to help with this.
2. Run the migration `codemod` for the path of the specific plugin: `npx @mui/codemod v5.0.0/preset-safe plugins/<path>`.
3. Take a look at possible `TODO:` items the `codemod` could not fix.
4. Remove types & methods from `@backstage/theme` which are marked as `@deprecated`.
+6 -6
View File
@@ -35,9 +35,9 @@ rules: {
The following rules are provided by this plugin:
| Rule | Description |
| --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [@backstage/no-forbidden-package-imports](./docs/rules/no-forbidden-package-imports.md) | Disallow internal monorepo imports from package subpaths that are not exported. |
| [@backstage/no-relative-monorepo-imports](./docs/rules/no-relative-monorepo-imports.md) | Forbid relative imports that reach outside of the package in a monorepo. |
| [@backstage/no-undeclared-imports](./docs/rules/no-undeclared-imports.md) | Forbid imports of external packages that have not been declared in the appropriate dependencies field in `package.json`. |
| [@backstage/no-top-level-mui4-imports](./docs/rules/no-top-level-mui4-imports.md) | Forbid top level import from Material UI v4 packages. |
| Rule | Description |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [@backstage/no-forbidden-package-imports](./docs/rules/no-forbidden-package-imports.md) | Disallow internal monorepo imports from package subpaths that are not exported. |
| [@backstage/no-relative-monorepo-imports](./docs/rules/no-relative-monorepo-imports.md) | Forbid relative imports that reach outside of the package in a monorepo. |
| [@backstage/no-undeclared-imports](./docs/rules/no-undeclared-imports.md) | Forbid imports of external packages that have not been declared in the appropriate dependencies field in `package.json`. |
| [@backstage/no-top-level-material-ui-4-imports](./docs/rules/no-top-level-material-ui-4-imports.md) | Forbid top level import from Material UI v4 packages. |
@@ -1,4 +1,4 @@
# @backstage/no-top-level-mui4-imports
# @backstage/no-top-level-material-ui-4-imports
Forbid top level import from Material UI v4 packages.
@@ -7,7 +7,7 @@ Forbid top level import from Material UI v4 packages.
Add the rules as follows, it has no options:
```js
"@backstage/no-top-level-mui4-imports": ["error"]
"@backstage/no-top-level-material-ui-4-imports": ["error"]
```
## Rule Details
+1 -1
View File
@@ -29,6 +29,6 @@ module.exports = {
'no-forbidden-package-imports': require('./rules/no-forbidden-package-imports'),
'no-relative-monorepo-imports': require('./rules/no-relative-monorepo-imports'),
'no-undeclared-imports': require('./rules/no-undeclared-imports'),
'no-top-level-mui4-imports': require('./rules/no-top-level-mui4-imports'),
'no-top-level-material-ui-4-imports': require('./rules/no-top-level-material-ui-4-imports'),
},
};
@@ -37,7 +37,7 @@ module.exports = {
},
docs: {
description: 'Forbid top level import from Material UI v4 packages.',
url: 'https://github.com/backstage/backstage/blob/master/packages/eslint-plugin/docs/rules/no-top-level-mui4-imports.md',
url: 'https://github.com/backstage/backstage/blob/master/packages/eslint-plugin/docs/rules/no-top-level-material-ui-4-imports.md',
},
},
create: context => ({
@@ -15,7 +15,7 @@
*/
import { RuleTester } from 'eslint';
import rule from '../rules/no-top-level-mui4-imports';
import rule from '../rules/no-top-level-material-ui-4-imports';
const ruleTester = new RuleTester({
parserOptions: {
+1 -1
View File
@@ -1,5 +1,5 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname, {
rules: {
'@backstage/no-top-level-mui4-imports': 'error',
'@backstage/no-top-level-material-ui-4-imports': 'error',
},
});
+1 -1
View File
@@ -1,5 +1,5 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname, {
rules: {
'@backstage/no-top-level-mui4-imports': 'error',
'@backstage/no-top-level-material-ui-4-imports': 'error',
},
});
+1 -1
View File
@@ -1,5 +1,5 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname, {
rules: {
'@backstage/no-top-level-mui4-imports': 'error',
'@backstage/no-top-level-material-ui-4-imports': 'error',
},
});