Chore: fix linting errors

This commit is contained in:
Pieter Vander Vennet 2024-04-12 15:33:15 +02:00
parent 9163d57039
commit 51addf191c

View file

@ -197,11 +197,11 @@ class StealViz implements SpecialVisualization {
} }
getLayerDependencies(args): string[] { getLayerDependencies(args): string[] {
const [_, tagRenderingId] = args const [, tagRenderingId] = args
if (tagRenderingId.indexOf(".") < 0) { if (tagRenderingId.indexOf(".") < 0) {
throw "Error: argument 'layerId.tagRenderingId' of special visualisation 'steal' should contain a dot" throw "Error: argument 'layerId.tagRenderingId' of special visualisation 'steal' should contain a dot"
} }
const [layerId, __] = tagRenderingId.split(".") const [layerId] = tagRenderingId.split(".")
return [layerId] return [layerId]
} }
} }
@ -370,7 +370,7 @@ export default class SpecialVisualizations {
args: [], args: [],
constr(state: SpecialVisualizationState, _, __, feature): BaseUIElement { constr(state: SpecialVisualizationState, _, __, feature): BaseUIElement {
let [lon, lat] = GeoOperations.centerpointCoordinates(feature) const [lon, lat] = GeoOperations.centerpointCoordinates(feature)
return new SvelteUIElement(AddNewPoint, { return new SvelteUIElement(AddNewPoint, {
state, state,
coordinate: { lon, lat } coordinate: { lon, lat }
@ -601,7 +601,7 @@ export default class SpecialVisualizations {
} }
], ],
needsUrls: AllImageProviders.apiUrls, needsUrls: AllImageProviders.apiUrls,
constr: (state, tags, args, feature) => { constr: (state, tags, args) => {
let imagePrefixes: string[] = undefined let imagePrefixes: string[] = undefined
if (args.length > 0) { if (args.length > 0) {
imagePrefixes = [].concat(...args.map((a) => a.split(","))) imagePrefixes = [].concat(...args.map((a) => a.split(",")))
@ -655,9 +655,9 @@ export default class SpecialVisualizations {
doc: "The identifier to use, if <i>tags[subjectKey]</i> as specified above is not available. This is effectively a fallback value" doc: "The identifier to use, if <i>tags[subjectKey]</i> as specified above is not available. This is effectively a fallback value"
} }
], ],
constr: (state, tags, args, feature, layer) => { constr: (state, tags, args, feature) => {
const nameKey = args[0] ?? "name" const nameKey = args[0] ?? "name"
let fallbackName = args[1] const fallbackName = args[1]
const reviews = FeatureReviews.construct( const reviews = FeatureReviews.construct(
feature, feature,
tags, tags,
@ -691,7 +691,7 @@ export default class SpecialVisualizations {
], ],
constr: (state, tags, args, feature, layer) => { constr: (state, tags, args, feature, layer) => {
const nameKey = args[0] ?? "name" const nameKey = args[0] ?? "name"
let fallbackName = args[1] const fallbackName = args[1]
const reviews = FeatureReviews.construct( const reviews = FeatureReviews.construct(
feature, feature,
tags, tags,
@ -724,7 +724,7 @@ export default class SpecialVisualizations {
], ],
constr: (state, tags, args, feature, layer) => { constr: (state, tags, args, feature, layer) => {
const nameKey = args[0] ?? "name" const nameKey = args[0] ?? "name"
let fallbackName = args[1] const fallbackName = args[1]
const reviews = FeatureReviews.construct( const reviews = FeatureReviews.construct(
feature, feature,
tags, tags,
@ -750,10 +750,8 @@ export default class SpecialVisualizations {
needsUrls: [], needsUrls: [],
constr( constr(
state: SpecialVisualizationState, state: SpecialVisualizationState,
tagSource: UIEventSource<Record<string, string>>, _: UIEventSource<Record<string, string>>,
argument: string[], argument: string[]
feature: Feature,
layer: LayerConfig
): BaseUIElement { ): BaseUIElement {
const [text] = argument const [text] = argument
return new SvelteUIElement(ImportReviewIdentity, { state, text }) return new SvelteUIElement(ImportReviewIdentity, { state, text })
@ -810,9 +808,7 @@ export default class SpecialVisualizations {
constr( constr(
state: SpecialVisualizationState, state: SpecialVisualizationState,
tags: UIEventSource<Record<string, string>>, tags: UIEventSource<Record<string, string>>,
args: string[], args: string[]
feature: Feature,
layer: LayerConfig
): SvelteUIElement { ): SvelteUIElement {
const keyToUse = args[0] const keyToUse = args[0]
const prefix = args[1] const prefix = args[1]
@ -1026,12 +1022,12 @@ export default class SpecialVisualizations {
args: [], args: [],
needsUrls: [Maproulette.defaultEndpoint], needsUrls: [Maproulette.defaultEndpoint],
constr(state, tagSource) { constr(state, tagSource) {
let parentId = tagSource.data.mr_challengeId const parentId = tagSource.data.mr_challengeId
if (parentId === undefined) { if (parentId === undefined) {
console.warn("Element ", tagSource.data.id, " has no mr_challengeId") console.warn("Element ", tagSource.data.id, " has no mr_challengeId")
return undefined return undefined
} }
let challenge = Stores.FromPromise( const challenge = Stores.FromPromise(
Utils.downloadJsonCached( Utils.downloadJsonCached(
`${Maproulette.defaultEndpoint}/challenge/${parentId}`, `${Maproulette.defaultEndpoint}/challenge/${parentId}`,
24 * 60 * 60 * 1000 24 * 60 * 60 * 1000
@ -1040,7 +1036,7 @@ export default class SpecialVisualizations {
return new VariableUiElement( return new VariableUiElement(
challenge.map((challenge) => { challenge.map((challenge) => {
let listItems: BaseUIElement[] = [] const listItems: BaseUIElement[] = []
let title: BaseUIElement let title: BaseUIElement
if (challenge?.name) { if (challenge?.name) {