Feature/use second level mui imports (#743)
* Require "Theme" to be passed to "SxProps" Decreases typescript performance otherwise * Disallow "top" and "third-level" MUI imports * Exclude "node_modules" in tsconfig
This commit is contained in:
31
.eslintrc.js
31
.eslintrc.js
@@ -1,6 +1,13 @@
|
||||
module.exports = {
|
||||
extends: ['airbnb', 'airbnb-typescript', 'prettier'],
|
||||
plugins: ['unused-imports', 'eslint-plugin-import', '@typescript-eslint', 'no-relative-import-paths', 'prettier', 'header'],
|
||||
plugins: [
|
||||
'unused-imports',
|
||||
'eslint-plugin-import',
|
||||
'@typescript-eslint',
|
||||
'no-relative-import-paths',
|
||||
'prettier',
|
||||
'header',
|
||||
],
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json', './tsconfig.node.json', './tools/scripts/tsconfig.json'],
|
||||
},
|
||||
@@ -61,6 +68,28 @@ module.exports = {
|
||||
prefix: '@',
|
||||
},
|
||||
],
|
||||
|
||||
'no-restricted-imports': [
|
||||
'error',
|
||||
{
|
||||
patterns: [
|
||||
{
|
||||
group: ['@mui/*', '!@mui/material/', '!@mui/icons-material/', '!@mui/x-date-pickers/'],
|
||||
},
|
||||
{
|
||||
group: ['@mui/*/*/*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
'no-restricted-syntax': [
|
||||
'error',
|
||||
{
|
||||
selector: 'TSTypeReference[typeName.name="SxProps"]:not([typeParameters])',
|
||||
message: 'SxProps must have Theme parameter to avoid significant compiler slowdown.',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user