Fix lint factory & changeset
Signed-off-by: Philipp Hugenroth <philipph@spotify.com>
This commit is contained in:
@@ -20,5 +20,5 @@ To allow the future support of plugins & components using MUI v5 you want to upg
|
||||
```
|
||||
|
||||
**'@backstage/test-utils':** Test App Wrapper is using `UnifiedThemeProvider` for tests now.
|
||||
**'@backstage/plugin-techdocs-addons-test-utils':** Fix avoiding test to run on unmount.
|
||||
**'@backstage/plugin-techdocs-addons-test-utils':** Fix tests by avoiding re-running theme on cleanup.
|
||||
**'@backstage/cli':** Enforcing MUI v5 specific linting to minimize bundle size.
|
||||
|
||||
@@ -165,16 +165,17 @@ module.exports = require('@backstage/cli/config/eslint-factory')(__dirname, {
|
||||
|
||||
The configuration factory also provides utilities for extending the configuration in ways that are otherwise very cumbersome to do with plain ESLint, particularly for rules like `no-restricted-syntax`. These are the extra keys that are available:
|
||||
|
||||
| Key | Description |
|
||||
| ----------------------- | ------------------------------------------------------------------ |
|
||||
| `tsRules` | Additional rules to apply to TypeScript files |
|
||||
| `testRules` | Additional rules to apply to tests files |
|
||||
| `restrictedImports` | Additional paths to add to `no-restricted-imports` |
|
||||
| `restrictedSrcImports` | Additional paths to add to `no-restricted-imports` in src files |
|
||||
| `restrictedTestImports` | Additional paths to add to `no-restricted-imports` in test files |
|
||||
| `restrictedSyntax` | Additional patterns to add to `no-restricted-syntax` |
|
||||
| `restrictedSrcSyntax` | Additional patterns to add to `no-restricted-syntax` in src files |
|
||||
| `restrictedTestSyntax` | Additional patterns to add to `no-restricted-syntax` in test files |
|
||||
| Key | Description |
|
||||
| -------------------------- | ------------------------------------------------------------------ |
|
||||
| `tsRules` | Additional rules to apply to TypeScript files |
|
||||
| `testRules` | Additional rules to apply to tests files |
|
||||
| `restrictedImports` | Additional paths to add to `no-restricted-imports` |
|
||||
| `restrictedImportPatterns` | Additional patterns to add to `no-restricted-imports` |
|
||||
| `restrictedSrcImports` | Additional paths to add to `no-restricted-imports` in src files |
|
||||
| `restrictedTestImports` | Additional paths to add to `no-restricted-imports` in test files |
|
||||
| `restrictedSyntax` | Additional patterns to add to `no-restricted-syntax` |
|
||||
| `restrictedSrcSyntax` | Additional patterns to add to `no-restricted-syntax` in src files |
|
||||
| `restrictedTestSyntax` | Additional patterns to add to `no-restricted-syntax` in test files |
|
||||
|
||||
## Type Checking
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ function createConfig(dir, extraConfig = {}) {
|
||||
testRules,
|
||||
|
||||
restrictedImports,
|
||||
restrictedImportsPatterns,
|
||||
restrictedImportPatterns,
|
||||
restrictedSrcImports,
|
||||
restrictedTestImports,
|
||||
restrictedSyntax,
|
||||
@@ -116,7 +116,7 @@ function createConfig(dir, extraConfig = {}) {
|
||||
'*.test*',
|
||||
'**/__testUtils__/**',
|
||||
'**/__mocks__/**',
|
||||
...(restrictedImportsPatterns ?? []),
|
||||
...(restrictedImportPatterns ?? []),
|
||||
],
|
||||
},
|
||||
],
|
||||
@@ -220,7 +220,10 @@ function createConfigForRole(dir, role, extraConfig = {}) {
|
||||
...(extraConfig.restrictedImports ?? []),
|
||||
],
|
||||
// https://mui.com/material-ui/guides/minimizing-bundle-size/
|
||||
restrictedImportsPatterns: ['@mui/*/*/*'],
|
||||
restrictedImportPatterns: [
|
||||
'@mui/*/*/*',
|
||||
...(extraConfig.restrictedImportPatterns ?? []),
|
||||
],
|
||||
tsRules: {
|
||||
'react/prop-types': 0,
|
||||
...extraConfig.tsRules,
|
||||
|
||||
Reference in New Issue
Block a user