packages/cli: add lint rule to avoid cross-package src imports

This commit is contained in:
Patrik Oldsberg
2020-06-15 13:59:52 +02:00
parent 8aee97383e
commit 972451b4f9
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -52,6 +52,8 @@ module.exports = {
'warn',
{ vars: 'all', args: 'after-used', ignoreRestSiblings: true },
],
// Avoid cross-package imports
'no-restricted-imports': [2, { patterns: ['**/../../**/*/src/**'] }],
},
overrides: [
{
+3 -2
View File
@@ -57,18 +57,19 @@ module.exports = {
'warn',
{ vars: 'all', args: 'after-used', ignoreRestSiblings: true },
],
// Importing the entire MUI icons packages kills build performance as the list of icons is huge.
'no-restricted-imports': [
2,
{
paths: [
{
// Importing the entire MUI icons packages kills build performance as the list of icons is huge.
name: '@material-ui/icons',
message: "Please import '@material-ui/icons/<Icon>' instead.",
},
...require('module').builtinModules,
],
// Avoid cross-package imports
patterns: ['**/../../**/*/src/**'],
},
],
},