|
| 1 | +/* |
| 2 | + * Copyright Red Hat, Inc. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +const materialUiMigrationEslintConfig = { |
| 18 | + restrictedImports: [ |
| 19 | + { |
| 20 | + name: '@material-ui/core', |
| 21 | + message: 'Use @mui/material instead of Material UI v4.', |
| 22 | + }, |
| 23 | + { |
| 24 | + name: '@material-ui/lab', |
| 25 | + message: 'Use @mui/material instead of Material UI v4.', |
| 26 | + }, |
| 27 | + { |
| 28 | + name: '@material-ui/styles', |
| 29 | + message: |
| 30 | + 'Use @mui/styles, @mui/material (sx/styled), or Backstage UI instead of Material UI v4.', |
| 31 | + }, |
| 32 | + ], |
| 33 | + restrictedImportPatterns: ['@material-ui/*'], |
| 34 | +}; |
| 35 | + |
| 36 | +/** |
| 37 | + * Shared ESLint config for frontend packages in the scorecard workspace. |
| 38 | + */ |
| 39 | +module.exports = packageDir => |
| 40 | + require('@backstage/cli/config/eslint-factory')( |
| 41 | + packageDir, |
| 42 | + materialUiMigrationEslintConfig, |
| 43 | + ); |
0 commit comments