Skip to content

Commit

Permalink
Update dependencies (#1060)
Browse files Browse the repository at this point in the history
* Update babel

* Update eslint

* Remove eslint-compat

* Update patch versions

* Update sentry

* Update minor versions

* Update helmet v8 major

* Update lockfile
  • Loading branch information
Archinowsk authored Oct 5, 2024
1 parent ce351bb commit 7ae30a1
Show file tree
Hide file tree
Showing 11 changed files with 1,299 additions and 1,256 deletions.
18 changes: 9 additions & 9 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"@fortawesome/free-solid-svg-icons": "6.6.0",
"@fortawesome/react-fontawesome": "0.2.2",
"@reduxjs/toolkit": "2.2.7",
"@sentry/react": "8.32.0",
"@sentry/react": "8.33.1",
"browserslist": "4.24.0",
"core-js": "3.38.1",
"i18next": "23.15.1",
"i18next": "23.15.2",
"i18next-browser-languagedetector": "8.0.0",
"react": "18.3.1",
"react-dom": "18.3.1",
Expand All @@ -48,18 +48,18 @@
},
"devDependencies": {
"@axe-core/react": "4.10.0",
"@babel/cli": "7.25.6",
"@babel/core": "7.25.2",
"@babel/node": "7.25.0",
"@babel/preset-env": "7.25.4",
"@babel/preset-react": "7.24.7",
"@babel/preset-typescript": "7.24.7",
"@babel/cli": "7.25.7",
"@babel/core": "7.25.7",
"@babel/node": "7.25.7",
"@babel/preset-env": "7.25.7",
"@babel/preset-react": "7.25.7",
"@babel/preset-typescript": "7.25.7",
"@double-great/stylelint-a11y": "3.0.2",
"@mdx-js/loader": "3.0.1",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
"@types/dotenv-webpack": "7.0.7",
"@types/mdx": "2.0.13",
"@types/react": "18.3.9",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.0",
"@welldone-software/why-did-you-render": "8.0.3",
"babel-loader": "9.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { sortBy, groupBy } from "lodash-es";
import styled from "styled-components";
import { ProgramItemEntry } from "client/views/program-item/ProgramItemEntry";
import { useAppSelector } from "client/utils/hooks";
import { ProgramItem } from "shared/types/models/programItem";
import {
ProgramItem,
ProgramItemSignupStrategy,
} from "shared/types/models/programItem";
import { ProgramItemListTitle } from "client/views/all-program-items/components/ProgramItemListTitle";
import { getLotterySignups } from "client/utils/getUpcomingProgramItems";
import {
Expand All @@ -15,7 +18,6 @@ import {
import { RaisedCard } from "client/components/RaisedCard";
import { getIsInGroup } from "client/views/group/groupUtils";
import { SignupQuestion } from "shared/types/models/settings";
import { ProgramItemSignupStrategy } from "shared/types/models/programItem";

interface Props {
programItems: readonly ProgramItem[];
Expand Down
6 changes: 4 additions & 2 deletions client/src/views/program-item/signup/ProgramItemSignup.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { ReactElement } from "react";
import styled from "styled-components";
import { ProgramItem } from "shared/types/models/programItem";
import {
ProgramItem,
ProgramItemSignupStrategy,
} from "shared/types/models/programItem";
import { DirectSignupProgramItem } from "client/views/program-item/signup/components/DirectSignupProgramItem";
import { LotterySignupProgramItem } from "client/views/program-item/signup/components/LotterySignupProgramItem";
import { config } from "shared/config";
import { ProgramItemSignupStrategy } from "shared/types/models/programItem";
import { Signup } from "shared/types/models/user";
import { SignupHelpText } from "client/views/program-item/signup/components/SignupHelpText";
import { getTimeNow } from "client/utils/getTimeNow";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { ReactElement } from "react";
import { useTranslation } from "react-i18next";
import dayjs from "dayjs";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { ProgramItem } from "shared/types/models/programItem";
import {
ProgramItem,
ProgramItemSignupStrategy,
} from "shared/types/models/programItem";
import { getTimeNow } from "client/utils/getTimeNow";
import { isRevolvingDoorWorkshop } from "client/utils/isRevolvingDoorWorkshop";
import {
Expand All @@ -15,7 +18,6 @@ import {
getFormattedTime,
getFormattedInterval,
} from "client/views/program-item/programItemUtils";
import { ProgramItemSignupStrategy } from "shared/types/models/programItem";

interface Props {
programItem: ProgramItem;
Expand Down
48 changes: 24 additions & 24 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// @ts-check
import eslint from "@eslint/js";
import globals from "globals";
import eslintPluginBan from "eslint-plugin-ban";
import eslintPluginCommentsConfigs from "@eslint-community/eslint-plugin-eslint-comments/configs";
import eslintPluginCompat from "eslint-plugin-compat";
import eslintPluginImport from "eslint-plugin-import";
Expand All @@ -14,8 +13,8 @@ import eslintPluginReactHooks from "eslint-plugin-react-hooks";
import eslintPluginReactHooksAddon from "eslint-plugin-react-hooks-addons";
import eslintPluginUnicorn from "eslint-plugin-unicorn";
import eslintPluginVitest from "eslint-plugin-vitest";
import eslintPluginOnlyError from "eslint-plugin-only-error";
import typescriptEslint from "typescript-eslint";
import { fixupPluginRules } from "@eslint/compat";

export default typescriptEslint.config(
eslint.configs.recommended,
Expand All @@ -24,6 +23,11 @@ export default typescriptEslint.config(
eslintPluginCommentsConfigs.recommended,
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
eslintPluginPromise.configs["flat/recommended"],
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
eslintPluginImport.flatConfigs.recommended,
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
eslintPluginImport.flatConfigs.typescript,
eslintPluginReactHooksAddon.configs.recommended,

// ** Default **
{
Expand Down Expand Up @@ -55,11 +59,9 @@ export default typescriptEslint.config(
},
{
plugins: {
ban: fixupPluginRules(eslintPluginBan),
vitest: eslintPluginVitest,
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
import: fixupPluginRules(eslintPluginImport),
unicorn: eslintPluginUnicorn,
onlyError: eslintPluginOnlyError,
},

settings: {
Expand All @@ -70,13 +72,8 @@ export default typescriptEslint.config(
"import/internal-regex": "shared",
},

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
rules: {
...eslintPluginVitest.configs.recommended.rules,
// TODO: Enable, doesn't work with flat config yet
// ...eslintPluginImport.configs.recommended.rules,
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
...eslintPluginImport.configs.typescript.rules,

// eslint
"no-param-reassign": "error",
Expand All @@ -92,6 +89,14 @@ export default typescriptEslint.config(
selector: "MemberExpression[property.name='format']",
message: "Import from timeFormatter.ts or use dayjs().toISOString",
},
{
selector: "CallExpression[callee.name='useDispatch']",
message: "Please use useAppDispatch()",
},
{
selector: "CallExpression[callee.name='useSelector']",
message: "Please use useAppSelector()",
},
],
"no-else-return": "error",
curly: "error",
Expand All @@ -104,13 +109,18 @@ export default typescriptEslint.config(
"error",
{
ignore: [
"padgAssignment", // Needs wildcard import for vi.spyon
"randomAssignment", // Needs wildcard import for vi.spyon
"signupTimes", // Needs wildcard import for vi.spyon
"padgAssignment", // Needs wildcard import for vi.spyOn()
"randomAssignment", // Needs wildcard import for vi.spyOn()
"signupTimes", // Needs wildcard import for vi.spyOn()
],
},
], // Don't want to use namespace imports
"import/no-unresolved": ["error", { ignore: ["\\.gif$"] }],

"import/namespace": "off", // Don't want to use namespace imports
"import/no-named-as-default": "off", // Doesn't work with styled-components
"import/no-named-as-default-member": "off", // Doesn't work with i18next.use()
"import/default": "off", // Doesn't work with prettier default import

// eslint-plugin-vitest
"vitest/no-disabled-tests": "error",
Expand All @@ -120,13 +130,6 @@ export default typescriptEslint.config(
{ assertFunctionNames: ["expect", "assertSignupTime"] },
],

// eslint-plugin-ban
"ban/ban": [
"error",
{ name: "useDispatch", message: "Please use useAppDispatch()" },
{ name: "useSelector", message: "Please use useAppSelector()" },
],

// @typescript-eslint
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/explicit-function-return-type": [
Expand Down Expand Up @@ -181,10 +184,8 @@ export default typescriptEslint.config(

extends: [
// 'recommended' configuration is not recommended anymore, use 'all' and disable some rules
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
eslintPluginReact.configs.flat.all,
// Disable some rules conflicting with new JSX transform from React 17
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
eslintPluginReact.configs.flat["jsx-runtime"],
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
eslintPluginJsxA11y.flatConfigs.recommended,
Expand All @@ -193,8 +194,7 @@ export default typescriptEslint.config(

plugins: {
react: eslintPluginReact,
"react-hooks": fixupPluginRules(eslintPluginReactHooks),
"react-hooks-addons": fixupPluginRules(eslintPluginReactHooksAddon),
"react-hooks": eslintPluginReactHooks,
},

settings: {
Expand Down
23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,30 +65,29 @@
},
"devDependencies": {
"@eslint-community/eslint-plugin-eslint-comments": "4.4.0",
"@eslint/compat": "1.1.1",
"@eslint/js": "9.11.1",
"@eslint/js": "9.12.0",
"@playwright/test": "1.47.2",
"@types/eslint__js": "8.42.3",
"@types/lodash-es": "4.17.12",
"eslint": "9.11.1",
"eslint": "9.12.0",
"eslint-config-prettier": "9.1.0",
"eslint-import-resolver-typescript": "3.6.3",
"eslint-plugin-ban": "1.6.0",
"eslint-plugin-compat": "6.0.1",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jsx-a11y": "6.10.0",
"eslint-plugin-n": "17.10.3",
"eslint-plugin-only-error": "1.0.2",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-promise": "7.1.0",
"eslint-plugin-react": "7.36.1",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-react-hooks-addons": "0.3.1",
"eslint-plugin-unicorn": "55.0.0",
"eslint-plugin-react": "7.37.1",
"eslint-plugin-react-hooks": "5.1.0-rc-fb9a90fa48-20240614",
"eslint-plugin-react-hooks-addons": "0.4.0",
"eslint-plugin-unicorn": "56.0.0",
"eslint-plugin-vitest": "0.5.4",
"globals": "15.9.0",
"globals": "15.10.0",
"prettier": "3.3.3",
"typescript-eslint": "8.7.0",
"vitest": "2.1.1"
"typescript-eslint": "8.8.0",
"vitest": "2.1.2"
},
"engines": {
"node": ">=20.16.0"
Expand Down
14 changes: 7 additions & 7 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,32 @@
"check-start-times": "NODE_ENV=development tsx src/test/scripts/checkStartTimes.ts"
},
"dependencies": {
"@faker-js/faker": "9.0.2",
"@sentry/node": "8.32.0",
"@faker-js/faker": "9.0.3",
"@sentry/node": "8.33.1",
"@vercel/ncc": "0.38.2",
"bcryptjs": "2.4.3",
"commander": "12.1.0",
"croner": "8.1.1",
"croner": "8.1.2",
"dotenv": "16.4.5",
"eventassigner-js": "0.1.6",
"eventassigner-random": "0.3.2",
"express": "4.21.0",
"express-static-gzip": "2.1.8",
"fastest-levenshtein": "1.0.16",
"generate-serial-number": "0.0.3",
"helmet": "7.1.0",
"helmet": "8.0.0",
"jsonwebtoken": "9.0.2",
"mongoose": "8.6.3",
"mongoose": "8.7.0",
"morgan": "1.10.0",
"tsx": "4.19.1",
"winston": "3.14.2",
"winston": "3.15.0",
"winston-transport-sentry-node": "3.0.0"
},
"devDependencies": {
"@types/bcryptjs": "2.4.6",
"@types/jsonwebtoken": "9.0.7",
"@types/morgan": "1.9.9",
"@types/node": "20.16.7",
"@types/node": "20.16.10",
"@types/supertest": "6.0.2",
"mongodb-memory-server": "10.0.1",
"supertest": "7.0.0"
Expand Down
2 changes: 1 addition & 1 deletion server/src/kompassi/kompassiProgramItemMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import {
KompassiAudience,
KompassiAccessibility,
KompassiTopic,
KompassiKonstiProgramType,
} from "server/kompassi/kompassiProgramItem";
import { exhaustiveSwitchGuard } from "shared/utils/exhaustiveSwitchGuard";
import { config } from "shared/config";
import { getShortDescriptionFromDescription } from "server/utils/getShortDescriptionFromDescription";
import { KompassiKonstiProgramType } from "server/kompassi/kompassiProgramItem";

export const kompassiProgramItemMapper = (
programItems: readonly KompassiProgramItem[],
Expand Down
2 changes: 1 addition & 1 deletion server/src/kompassi/test/mockKompassiProgramItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
KompassiAudience,
KompassiAccessibility,
KompassiTopic,
KompassiKonstiProgramType,
} from "server/kompassi/kompassiProgramItem";
import { KompassiKonstiProgramType } from "server/kompassi/kompassiProgramItem";

export const mockKompassiProgramItem: KompassiProgramItem = {
slug: testProgramItem.programItemId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import {
KompassiAudience,
KompassiAccessibility,
KompassiTopic,
KompassiKonstiProgramType,
} from "server/kompassi/kompassiProgramItem";
import { Result } from "shared/utils/result";
import { MongoDbError } from "shared/types/api/errors";
import { KompassiKonstiProgramType } from "server/kompassi/kompassiProgramItem";
import { ProgramType } from "shared/types/models/programItem";
import { exhaustiveSwitchGuard } from "shared/utils/exhaustiveSwitchGuard";

Expand Down
Loading

0 comments on commit 7ae30a1

Please sign in to comment.