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

front: turn on @typescript-eslint/no-unsafe-call lint #8923

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions front/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@typescript-eslint/no-use-before-define": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-unsafe-return": "error",
"@typescript-eslint/no-unsafe-call": "error",

"@typescript-eslint/ban-types": [
"error",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export type FormContext = {
isCreation: boolean;
};

const IntervalEditorComponent = (props: FieldProps<GeoJsonProperties, RJSFSchema, FormContext>) => {
emersion marked this conversation as resolved.
Show resolved Hide resolved
const IntervalEditorComponent = (
props: FieldProps<LinearMetadataItem[], RJSFSchema, FormContext>
) => {
const { name, formContext, formData, schema, onChange, registry } = props;
const { openModal, closeModal } = useModal();
const { t } = useTranslation();
Expand Down Expand Up @@ -421,7 +423,7 @@ const IntervalEditorComponent = (props: FieldProps<GeoJsonProperties, RJSFSchema
);
};

export const FormComponent = (props: FieldProps<GeoJsonProperties, RJSFSchema, FormContext>) => {
export const FormComponent = (props: FieldProps<unknown, RJSFSchema, FormContext>) => {
emersion marked this conversation as resolved.
Show resolved Hide resolved
const { name, formContext, schema, registry } = props;
const Fields = getDefaultRegistry().fields;

Expand Down Expand Up @@ -471,10 +473,15 @@ export const FormComponent = (props: FieldProps<GeoJsonProperties, RJSFSchema, F
jsonSchema={jsonSchema}
distance={distance}
requiredFilter={requiredFilter}
{...props}
{...(props as FieldProps<LinearMetadataItem[], RJSFSchema, FormContext>)}
/>
);
return <Fields.ArrayField {...props} schema={jsonSchema} />;
return (
<Fields.ArrayField
{...(props as FieldProps<GeoJsonProperties, RJSFSchema, FormContext>)}
schema={jsonSchema}
/>
);
};

export default FormComponent;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as d3 from 'd3';
import { pointer } from 'd3-selection';
import { zoom as d3zoom } from 'd3-zoom';
import { zoom as d3zoom, type D3ZoomEvent } from 'd3-zoom';
import { mapValues } from 'lodash';

import {
Expand Down Expand Up @@ -282,8 +282,9 @@ export const enableInteractivity = <
])
.wheelDelta(wheelDelta)
// Allows evenements to be triggered on zoom and drag interactions for all graphs
.on('zoom', (event) => {
event.sourceEvent.preventDefault();
.on('zoom', (event: D3ZoomEvent<Element, ConsolidatedRouteAspect>) => {
const { sourceEvent }: { sourceEvent: Event } = event;
emersion marked this conversation as resolved.
Show resolved Hide resolved
sourceEvent.preventDefault();
const updatedAxis = updateChart(chart, keyValues, additionalValues, rotate, event);
// Overide axis with new ones from updated chart
const newChart = {
Expand Down Expand Up @@ -357,7 +358,7 @@ export const enableInteractivity = <
chart.svg
.on('mouseover', () => displayGuide(chart, 1))
.on('mousemove', mousemove)
.on('wheel', (event) => {
.on('wheel', (event: WheelEvent) => {
if (event.ctrlKey || event.shiftKey) {
event.preventDefault();
}
Expand Down
Loading