Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency eslint to v9 #266

Merged
merged 2 commits into from
Dec 14, 2024
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
33 changes: 0 additions & 33 deletions frontend/.eslintrc.js

This file was deleted.

53 changes: 53 additions & 0 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
), {
files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
languageOptions: {
globals: {
...globals.browser,
...globals.amd,
...globals.node,
},

parser: tsParser,
ecmaVersion: 2020,
sourceType: "module",

parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},

settings: {
react: {
version: "detect",
},

"import/resolver": {
node: {
paths: ["src"],
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
},
},
}];
11 changes: 7 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "vite --port 3000",
"build": "tsc && vite build",
"preview": "vite preview --port 3000",
"lint": "eslint ./src --ext .jsx,.js,.ts,.tsx --fix --ignore-path ./.gitignore"
"lint": "eslint ./src --fix"
},
"engines": {
"node": "^20"
Expand All @@ -33,19 +33,22 @@
"react-sliding-pane": "7.3.0"
},
"devDependencies": {
"@eslint/eslintrc": "3.2.0",
"@eslint/js": "9.17.0",
"@types/geojson": "7946.0.15",
"@types/leaflet": "1.9.0",
"@types/leaflet.heat": "0.2.4",
"@types/node": "20.17.9",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.24",
"@types/react-infinite-scroller": "1.2.5",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"@typescript-eslint/eslint-plugin": "8.18.0",
"@typescript-eslint/parser": "8.18.0",
"@vitejs/plugin-react-swc": "3.7.2",
"eslint": "8.57.1",
"eslint": "9.17.0",
"eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-react": "7.37.2",
"globals": "15.13.0",
"typescript": "5.7.2",
"vite": "6.0.3",
"vite-plugin-checker": "0.8.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Box, Dialog, DialogTitle, Divider, Grid} from "@mui/material";
import {Dialog, DialogTitle, Divider, Grid} from "@mui/material";
import React from "react";

import {RelayDetailsHeader} from "./RelayDetailsHeader";
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/dialogs/relay/RelayList.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Box, CircularProgress, List, ListItemButton, ListItemIcon, ListItemText} from "@mui/material";
import React, {FunctionComponent, useMemo, useState} from "react";
import React, {FunctionComponent, useState} from "react";
import InfiniteScroll from "react-infinite-scroller";

import {getIcon, RelayFamilyIcon} from "../../../types/icons";
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/context/date-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface DateInterface {
const DateContext = React.createContext<DateInterface | null>(null)

export function useDate() {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return useContext(DateContext)!
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/context/settings-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const SettingsContext = React.createContext<SettingsInterface | null>(null)
* The Context Hook for Settings provided in the SettingsProvider
*/
export function useSettings() {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return useContext(SettingsContext)!
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/context/statistics-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface StatisticsInterface {
const StatisticsContext = React.createContext<StatisticsInterface | null>(null)

export function useStatistics() {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return useContext(StatisticsContext)!
}

Expand Down
7 changes: 3 additions & 4 deletions frontend/src/util/layer-construction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
sortFamilyCoordinatesMap
} from "./aggregate-relays";
import {getUniqueCountryColor} from "./geojson";
import {backend} from "./util";

/**
* Returns a Layer with markers with size relative to number of relays on a coordinate.
Expand Down Expand Up @@ -133,13 +132,13 @@ function addRelayNicknameTooltip(relays: RelayLocationDto[], mostImportantRelay:
stroke: false,
},
)
.on('mouseover', async function (this: L.Marker, e) {
.on('mouseover', async function (this: L.Marker) {
marker.bindTooltip(tooltip, {permanent: false, direction: 'top'}).openTooltip();
})
.on('mouseout', function (this: L.Marker, e) {
.on('mouseout', function (this: L.Marker) {
marker.unbindTooltip();
})
.on("click", function (this: L.Marker, e) {
.on("click", function (this: L.Marker) {
marker.fire('click'); // Trigger the click event of the actual marker
})
.addTo(targetLayer)
Expand Down
Loading
Loading