Skip to content

Commit

Permalink
even better
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Apr 19, 2024
1 parent bd3c0dd commit 7a8175d
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const path = require('path');
const { rules: baseStyleRules } = require('eslint-config-airbnb-base/rules/style');

const forbidTopLevelMessage = [
'Prefer one level nested imports to avoid bundling everything in dev mode',
const OneLevelImportMessage = [
'Prefer one level nested imports to avoid bundling everything in dev mode or breaking CJS/ESM split.',
'See https://github.com/mui/material-ui/pull/24147 for the kind of win it can unlock.',
].join('\n');
// This only applies to packages published from this monorepo.
Expand Down Expand Up @@ -66,12 +66,18 @@ module.exports = {
'error',
{
patterns: [
'@mui/*/*/*',
'@pigment-css/*/*/*',
'@base_ui/*/*/*',
// Allow any import depth with any internal packages
'!@mui/internal-*/**',
'!@mui/docs/**',
{
group: [
'@mui/*/*/*',
'@pigment-css/*/*/*',
'@base_ui/*/*/*',
// Allow any import depth with any internal packages
'!@mui/internal-*/**',
// TODO delete, @mui/docs should be @mui/internal-docs
'!@mui/docs/**',
],
message: OneLevelImportMessage,
},
],
},
],
Expand Down Expand Up @@ -419,11 +425,11 @@ module.exports = {
paths: [
{
name: '@mui/material',
message: forbidTopLevelMessage,
message: OneLevelImportMessage,
},
{
name: '@mui/lab',
message: forbidTopLevelMessage,
message: OneLevelImportMessage,
},
],
},
Expand Down

0 comments on commit 7a8175d

Please sign in to comment.