feat: add eslint rule for top level imports

Signed-off-by: Timothy Deakin <cftad@protonmail.com>
This commit is contained in:
Timothy Deakin
2024-04-13 20:22:53 +01:00
parent 9178bf5fad
commit cfb2b788bc
3 changed files with 13 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-org-react': patch
---
Added the `no-top-level-material-ui-4-imports` ESLint rule to aid with the migration to Material UI v5
+5 -1
View File
@@ -1 +1,5 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname);
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname, {
rules: {
'@backstage/no-top-level-material-ui-4-imports': 'error',
},
});
@@ -15,7 +15,9 @@
*/
import React from 'react';
import { makeStyles, Typography, Button } from '@material-ui/core';
import Typography from '@material-ui/core/Typography';
import Button from '@material-ui/core/Button';
import { makeStyles } from '@material-ui/core/styles';
import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';
import PeopleIcon from '@material-ui/icons/People';