Skip to content
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
859 changes: 320 additions & 539 deletions front/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
},
"devDependencies": {
"@apidevtools/swagger-parser": "^12.1.0",
"@eslint/js": "^8.57.1",
"@eslint/js": "^9.37.0",
"@playwright/test": "^1.56.1",
"@rtk-query/codegen-openapi": "^2.1.0",
"@tailwindcss/postcss": "^4.1.16",
Expand All @@ -115,7 +115,7 @@
"@vitejs/plugin-react-swc": "^4.2.0",
"@vitest/eslint-plugin": "^1.4.0",
"ansi-to-html": "^0.7.2",
"eslint": "^8.56.0",
"eslint": "^9.37.0",
"eslint-config-prettier": "^10.1.5",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.31.0",
Expand Down
2 changes: 0 additions & 2 deletions front/scripts/i18n-checker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable no-console */

import { readFile } from 'node:fs/promises';
import path from 'node:path';

Expand Down
1 change: 0 additions & 1 deletion front/src/applications/editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ const Editor = () => {
return () => {
if (toolAndState.tool.onUnmount) toolAndState.tool.onUnmount(extendedContext);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [toolAndState.tool]);

/**
Expand Down
2 changes: 1 addition & 1 deletion front/src/applications/editor/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ const MapUnplugged = ({
// instead. This fixes it:
entity = {
...entity,
// eslint-disable-next-line no-underscore-dangle,@typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
geometry: entity.geometry || (entity as any)._geometry,
};
activeTool.onClickEntity(entity, eventWithFeature, extendedContext);
Expand Down
1 change: 0 additions & 1 deletion front/src/applications/editor/tools/consts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/prefer-default-export */
import type { CommonToolState } from './types';

export const DEFAULT_COMMON_TOOL_STATE: CommonToolState = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { getEditorState } from 'reducers/editor/selectors';
import { NULL_GEOMETRY } from 'types';

type BasePointEditionLayersProps = {
// eslint-disable-next-line react/no-unused-prop-types
map: Map;
mergeEntityWithNearestPoint?: (
entity: EditorEntity,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// eslint-disable-next-line import/prefer-default-export
export const POINT_LAYER_ID = 'pointEditionTool/new-entity';
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ function getPointEditionTool<T extends EditorPoint>({
typeof computedPosition === 'number' &&
Math.abs(dbPosition - computedPosition) >= 1
) {
// eslint-disable-next-line no-console
console.warn(
`
The entity ${entity.properties.id} position computed by Turf.js does not match the one from the database:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// eslint-disable-next-line import/prefer-default-export
export { default as RangeEditionLeftPanel } from './RangeEditionLeftPanel';
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// eslint-disable-next-line import/prefer-default-export
export const APPLICABLE_DIRECTIONS = ['BOTH', 'START_TO_STOP', 'STOP_TO_START'] as const;
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ const WayPointInput = ({ endPoint, wayPoint, onChange }: WayPointInputProps) =>
onChange(null);
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [wayPoint]);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ const TrackEditionTool: Tool<TrackEditionState> = {
}

if (candidates.length === 1) {
// eslint-disable-next-line prefer-destructuring
newState.nearestPoint = candidates[0];
} else if (candidates.length > 1) {
newState.nearestPoint = getNearestPoint(e.lngLat.toArray(), featureCollection(candidates));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ const TrackSplitLeftPanel = () => {
submit(state);
}}
>
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
<label className="font-weight-medium" htmlFor="offset">
{t('Editor.tools.track-split.offset.label')}
</label>
Expand Down
1 change: 0 additions & 1 deletion front/src/applications/editor/tools/trackSplit/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { isNumber } from 'lodash';

import type { TrackSectionEntity } from 'applications/editor/tools/trackEdition/types';

// eslint-disable-next-line import/prefer-default-export
export function isOffsetValid(offset: unknown, track: TrackSectionEntity): boolean {
const trackLength = track.properties.length;
return isNumber(offset) && offset > 0 && offset / 1000 < trackLength;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export default function FilterTextField({ id, setFilter, sm = false, filterChips

useEffect(() => {
setFilter(debouncedFilter);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [debouncedFilter]);

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/prefer-default-export */
import type { TFunction } from 'i18next';

import type { PathfindingResultSuccess, TrainSchedule } from 'common/api/osrdEditoastApi';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */
import { useEffect, useMemo } from 'react';

import { skipToken } from '@reduxjs/toolkit/query';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable import/prefer-default-export */

import { v4 as uuidV4 } from 'uuid';

import type { GraouTrainSchedule } from 'common/api/graouApi';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/prefer-default-export */
import type { MapPathProperties } from 'applications/operationalStudies/types';
import { insertViaFromMap } from 'reducers/osrdconf/helpers';
import type { PathStep } from 'reducers/osrdconf/types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/* eslint-disable no-restricted-exports */
export { default } from './PacedTrainSettings';
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const cutRange = (
];
}

// eslint-disable-next-line no-plusplus
for (let i = 0; i < allRanges.length; i++) {
// if the cut position is smaller than the current range begin, we insert new ranges before the current one
if (allRanges[i].begin < newCutPosition && newCutPosition < allRanges[i].end) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// eslint-disable-next-line import/prefer-default-export
export const MAX_TIMEWINDOW_MINUTES = 43800; // 1 month
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useEffect, useRef, useState } from 'react';

/* eslint-disable import/extensions, import/no-unresolved */
/* eslint-disable import/extensions */
import ngeMain from '@osrd-project/netzgrafik-frontend/dist/netzgrafik-frontend/main.js?url';
import ngePolyfills from '@osrd-project/netzgrafik-frontend/dist/netzgrafik-frontend/polyfills.js?url';
import ngeRuntime from '@osrd-project/netzgrafik-frontend/dist/netzgrafik-frontend/runtime.js?url';
import ngeStyles from '@osrd-project/netzgrafik-frontend/dist/netzgrafik-frontend/styles.css?url';
import ngeVendor from '@osrd-project/netzgrafik-frontend/dist/netzgrafik-frontend/vendor.js?url';
/* eslint-enable import/extensions, import/no-unresolved */
/* eslint-enable import/extensions */
import { useTranslation } from 'react-i18next';

import { EMPTY_DTO } from './consts';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable import/prefer-default-export */

import type { NetzgrafikDto } from './types';

export const EMPTY_DTO: NetzgrafikDto = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-nested-ternary */
import { useRef, useState } from 'react';

import cx from 'classnames';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/prefer-default-export
export const MANAGE_TIMETABLE_ITEM_TYPES = Object.freeze({
none: 'NONE',
add: 'ADD',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const SectionContentManager = ({ content }: SectionContentManagerProps) => (
);

case 'text':
// eslint-disable-next-line react/no-danger
return <p dangerouslySetInnerHTML={{ __html: content.value }} />;
case 'faq':
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,11 @@ const StcdmResultsTable = ({
step.duration !== null && !isLastStep ? 'stop-with-duration ml-n2' : 'stop'
}
>
{
// eslint-disable-next-line no-nested-ternary
isNotExtremity || !isRequestedPathStep
? step.duration !== null
? getStopDurationTime(step.duration)
: step.time
: ''
}
{isNotExtremity || !isRequestedPathStep
? step.duration !== null
? getStopDurationTime(step.duration)
: step.time
: ''}
</div>
</td>
<td className="stop">
Expand Down
1 change: 0 additions & 1 deletion front/src/common/BootstrapSNCF/InputGroupSNCF.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export default function InputGroupSNCF<U extends string | MultiUnit>({
</div>
</div>
{isDropdownShown && (
// eslint-disable-next-line jsx-a11y/control-has-associated-label
<div
style={{
position: 'fixed',
Expand Down
1 change: 0 additions & 1 deletion front/src/common/Map/BaseMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ const BaseMap = ({
pitch: parseFloat(urlPitch),
});
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable react/jsx-pascal-case */
import type { Geometry } from 'geojson';
import type { TFunction } from 'i18next';
import { isNil } from 'lodash';
Expand Down
1 change: 0 additions & 1 deletion front/src/common/Map/Search/consts.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// eslint-disable-next-line import/prefer-default-export
export const MAIN_OP_CH_CODES = ['', '00', 'BV'];
1 change: 0 additions & 1 deletion front/src/common/Map/WarpedMap/DataLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ const DataLoader = ({ bbox, getGeoJSONs, layers }: DataLoaderProps) => {
m
.querySourceFeatures('osm', { sourceLayer })
.map((f) => simplifyFeature(f, sourceLayer)),
// eslint-disable-next-line no-plusplus
(f) => (f.id ? `osm-${f.id}` : `generated-${++incrementalID}`) // only deduplicate features with IDs
)
),
Expand Down
1 change: 0 additions & 1 deletion front/src/common/Map/WarpedMap/core/grids.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable prefer-destructuring, no-plusplus */
import bearing from '@turf/bearing';
import center from '@turf/center';
import destination from '@turf/destination';
Expand Down
2 changes: 0 additions & 2 deletions front/src/common/Map/WarpedMap/core/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable prefer-destructuring, no-plusplus */
import along from '@turf/along';
import distance from '@turf/distance';
import { point } from '@turf/helpers';
Expand Down Expand Up @@ -182,7 +181,6 @@ export function simplifyFeature(feature: GeoJSONFeature, sourceLayer?: string):
type: 'Feature',
id: feature.id,
properties: { ...feature.properties, sourceLayer },
// eslint-disable-next-line no-underscore-dangle
geometry: feature.geometry || feature._geometry,
};
}
Expand Down
1 change: 0 additions & 1 deletion front/src/common/Map/WarpedMap/core/projection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable prefer-destructuring, no-plusplus */
import type { Feature, FeatureCollection, Geometry, Position } from 'geojson';
import { keyBy } from 'lodash';

Expand Down
1 change: 0 additions & 1 deletion front/src/common/Map/WarpedMap/core/quadtree.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable prefer-destructuring, no-plusplus */
import bbox from '@turf/bbox';
import type { Feature, FeatureCollection, GeoJsonProperties, Geometry, Position } from 'geojson';

Expand Down
1 change: 0 additions & 1 deletion front/src/common/Notifications/Notifications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const NotificationWrapper = (notif: Notification) => {
return () => {
clearTimer();
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

return (
Expand Down
1 change: 0 additions & 1 deletion front/src/common/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/prefer-default-export
export const DATA_TYPES = {
string: 'STRING',
date: 'DATE',
Expand Down
1 change: 0 additions & 1 deletion front/src/main/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ export default function App() {
const dispatch = useAppDispatch();

useEffect(() => {
// eslint-disable-next-line react-hooks/exhaustive-deps
// Blindly dispatch current front version for storage
dispatch(updateLastInterfaceVersion(import.meta.env.VITE_OSRD_GIT_DESCRIBE));
}, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ const InfraSelectorModalBodyEdition = ({
<div className="infra-add-import">
{selectedFile ? (
<>
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
<label className="infra-add-import-input-file with-file">
<VscJson />
<span className="ml-2" title={selectedFile.name}>
Expand All @@ -162,16 +161,13 @@ const InfraSelectorModalBodyEdition = ({
</button>
</>
) : (
<>
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
<label className="infra-add-import-input-file">
<VscJson />
<span className="flex-grow-1 text-center">
{t('infraManagement.addInfraJSONFile')}
</span>
<input type="file" onChange={handleSelect} accept=".json,.railjson" />
</label>
</>
<label className="infra-add-import-input-file">
<VscJson />
<span className="flex-grow-1 text-center">
{t('infraManagement.addInfraJSONFile')}
</span>
<input type="file" onChange={handleSelect} accept=".json,.railjson" />
</label>
)}
</div>
{isInfraLoading ? (
Expand Down
1 change: 0 additions & 1 deletion front/src/modules/powerRestriction/consts.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// eslint-disable-next-line import/prefer-default-export
export const NO_POWER_RESTRICTION = 'NO_POWER_RESTRICTION';
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/prefer-default-export */
import { compact, uniq } from 'lodash';

import type { RollingStock } from 'common/api/osrdEditoastApi';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ const useFilterRollingStock = ({ isStdcm } = { isStdcm: false }) => {
setFilteredRollingStockList(newFilteredRollingStock);
setSearchIsLoading(false);
}, 0);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [filters, usefulRollingStocks]);

return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable import/prefer-default-export */

export const electricalProfilesDesignValues = {
'25000V': { color: 'rgb(228, 178, 132)', heightLevel: 0 },
'22500V': { color: 'rgb(202, 149, 109)', heightLevel: 1 },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/prefer-default-export */
import type {
SpeedSpaceChartData,
ElectricalProfileValues,
Expand Down
1 change: 0 additions & 1 deletion front/src/modules/timesStops/helpers/arrivalTime.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/prefer-default-export */
import { formatLocalTime } from 'utils/date';
import { Duration, addDurationToDate } from 'utils/duration';
import { calculateTimeDifferenceInDays } from 'utils/timeManipulation';
Expand Down
1 change: 0 additions & 1 deletion front/src/modules/timesStops/helpers/scheduleData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/prefer-default-export */
import { Duration, addDurationToDate } from 'utils/duration';

import type { ScheduleEntry } from '../types';
Expand Down
1 change: 0 additions & 1 deletion front/src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { upperFirst, mapKeys } from 'lodash';

// eslint-disable-next-line import/prefer-default-export
export function makeEnumBooleans<T = symbol>(
list: Record<string, T>,
value: T | null
Expand Down
2 changes: 0 additions & 2 deletions front/src/utils/duration.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable import/prefer-default-export */

import dayjs from 'dayjs';
// eslint-disable-next-line import/extensions
import duration from 'dayjs/plugin/duration.js';
Expand Down
1 change: 0 additions & 1 deletion front/src/utils/geometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { minBy } from 'lodash';

import type { GeoJsonLineString } from 'common/api/osrdEditoastApi';

// eslint-disable-next-line import/prefer-default-export
export function getTangent(
tangentPoint: Position,
line: Feature<LineString>
Expand Down
1 change: 0 additions & 1 deletion front/src/utils/hooks/state.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/prefer-default-export */
import { useRef, useEffect } from 'react';

export function usePrevious<T>(value: T) {
Expand Down
1 change: 0 additions & 1 deletion front/src/utils/object.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/prefer-default-export */
import { isEqual, pick } from 'lodash';
/**
compare two objects based on a list of keys
Expand Down
1 change: 0 additions & 1 deletion front/src/utils/selectors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/prefer-default-export */
import { isNil } from 'lodash';

import type { RootState } from 'reducers';
Expand Down
Loading
Loading