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
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

37 changes: 0 additions & 37 deletions .eslintrc.yaml

This file was deleted.

45 changes: 45 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import lichtblickPlugin from "@lichtblick/eslint-plugin";

export default [
{
ignores: ["dist/**", "*.js", "*.mjs", "website/**"],
},

...lichtblickPlugin.configs.base,

...lichtblickPlugin.configs.typescript.map((config) => ({
...config,
files: ["**/*.ts", "**/*.tsx"],
})),

{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parserOptions: {
projectService: false,
project: "./tsconfig.json",
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"linebreak-style": ["error", "unix"],
// TypeScript validates named imports at compile time; the ESLint rule
// produces false positives for packages with non-standard exports.
"import/named": "off",
},
},

...lichtblickPlugin.configs.react,

...lichtblickPlugin.configs.jest.map((config) => ({
...config,
files: ["**/*.spec.ts", "**/*.test.ts", "tests/**/*.ts"],
rules: {
...config.rules,
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-explicit-any": "off",
},
})),
];
13 changes: 2 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,16 @@
"@commitlint/config-conventional": "^19.6.0",
"@foxglove/schemas": "^1.9.0",
"@lichtblick/asam-osi-types": "^3.7.0",
"@lichtblick/eslint-plugin": "^1.0.2",
"@lichtblick/eslint-plugin": "^2.0.7",
"@lichtblick/suite": "^1.25.0",
"@types/jest": "^30.0.0",
"@types/minimatch": "^5.1.2",
"@types/react": "18.2.55",
"@types/react-dom": "18.2.19",
"@typescript-eslint/eslint-plugin": "^8.48.0",
"@typescript-eslint/parser": "^8.48.0",
"create-lichtblick-extension": "^1.0.0",
"esbuild": "^0.25.0",
"eslint": "^8.57.0",
"eslint": "^9.38.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-es": "4.1.0",
"eslint-plugin-filenames": "1.3.2",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jest": "29.0.1",
"eslint-plugin-prettier": "5.5.4",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "4.6.0",
"husky": "^9.1.7",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
Expand Down
11 changes: 5 additions & 6 deletions src/features/lanes/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { TriangleListPrimitive, type Point3 } from "@foxglove/schemas";
import { Time } from "@foxglove/schemas";
import { TriangleListPrimitive, Time } from "@foxglove/schemas";
import { LaneBoundary, LaneBoundary_Classification_Type, Lane } from "@lichtblick/asam-osi-types";
import {
pointListToTriangleListPrimitive,
Expand Down Expand Up @@ -42,7 +41,7 @@ export function buildLaneBoundaryEntity(
// Create LaneBoundaryPoint objects using only necessary fields for rendering
const laneBoundaryPoints = osiLaneBoundary.boundary_line.map((point) => {
return {
position: { x: point.position.x, y: point.position.y, z: point.position.z } as Point3,
position: { x: point.position.x, y: point.position.y, z: point.position.z },
width: point.width === 0 ? LANE_BOUNDARY_MIN_RENDERING_WIDTH : point.width, // prevent zero-width lane boundaries from being invisible
height: point.height,
dash: point.dash,
Expand Down Expand Up @@ -83,7 +82,7 @@ export function buildLaneEntity(
for (const lb of osiLeftLaneBoundaries) {
const laneBoundaryPoints = lb.boundary_line.map((point) => {
return {
position: { x: point.position.x, y: point.position.y, z: point.position.z } as Point3,
position: { x: point.position.x, y: point.position.y, z: point.position.z },
width: point.width === 0 ? LANE_BOUNDARY_MIN_RENDERING_WIDTH : point.width, // prevent zero-width lane boundaries from being invisible
height: point.height,
dash: point.dash,
Expand All @@ -95,7 +94,7 @@ export function buildLaneEntity(
for (const lb of osiRightLaneBoundaries) {
const laneBoundaryPoints = lb.boundary_line.map((point) => {
return {
position: { x: point.position.x, y: point.position.y, z: point.position.z } as Point3,
position: { x: point.position.x, y: point.position.y, z: point.position.z },
width: point.width === 0 ? LANE_BOUNDARY_MIN_RENDERING_WIDTH : point.width, // prevent zero-width lane boundaries from being invisible
height: point.height,
dash: point.dash,
Expand All @@ -109,7 +108,7 @@ export function buildLaneEntity(
if (LANE_CENTERLINE_SHOW) {
const centerlinePoints = osiLane.classification.centerline.map((point) => {
return {
position: { x: point.x, y: point.y, z: point.z } as Point3,
position: { x: point.x, y: point.y, z: point.z },
width: LANE_CENTERLINE_WIDTH,
height: 0,
};
Expand Down
7 changes: 3 additions & 4 deletions src/features/logicallanes/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { type Point3 } from "@foxglove/schemas";
import { Time } from "@foxglove/schemas";
import { LogicalLane, LogicalLaneBoundary } from "@lichtblick/asam-osi-types";
import {
Expand Down Expand Up @@ -33,7 +32,7 @@ export function buildLogicalLaneBoundaryEntity(
x: point.position.x,
y: point.position.y,
z: point.position.z + LOGICAL_LANE_RENDERING_HEIGHT_OFFSET,
} as Point3,
},
width: LOGICAL_LANE_BOUNDARY_RENDERING_WIDTH,
height: 0,
};
Expand Down Expand Up @@ -74,7 +73,7 @@ export function buildLogicalLaneEntity(
x: point.position.x,
y: point.position.y,
z: point.position.z + LOGICAL_LANE_RENDERING_HEIGHT_OFFSET,
} as Point3,
},
width: LOGICAL_LANE_BOUNDARY_RENDERING_WIDTH,
height: 0, // no need to set height for logical lanes
};
Expand All @@ -89,7 +88,7 @@ export function buildLogicalLaneEntity(
x: point.position.x,
y: point.position.y,
z: point.position.z + LOGICAL_LANE_RENDERING_HEIGHT_OFFSET,
} as Point3,
},
width: LOGICAL_LANE_BOUNDARY_RENDERING_WIDTH,
height: 0, // no need to set height for logical lanes
};
Expand Down
4 changes: 2 additions & 2 deletions src/features/referenceline/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Point3, Time } from "@foxglove/schemas";
import { Time } from "@foxglove/schemas";
import { ReferenceLine } from "@lichtblick/asam-osi-types";
import { MarkerPoint, pointListToTriangleListPrimitive } from "@utils/index";
import { PartialSceneEntity, generateSceneEntityId } from "@utils/scene";
Expand All @@ -19,7 +19,7 @@ export function buildReferenceLineEntity(
x: p.world_position.x,
y: p.world_position.y,
z: p.world_position.z,
} as Point3,
},
width: REFERENCE_LINE_VISUALIZATION_WIDTH,
height: 0.0,
}));
Expand Down
2 changes: 1 addition & 1 deletion src/utils/primitives/lines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,5 +611,5 @@ export function pointListToDashedLinePrimitive(
color: { r: 0, g: 0, b: 0, a: 0 },
colors: new_colors,
indices: [],
} as LinePrimitive;
};
}
3 changes: 1 addition & 2 deletions tests/converters.registration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
MovingObject,
MovingObject_Type,
MovingObject_VehicleClassification_Type,
ReferenceLine,
ReferenceLine_Type,
StationaryObject,
} from "@lichtblick/asam-osi-types";
Expand Down Expand Up @@ -186,7 +185,7 @@ describe("OSI Visualizer: Message Converter", () => {
t_axis_yaw: 0,
},
],
} as unknown as DeepRequired<ReferenceLine>;
};
const mockMessageData = {
timestamp: {
seconds: 0,
Expand Down
8 changes: 4 additions & 4 deletions tests/emitAlert.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function minimalGroundTruth(overrides?: Partial<GroundTruth>): GroundTruth {
},
],
...overrides,
} as GroundTruth;
};
}

describe("emitAlert — GroundTruth FrameTransforms", () => {
Expand Down Expand Up @@ -104,7 +104,7 @@ describe("emitAlert — GroundTruth FrameTransforms", () => {
vehicle_attributes: {},
},
],
} as Partial<GroundTruth>);
});

