diff --git a/app/charts/area/chart-area.tsx b/app/charts/area/chart-area.tsx index f4719ae8b..e54279247 100644 --- a/app/charts/area/chart-area.tsx +++ b/app/charts/area/chart-area.tsx @@ -58,8 +58,6 @@ export const ChartAreasVisualization = ({ }, }); - const observations = data?.dataCubeByIri?.observations.data; - if (data?.dataCubeByIri) { const { title, dimensions, measures, observations } = data?.dataCubeByIri; return observations.data.length > 0 ? ( diff --git a/app/charts/bar/chart-bar.tsx b/app/charts/bar/chart-bar.tsx index 656f3e707..e66aaba53 100644 --- a/app/charts/bar/chart-bar.tsx +++ b/app/charts/bar/chart-bar.tsx @@ -56,8 +56,6 @@ export const ChartBarsVisualization = ({ }, }); - const observations = data?.dataCubeByIri?.observations.data; - if (data?.dataCubeByIri) { const { title, dimensions, measures, observations } = data?.dataCubeByIri; return observations.data.length > 0 ? ( diff --git a/app/charts/column/chart-column.tsx b/app/charts/column/chart-column.tsx index 223f5c62d..b73115548 100644 --- a/app/charts/column/chart-column.tsx +++ b/app/charts/column/chart-column.tsx @@ -68,8 +68,6 @@ export const ChartColumnsVisualization = ({ }, }); - const observations = data?.dataCubeByIri?.observations.data; - if (data?.dataCubeByIri) { const { title, dimensions, measures, observations } = data?.dataCubeByIri; return observations.data.length > 0 ? ( diff --git a/app/charts/index.ts b/app/charts/index.ts index 57f41e055..be6d91329 100644 --- a/app/charts/index.ts +++ b/app/charts/index.ts @@ -758,7 +758,7 @@ const chartConfigsAdjusters: ChartConfigsAdjusters = { }, }, map: { - filters: ({ oldValue, newChartConfig, dimensions }) => { + filters: ({ oldValue, newChartConfig }) => { return produce(newChartConfig, (draft) => { if (!oldValue) { draft.filters = oldValue; diff --git a/app/charts/line/chart-lines.tsx b/app/charts/line/chart-lines.tsx index 78b7fb6aa..042853918 100644 --- a/app/charts/line/chart-lines.tsx +++ b/app/charts/line/chart-lines.tsx @@ -60,8 +60,6 @@ export const ChartLinesVisualization = ({ }, }); - const observations = data?.dataCubeByIri?.observations.data; - if (data?.dataCubeByIri) { const { title, dimensions, measures, observations } = data?.dataCubeByIri; diff --git a/app/charts/map/style-helpers.ts b/app/charts/map/style-helpers.ts index d39b3b880..8e42585d1 100644 --- a/app/charts/map/style-helpers.ts +++ b/app/charts/map/style-helpers.ts @@ -9,7 +9,7 @@ export function hasUrl(obj: AnySourceData): obj is HasUrl { return Object.prototype.hasOwnProperty.call(obj, "url"); } -type HasLayout = T extends { layout?: infer R } ? T : never; +type HasLayout = T extends { layout?: infer T } ? T : never; export function hasLayout(obj: AnyLayer): obj is HasLayout { return Object.prototype.hasOwnProperty.call(obj, "layout"); } diff --git a/app/charts/scatterplot/chart-scatterplot.tsx b/app/charts/scatterplot/chart-scatterplot.tsx index 2e9827676..aba8ea597 100644 --- a/app/charts/scatterplot/chart-scatterplot.tsx +++ b/app/charts/scatterplot/chart-scatterplot.tsx @@ -63,8 +63,6 @@ export const ChartScatterplotVisualization = ({ }, }); - const observations = data?.dataCubeByIri?.observations.data; - if (data?.dataCubeByIri) { const { title, dimensions, measures, observations } = data?.dataCubeByIri; return observations.data.length > 0 ? ( diff --git a/app/charts/table/chart-table.tsx b/app/charts/table/chart-table.tsx index eff974828..1ea207f51 100644 --- a/app/charts/table/chart-table.tsx +++ b/app/charts/table/chart-table.tsx @@ -38,8 +38,6 @@ export const ChartTableVisualization = ({ }, }); - const observations = data?.dataCubeByIri?.observations.data; - if (data?.dataCubeByIri) { const { dimensions, measures, observations } = data?.dataCubeByIri; return observations.data.length > 0 ? ( diff --git a/app/components/debug-search.tsx b/app/components/debug-search.tsx index 029fcac1f..79bee33df 100644 --- a/app/components/debug-search.tsx +++ b/app/components/debug-search.tsx @@ -23,6 +23,7 @@ const geographyTheme = { value: "https://register.ld.admin.ch/opendataswiss/category/geography", }; +// @ts-ignore const bafuCreator = { name: "BAFU creator", type: "DataCubeOrganization", @@ -30,6 +31,7 @@ const bafuCreator = { "https://register.ld.admin.ch/opendataswiss/org/bundesamt-fur-umwelt-bafu", }; +// @ts-ignore const mobilityTheme = { name: "Mobility theme", type: "DataCubeTheme", diff --git a/app/configurator/components/field.tsx b/app/configurator/components/field.tsx index 022892baf..0ed2d1c55 100644 --- a/app/configurator/components/field.tsx +++ b/app/configurator/components/field.tsx @@ -52,12 +52,10 @@ import { IconName } from "@/icons"; export const ControlTabField = ({ component, value, - disabled, labelId, }: { component?: DimensionMetadataFragment; value: string; - disabled?: boolean; labelId: string; }) => { const field = useActiveFieldField({ @@ -165,7 +163,6 @@ export const DataFilterSelectDay = ({ dimensionIri, label, options, - id, disabled, isOptional, controls, @@ -173,7 +170,6 @@ export const DataFilterSelectDay = ({ dimensionIri: string; label: string; options: Option[]; - id: string; disabled?: boolean; isOptional?: boolean; controls?: React.ReactNode; @@ -338,7 +334,6 @@ export const DataFilterSelectTime = ({ return ( ) => void; }) => { @@ -644,7 +637,6 @@ export const ColorPickerField = ({ }; export const ChartFieldField = ({ - componentIri, label, field, options, @@ -652,7 +644,6 @@ export const ChartFieldField = ({ disabled, dataSetMetadata, }: { - componentIri?: string; label: string; field: string; options: Option[]; diff --git a/app/tsconfig.json b/app/tsconfig.json index d354bcb52..1a9c14d76 100644 --- a/app/tsconfig.json +++ b/app/tsconfig.json @@ -18,7 +18,9 @@ "paths": { "@/*": ["./*"] }, - "noImplicitAny": true + "noImplicitAny": true, + "noUnusedLocals": true, + "noUnusedParameters": true }, "exclude": ["node_modules"], "include": [