Skip to content

Commit

Permalink
Biome linting - ignores and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
keithamoss committed Oct 19, 2024
1 parent 46e68c4 commit 57509a3
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
2 changes: 2 additions & 0 deletions admin-redesign/src/app/services/stalls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export const stallsApi = api.injectEndpoints({
}),
}),
addStall: builder.mutation<
// biome-ignore lint/complexity/noBannedTypes: <explanation>
{},
NewStallOwner | NewStallTipOff | NewStallTipOffRunOut | NewStallTipOffRedCrossOfShame
>({
Expand All @@ -166,6 +167,7 @@ export const stallsApi = api.injectEndpoints({
body: stall,
}),
}),
// biome-ignore lint/complexity/noBannedTypes: <explanation>
updateStallWithCredentials: builder.mutation<{}, Stall & { token: string; signature: string }>({
query: (stall) => ({
url: `stalls/${stall.id}/update_and_resubmit/`,
Expand Down
4 changes: 2 additions & 2 deletions admin-redesign/src/app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ export function stringDivider(str: string, width: number, spaceReplacer: string,
p -= 1;
}
if (p > 0) {
let left;
let left: string;
if (str.substring(p, p + 1) === '-') {
left = str.substring(0, p + 1);
} else {
left = str.substring(0, p);
}
const right = str.substring(p + 1);
// eslint-disable-next-line no-param-reassign
// biome-ignore lint/style/noParameterAssign: <explanation>
replaceCount += 1;
const [newText, newReplaceCount] = stringDivider(right, width, spaceReplacer, replaceCount);
return [left + spaceReplacer + newText, newReplaceCount];
Expand Down
1 change: 1 addition & 0 deletions admin-redesign/src/features/app/appSlice.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createSlice } from '@reduxjs/toolkit';

// biome-ignore lint/complexity/noBannedTypes: <explanation>
export type AppState = {};

export const initialState: AppState = {};
Expand Down
11 changes: 7 additions & 4 deletions admin-redesign/src/features/icons/svgHelpers.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { SvgIcon } from '@mui/material';

const setAttributesOnElement = (svg: Element, attributes: { [key: string]: string }) =>
Object.entries(attributes).forEach(([attributeName, attributeValue]) =>
svg.setAttribute(attributeName, attributeValue),
);
const setAttributesOnElement = (svg: Element, attributes: { [key: string]: string }) => {
for (const [attributeName, attributeValue] of Object.entries(attributes)) {
svg.setAttribute(attributeName, attributeValue);
}
};

export const createInlinedSVGImage = (
rawSVG: string,
style: React.CSSProperties,
onClick: React.MouseEventHandler<HTMLImageElement>,
// biome-ignore lint/a11y/useKeyWithClickEvents: <explanation>
// biome-ignore lint/a11y/useAltText: <explanation>
) => <img src={`data:image/svg+xml;utf8,${rawSVG.replaceAll('#', '%23')}`} style={style} onClick={onClick} />;

export const prepareRawSVGForOpenLayers = (rawSvg: string, width?: number, height?: number, style?: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ export function getFoodDescription(pollingPlace: IPollingPlace) {
const foodLabels: Array<string> = [];
const foodIcons = getAllFoodsAvailableOnStalls();

Object.keys(pollingPlace.stall.noms).forEach((foodName) => {
for (const foodName of Object.keys(pollingPlace.stall.noms)) {
const foodDefinition = foodIcons.find((i) => i.value === foodName);

if (foodDefinition !== undefined) {
foodLabels.push(foodDefinition.label);
}
});
}

return foodLabels;
}
Expand Down Expand Up @@ -132,13 +132,14 @@ export const getPollingPlaceDivisionsDescriptiveText = (pollingPlace: IPollingPl

export const getPollingPlaceIdsFromFeatures = (features: Feature[]) => {
const ids: number[] = [];
features.forEach((f) => {

for (const f of features) {
const id = f.getId();

if (typeof id === 'number') {
ids.push(id);
}
});
}

return ids;
};
Expand Down
1 change: 1 addition & 0 deletions admin-redesign/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { store } from './app/store';
import { theme } from './app/ui/theme';
// import "./browserstack";

// biome-ignore lint/style/noNonNullAssertion: <explanation>
const container = document.getElementById('root')!;
const root = createRoot(container);

Expand Down

0 comments on commit 57509a3

Please sign in to comment.