convertGroundTruthToFrameTransforms(msg, undefined, undefined, context);

Expand Down Expand Up @@ -147,7 +147,7 @@ describe("emitAlert — SensorView SceneUpdate", () => {
const { context, emitAlert } = mockContext();
const converter = registerSensorViewConverter();

converter({} as SensorView, dummyEvent, undefined, context);
converter({}, dummyEvent, undefined, context);

expect(emitAlert).toHaveBeenCalledWith(
expect.objectContaining({ severity: "warn" }),
Expand All @@ -159,7 +159,7 @@ describe("emitAlert — SensorView SceneUpdate", () => {
const { context } = mockContext();
const converter = registerSensorViewConverter();

const result = converter({} as SensorView, dummyEvent, undefined, context) as {
const result = converter({}, dummyEvent, undefined, context) as {
deletions: unknown[];
entities: unknown[];
};
Expand Down
2 changes: 1 addition & 1 deletion tests/frameTransformConverter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function minimalGroundTruth(overrides?: Partial<GroundTruth>): GroundTruth {
},
],
...overrides,
} as GroundTruth;
};
}

describe("frameTransformConverter — host vehicle resolution", () => {
Expand Down
8 changes: 7 additions & 1 deletion tests/roadmarkings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ describe("buildRoadMarkingEntity", () => {
describe("scene entity properties", () => {
it("sets correct frame_id, timestamp, and frame_locked", () => {
const marking = createRoadMarking({ id: 42 });
const result = buildRoadMarkingEntity(marking, PREFIX, "test_frame", { sec: 10, nsec: 500 }, undefined);
const result = buildRoadMarkingEntity(
marking,
PREFIX,
"test_frame",
{ sec: 10, nsec: 500 },
undefined,
);
expect(result).toBeDefined();

expect(result!.frame_id).toBe("test_frame");
Expand Down
Loading
Loading