Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[code-infra] Replace or remove all instances of e identifier #14724

Merged
merged 11 commits into from
Oct 4, 2024
2 changes: 1 addition & 1 deletion docs/data/charts/bars/BorderRadius.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function BorderRadius() {
<Typography gutterBottom>Border Radius</Typography>
<Slider
value={radius}
onChange={(e, v) => setRadius(v)}
onChange={(event, value) => setRadius(value)}
valueLabelDisplay="auto"
min={0}
max={50}
Expand Down
2 changes: 1 addition & 1 deletion docs/data/charts/bars/BorderRadius.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function BorderRadius() {
<Typography gutterBottom>Border Radius</Typography>
<Slider
value={radius}
onChange={(e, v) => setRadius(v as number)}
onChange={(event, value) => setRadius(value as number)}
valueLabelDisplay="auto"
min={0}
max={50}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default function ServerSideErrorHandling() {
<DataGridPro
{...props}
unstable_dataSource={dataSource}
unstable_onDataSourceError={(e) => setError(e.message)}
unstable_onDataSourceError={(err) => setError(err.message)}
unstable_dataSourceCache={null}
apiRef={apiRef}
pagination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default function ServerSideErrorHandling() {
<DataGridPro
{...props}
unstable_dataSource={dataSource}
unstable_onDataSourceError={(e) => setError(e.message)}
unstable_onDataSourceError={(err) => setError(err.message)}
samuelsycamore marked this conversation as resolved.
Show resolved Hide resolved
unstable_dataSourceCache={null}
apiRef={apiRef}
pagination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ export default function ServerSideTreeDataErrorHandling() {
{...props}
treeData
unstable_dataSource={dataSource}
unstable_onDataSourceError={(e, params) => {
unstable_onDataSourceError={(error, params) => {
if (!params.groupKeys || params.groupKeys.length === 0) {
setRootError(e.message);
setRootError(error.message);
} else {
setChildrenError(
`${e.message} (Requested level: ${params.groupKeys.join(' > ')})`,
`${error.message} (Requested level: ${params.groupKeys.join(' > ')})`,
);
}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ export default function ServerSideTreeDataErrorHandling() {
{...props}
treeData
unstable_dataSource={dataSource}
unstable_onDataSourceError={(e, params) => {
unstable_onDataSourceError={(error, params) => {
if (!params.groupKeys || params.groupKeys.length === 0) {
setRootError(e.message);
setRootError(error.message);
} else {
setChildrenError(
`${e.message} (Requested level: ${params.groupKeys.join(' > ')})`,
`${error.message} (Requested level: ${params.groupKeys.join(' > ')})`,
);
}
}}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/CustomizationPlayground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const StyledTabs = styled(Tabs)(({ theme }) => ({

type TabsProps = {
value: string;
onChange: (e: React.SyntheticEvent, value: any) => void;
onChange: (event: React.SyntheticEvent, value: any) => void;
options: Partial<CustomizationLabelType>;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function TimezonesDemo() {
const brandingTheme = useTheme();
const theme = createTheme({ palette: { mode: brandingTheme.palette.mode } });

const handleContinentClick: ContinentClickHandler = (e, newTimezone) => {
const handleContinentClick: ContinentClickHandler = (event, newTimezone) => {
if (selectedTimezone === newTimezone) {
setSelectedTimezone(null);
} else {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/components/overview/Keyboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export default function Keyboard() {
const brandingTheme = useTheme();
const theme = createTheme({ palette: { mode: brandingTheme.palette.mode } });

const handleKeySelection = (e: React.SyntheticEvent, key: SelectedKey | null) => {
const handleKeySelection = (ev: React.SyntheticEvent, key: SelectedKey | null) => {
samuelsycamore marked this conversation as resolved.
Show resolved Hide resolved
const sectionContent = (ref.current as any).querySelector(
`.MuiPickersSectionList-section[data-sectionindex="${selectedSection.current || 0}"] .MuiPickersSectionList-sectionContent`,
);
Expand Down
12 changes: 6 additions & 6 deletions docs/src/modules/components/overview/WorldMapSvg.tsx

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/x-charts-pro/src/context/ZoomProvider/useSetupPan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ export const useSetupPan = () => {
};
};

const handleUp = (event: PointerEvent) => {
const handleUp = () => {
eventCacheRef.current.splice(
eventCacheRef.current.findIndex((e) => e.pointerId === event.pointerId),
eventCacheRef.current.findIndex((event) => event.pointerId),
samuelsycamore marked this conversation as resolved.
Show resolved Hide resolved
1,
);
setIsInteracting(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const useSetupZoom = () => {

function pointerUpHandler(event: PointerEvent) {
eventCacheRef.current.splice(
eventCacheRef.current.findIndex((e) => e.pointerId === event.pointerId),
eventCacheRef.current.findIndex((upEvent) => upEvent.pointerId),
samuelsycamore marked this conversation as resolved.
Show resolved Hide resolved
1,
);

Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/ChartsLegend/DefaultChartsLegend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function DefaultChartsLegend(props: LegendRendererProps) {
itemsToDisplay={seriesToDisplay}
onItemClick={
onItemClick
? (e, i) => onItemClick(e, seriesContextBuilder(seriesToDisplay[i]), i)
? (event, i) => onItemClick(event, seriesContextBuilder(seriesToDisplay[i]), i)
: undefined
}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/ChartsLegend/LegendPerItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export function LegendPerItem(props: LegendPerItemProps) {
markGap={markGap}
labelStyle={labelStyle}
classes={classes}
onClick={onItemClick ? (e) => onItemClick(e, i) : undefined}
onClick={onItemClick ? (event) => onItemClick(event, i) : undefined}
/>
))}
</ChartsLegendRoot>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function PiecewiseColorLegend(props: PiecewiseColorLegendProps) {
itemsToDisplay={itemsToDisplay}
onItemClick={
onItemClick
? (e, i) => onItemClick(e, piecewiseColorContextBuilder(itemsToDisplay[i]), i)
? (event, i) => onItemClick(event, piecewiseColorContextBuilder(itemsToDisplay[i]), i)
: undefined
}
/>
Expand Down
4 changes: 2 additions & 2 deletions packages/x-charts/src/hooks/useReducedMotion.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client';
import { useIsomorphicLayoutEffect, Globals } from '@react-spring/web';

const handleMediaChange = (e: { matches: boolean | undefined }) => {
const handleMediaChange = (event: { matches: boolean | undefined }) => {
Globals.assign({
// Modification such the react-spring implementation such that this hook can remove animation but never activate animation.
skipAnimation: e.matches || undefined,
skipAnimation: event.matches || undefined,
});
};

Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/src/internals/domUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export const getStringSize = (text: string | number, style: React.CSSProperties
}, 0);

return result;
} catch (e) {
} catch {
return { width: 0, height: 0 };
}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid-generator/src/hooks/useMockServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function decodeParams(url: string): GridGetRowsParams {
for (const [key, value] of array) {
try {
decodedParams[key] = JSON.parse(value);
} catch (e) {
} catch {
decodedParams[key] = value;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export const getAggregationFunctionLabel = ({
aggregationRule.aggregationFunctionName,
)}` as 'aggregationFunctionLabelSum',
);
} catch (e) {
} catch {
return aggregationRule.aggregationFunctionName;
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ export const useGridDataSource = (
apiRef.current.updateServerRows(getRowsResponse.rows, rowNode.path);
apiRef.current.setRowChildrenExpansion(id, true);
} catch (error) {
const e = error as Error;
apiRef.current.unstable_dataSource.setChildrenFetchError(id, e);
onError?.(e, fetchParams);
const err = error as Error;
apiRef.current.unstable_dataSource.setChildrenFetchError(id, err);
onError?.(err, fetchParams);
} finally {
apiRef.current.unstable_dataSource.setChildrenLoading(id, false);
nestedDataManager.setRequestSettled(id);
Expand Down
6 changes: 3 additions & 3 deletions packages/x-data-grid/src/components/cell/GridCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ const GridCell = React.forwardRef<HTMLDivElement, GridCellProps>(function GridCe
);
result.api = apiRef.current;
return result;
} catch (e) {
if (e instanceof MissingRowIdError) {
} catch (error) {
if (error instanceof MissingRowIdError) {
return EMPTY_CELL_PARAMS;
}
throw e;
throw error;
}
},
objectShallowCompare,
Expand Down
6 changes: 6 additions & 0 deletions packages/x-data-grid/src/utils/createSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export const createSelector = ((
b: Function,
c?: Function,
d?: Function,
// eslint-disable-next-line id-denylist
LukasTy marked this conversation as resolved.
Show resolved Hide resolved
e?: Function,
f?: Function,
...other: any[]
Expand All @@ -101,6 +102,7 @@ export const createSelector = ((

let selector: any;

// eslint-disable-next-line id-denylist
if (a && b && c && d && e && f) {
selector = (stateOrApiRef: any, instanceIdParam: any) => {
const isAPIRef = checkIsAPIRef(stateOrApiRef);
Expand All @@ -114,6 +116,7 @@ export const createSelector = ((
const ve = e(state, instanceId);
return f(va, vb, vc, vd, ve);
};
// eslint-disable-next-line id-denylist
} else if (a && b && c && d && e) {
selector = (stateOrApiRef: any, instanceIdParam: any) => {
const isAPIRef = checkIsAPIRef(stateOrApiRef);
Expand Down Expand Up @@ -173,6 +176,7 @@ export const createSelectorV8 = ((
b: Function,
c?: Function,
d?: Function,
// eslint-disable-next-line id-denylist
e?: Function,
f?: Function,
...other: any[]
Expand All @@ -183,6 +187,7 @@ export const createSelectorV8 = ((

let selector: any;

// eslint-disable-next-line id-denylist
if (a && b && c && d && e && f) {
selector = (stateOrApiRef: any, args: any, instanceIdParam: any) => {
const isAPIRef = checkIsAPIRef(stateOrApiRef);
Expand All @@ -196,6 +201,7 @@ export const createSelectorV8 = ((
const ve = e(state, args, instanceId);
return f(va, vb, vc, vd, ve, args);
};
// eslint-disable-next-line id-denylist
} else if (a && b && c && d && e) {
selector = (stateOrApiRef: any, args: any, instanceIdParam: any) => {
const isAPIRef = checkIsAPIRef(stateOrApiRef);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const formatTokenMap: FieldFormatTokenMap = {
ii: 'weekDay',
iii: { sectionType: 'weekDay', contentType: 'letter' },
iiii: { sectionType: 'weekDay', contentType: 'letter' },
// eslint-disable-next-line id-denylist
e: { sectionType: 'weekDay', contentType: 'digit', maxLength: 1 },
ee: 'weekDay',
eee: { sectionType: 'weekDay', contentType: 'letter' },
Expand Down
1 change: 1 addition & 0 deletions packages/x-date-pickers/src/AdapterMoment/AdapterMoment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const formatTokenMap: FieldFormatTokenMap = {

// Day of the week
E: { sectionType: 'weekDay', contentType: 'digit', maxLength: 1 },
// eslint-disable-next-line id-denylist
e: { sectionType: 'weekDay', contentType: 'digit', maxLength: 1 },
d: { sectionType: 'weekDay', contentType: 'digit', maxLength: 1 },
dd: { sectionType: 'weekDay', contentType: 'letter' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function innerGregorianDescribeAdapter<TDate extends PickerValidDate, TLocale>(
Adapter: new (...args: any) => MuiPickersAdapter<TDate>,
params: DescribeGregorianAdapterParams<TDate, TLocale>,
) {
const prepareAdapter = params.prepareAdapter ?? ((e) => e);
const prepareAdapter = params.prepareAdapter ?? ((event) => event);
samuelsycamore marked this conversation as resolved.
Show resolved Hide resolved

const adapter = new Adapter();
const adapterTZ = params.dateLibInstanceWithTimezoneSupport
Expand Down
Loading