Skip to content

Commit

Permalink
[core] Restrict import path with ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Apr 19, 2024
1 parent 8dfd253 commit bd3c0dd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
26 changes: 8 additions & 18 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ module.exports = {
'no-restricted-imports': [
'error',
{
patterns: ['@mui/*/*/*'],
patterns: [
'@mui/*/*/*',
'@pigment-css/*/*/*',
'@base_ui/*/*/*',
// Allow any import depth with any internal packages
'!@mui/internal-*/**',
'!@mui/docs/**',
],
},
],
'no-continue': 'off',
Expand Down Expand Up @@ -331,23 +338,6 @@ module.exports = {
'import/export': 'off', // Not sure why it doesn't work
},
},
{
files: ['*.tsx'],
excludedFiles: '*.spec.tsx',
rules: {
// WARNING: If updated, make sure these rules are merged with `no-restricted-imports` (#ts-source-files)
'no-restricted-imports': [
'error',
{
patterns: [
// Allow deeper imports for TypeScript types. TODO remove
'@mui/*/*/*/*',
],
},
],
},
},
// Files used for generating TypeScript declaration files (#ts-source-files)
{
files: ['packages/*/src/**/*.tsx'],
excludedFiles: '*.spec.tsx',
Expand Down
2 changes: 1 addition & 1 deletion apps/pigment-css-vite-app/src/Slider/ZeroSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { isHostComponent, useSlotProps } from '@mui/base/utils';
import { styled } from '@pigment-css/react';
import { capitalize } from '@mui/material/utils';
import SliderValueLabel from '@mui/material/Slider/SliderValueLabel';
import { SliderValueLabel } from '@mui/material/Slider';
import { useSlider, valueToPercent } from '@mui/base/useSlider';
import { alpha, lighten, darken } from '@mui/system/colorManipulator';
import type { Theme } from '@mui/material/styles';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Slide from '@mui/material/Slide';
import CloseIcon from '@mui/icons-material/Close';
import InfoIcon from '@mui/icons-material/Info';
import IconButton from '@mui/material/IconButton';
import { TransitionProps } from '@mui/material/transitions/transition';
import { TransitionProps } from '@mui/material/transitions';

const styles = ({ theme }: { theme: Theme }) =>
({
Expand Down

0 comments on commit bd3c0dd

Please sign in to comment.