Skip to content

Commit

Permalink
add inline rules
Browse files Browse the repository at this point in the history
  • Loading branch information
JCQuintas committed Jan 1, 2025
1 parent 4985964 commit cad51b6
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/src/modules/components/CustomizationPlayground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ function StylingApproachTabs({ value, onChange, options }: TabsProps) {
<StyledTabs
value={value}
onChange={onChange}
// eslint-disable-next-line material-ui/no-hardcoded-labels
aria-label="Customization option"
TabIndicatorProps={{ children: <span className="MuiTabs-indicatorSpan" /> }}
>
Expand Down Expand Up @@ -240,6 +241,7 @@ function ColorSwitcher({
}) {
return (
<React.Fragment>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<ConfigItemLabel>Color</ConfigItemLabel>
<StyledToggleButtonGroup
size="small"
Expand All @@ -250,6 +252,7 @@ function ColorSwitcher({
handleTokenChange('color', value);
}
}}
// eslint-disable-next-line material-ui/no-hardcoded-labels
aria-label="color palette"
>
{(Object.keys(DEFAULT_COLORS) as Array<ColorKey>).map((color) => (
Expand Down Expand Up @@ -354,6 +357,7 @@ const CustomizationPlayground = function CustomizationPlayground({
<BrandingProvider>
<PlaygroundConfigArea>
<ConfigSectionWrapper>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<ConfigLabel gutterBottom>Components</ConfigLabel>
<FormControl size="small" sx={{ backgroundColor: 'transparent', flexGrow: 1 }}>
<ComponentsSelect
Expand All @@ -371,6 +375,7 @@ const CustomizationPlayground = function CustomizationPlayground({
</FormControl>
{availableSlots && (
<React.Fragment>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<ConfigLabel gutterBottom>Slots</ConfigLabel>
<SlotItemsWrapper>
{(availableSlots as string[]).map((slot: string) => (
Expand All @@ -388,6 +393,7 @@ const CustomizationPlayground = function CustomizationPlayground({
)}
</ConfigSectionWrapper>
<ConfigSectionWrapper>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<ConfigLabel gutterBottom>Playground</ConfigLabel>
<Stack sx={{ gap: 0.5 }}>
<ColorSwitcher {...{ handleTokenChange, selectedColor: selectedTokens.color }} />
Expand Down
3 changes: 3 additions & 0 deletions docs/src/modules/components/DemoPropsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,12 @@ export default function ChartDemoPropsForm<T extends string>({
component="h3"
fontWeight="bold"
sx={{ scrollMarginTop: 160, fontFamily: 'General Sans' }}
// eslint-disable-next-line material-ui/no-hardcoded-labels
>
Playground
</Typography>
<IconButton
// eslint-disable-next-line material-ui/no-hardcoded-labels
aria-label="Reset all"
size="small"
onClick={() => onPropsChange(initialProps)}
Expand Down Expand Up @@ -427,6 +429,7 @@ export default function ChartDemoPropsForm<T extends string>({
if (knob === 'placement') {
return (
<FormControl key={propName}>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<FormLabel>Placement</FormLabel>
<RadioGroup
name="placement"
Expand Down
6 changes: 6 additions & 0 deletions docs/src/modules/components/PickersPlayground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ function TriBooleanGroupControl({
color="primary"
fullWidth
>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<ToggleButton value={''}>Undefined</ToggleButton>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<ToggleButton value>True</ToggleButton>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<ToggleButton value={false}>False</ToggleButton>
</ToggleButtonGroup>
}
Expand Down Expand Up @@ -270,6 +273,7 @@ function ViewSwitcher({

return (
<FormControl component="fieldset" variant="standard">
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<FormLabel id="views-label" component="legend">
Available views
</FormLabel>
Expand Down Expand Up @@ -544,6 +548,7 @@ export default function PickersPlayground() {
>
<ComponentSection sx={{ width: { xs: '100%', md: '60%' }, padding: { xs: 2, md: 4 } }}>
<FormControl fullWidth>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<InputLabel id="selected-component-family-label">Selected components</InputLabel>
<Select
labelId="selected-component-family-label"
Expand Down Expand Up @@ -657,6 +662,7 @@ export default function PickersPlayground() {
justifyContent: 'space-between',
alignItems: 'center',
}}
// eslint-disable-next-line material-ui/no-hardcoded-labels
>
Playground
</Typography>
Expand Down
4 changes: 4 additions & 0 deletions docs/src/modules/components/overview/CommunityOrPro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default function CommunityOrPro() {
sx={{ maxWidth: { xs: '500px', md: '100%' } }}
>
<Stack flexBasis={{ xs: '100%', md: '65%' }} sx={{ marginBottom: { xs: '16px', md: 0 } }}>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<Typography variant="body2" color="primary" fontWeight="semiBold">
Community and Pro
</Typography>
Expand All @@ -29,9 +30,11 @@ export default function CommunityOrPro() {
fontWeight="semiBold"
color="text.primary"
fontSize="1.625rem"
// eslint-disable-next-line material-ui/no-hardcoded-labels
>
Two packages for every need
</Typography>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<Typography variant="body1" color="text.secondary">
Start with the free-forever Community version, then upgrade to Pro when you are ready
for additional features and components.
Expand All @@ -43,6 +46,7 @@ export default function CommunityOrPro() {
href="/x/introduction/licensing/"
endIcon={<ArrowForwardIcon />}
sx={{ width: 'fit-content' }}
// eslint-disable-next-line material-ui/no-hardcoded-labels
>
About licensing
</Button>
Expand Down
3 changes: 3 additions & 0 deletions docs/src/modules/components/overview/DateLibraries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export default function DateLibraries() {
<SectionHeadline
overline="Date libraries"
title={
// eslint-disable-next-line material-ui/no-hardcoded-labels
<Typography variant="h2" fontSize="1.625rem">
Use your favorite date library
</Typography>
Expand All @@ -76,6 +77,7 @@ export default function DateLibraries() {
value={selectedLibrary}
onChange={handleLibrarySwitch}
size="small"
// eslint-disable-next-line material-ui/no-hardcoded-labels
aria-label="Select language"
exclusive
>
Expand All @@ -91,6 +93,7 @@ export default function DateLibraries() {
size="small"
href="/x/react-date-pickers/base-concepts/#date-library"
endIcon={<ArrowForwardIcon />}
// eslint-disable-next-line material-ui/no-hardcoded-labels
>
More info
</Button>
Expand Down
3 changes: 3 additions & 0 deletions docs/src/modules/components/overview/FeatureHighlight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default function FeatureHighlight() {
<Divider />
<Stack spacing={4} py={8} alignItems="center">
<Stack spacing={1} sx={{ maxWidth: { xs: '500px', md: '100%' } }}>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<Typography variant="body2" color="primary" fontWeight="semiBold" textAlign="center">
Using MUI X Date Pickers
</Typography>
Expand All @@ -43,9 +44,11 @@ export default function FeatureHighlight() {
fontWeight="semiBold"
color="text.primary"
textAlign="center"
// eslint-disable-next-line material-ui/no-hardcoded-labels
>
First-class developer experience
</Typography>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<Typography variant="body1" color="text.secondary" textAlign="center">
MUI X Date and Time Pickers are designed to be delightful and intuitive for developers
and users alike.
Expand Down
4 changes: 4 additions & 0 deletions docs/src/modules/components/overview/Internationalization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ function DemoWrapper({
})}
>
{ToolbarControls}
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<Button size="small" href={link} endIcon={<ArrowForwardIcon />}>
More info
</Button>
Expand Down Expand Up @@ -184,14 +185,17 @@ function Controls({
<Box sx={{ flexGrow: 1 }}>
<ToggleButtonGroup
size="small"
// eslint-disable-next-line material-ui/no-hardcoded-labels
aria-label="Select language"
value={selectedLanguage}
exclusive
onChange={handleLanguageSwitch}
>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<ToggleButton value="ro" key="ro">
Română
</ToggleButton>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<ToggleButton value="en" key="en">
English
</ToggleButton>
Expand Down
2 changes: 2 additions & 0 deletions docs/src/modules/components/overview/Keyboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ export default function Keyboard() {
<SectionHeadline
overline="Accessibility"
title={
// eslint-disable-next-line material-ui/no-hardcoded-labels
<Typography variant="h2" fontSize="1.625rem">
Assistive technology support
</Typography>
Expand All @@ -468,6 +469,7 @@ export default function Keyboard() {
href="/x/react-date-pickers/accessibility/"
endIcon={<ArrowForwardIcon />}
sx={{ width: 'fit-content' }}
// eslint-disable-next-line material-ui/no-hardcoded-labels
>
More info
</Button>
Expand Down
1 change: 1 addition & 0 deletions docs/src/modules/components/overview/XLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function XLogo() {
}),
]}
>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<IconImage width={28} height={28} loading="eager" name="product-advanced" /> MUI X
</Typography>
);
Expand Down
1 change: 1 addition & 0 deletions docs/src/modules/components/overview/mainDemo/Birthday.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default function Birthday() {
),
}}
/>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<Button variant="contained" fullWidth size="small">
Submit
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function CustomLayout(props: PickersLayoutProps<Dayjs | null, Dayjs, TimeView>)
export default function DigitalClock() {
return (
<Card variant="outlined" sx={{ padding: 0.8, height: 'fit-content' }}>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<Typography variant="subtitle2" sx={{ pt: 1, pb: 2 }}>
Book now!
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker';
export default function FlightPicker() {
return (
<Card variant="outlined" sx={{ flexGrow: 1, padding: 1 }}>
{/* eslint-disable-next-line material-ui/no-hardcoded-labels */}
<Typography variant="subtitle2" sx={{ pb: 2 }}>
Book your flight
</Typography>
Expand Down

0 comments on commit cad51b6

Please sign in to comment.