Skip to content

Commit 41d1a63

Browse files
authored
Upgrade packages and fix linting rules (#135)
* Upgrade packages * Fix linting issues and reformat code * fix linter and unit test warnings
1 parent e4d78da commit 41d1a63

File tree

110 files changed

+5458
-5581
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+5458
-5581
lines changed

.eslintrc

Lines changed: 0 additions & 76 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import { defineConfig, globalIgnores } from "eslint/config";
2+
import _import from "eslint-plugin-import";
3+
import prettier from "eslint-plugin-prettier";
4+
import { fixupPluginRules } from "@eslint/compat";
5+
import path from "node:path";
6+
import { fileURLToPath } from "node:url";
7+
import js from "@eslint/js";
8+
import { FlatCompat } from "@eslint/eslintrc";
9+
import mantine from "eslint-config-mantine";
10+
11+
const __filename = fileURLToPath(import.meta.url);
12+
const __dirname = path.dirname(__filename);
13+
const compat = new FlatCompat({
14+
baseDirectory: __dirname,
15+
recommendedConfig: js.configs.recommended,
16+
allConfig: js.configs.all,
17+
});
18+
19+
export default defineConfig([
20+
globalIgnores(["**/*.d.ts", "**/vite.config.ts"]),
21+
{
22+
extends: [
23+
...compat.extends(
24+
"plugin:prettier/recommended",
25+
"plugin:@typescript-eslint/recommended",
26+
),
27+
...mantine,
28+
],
29+
30+
plugins: { import: fixupPluginRules(_import), prettier },
31+
32+
settings: {
33+
"import/parsers": {
34+
"@typescript-eslint/parser": [".ts", ".tsx", ".js", ".jsx"],
35+
},
36+
"import/resolver": {
37+
typescript: {
38+
alwaysTryTypes: true,
39+
project: ["src/api/tsconfig.json", "src/ui/tsconfig.json"],
40+
},
41+
},
42+
},
43+
44+
rules: {
45+
"import/no-unresolved": "error",
46+
"no-param-reassign": "off",
47+
"import/extensions": [
48+
"error",
49+
"ignorePackages",
50+
{ js: "never", jsx: "never", ts: "never", tsx: "never" },
51+
],
52+
"no-unused-vars": "off",
53+
"max-classes-per-file": "off",
54+
"func-names": "off",
55+
"no-case-declarations": "off",
56+
"@typescript-eslint/no-unused-vars": [
57+
"warn",
58+
{
59+
argsIgnorePattern: "^_",
60+
varsIgnorePattern: "^_",
61+
caughtErrorsIgnorePattern: "^_",
62+
},
63+
],
64+
65+
"@typescript-eslint/no-explicit-any": "warn",
66+
"@typescript-eslint/explicit-module-boundary-types": "off",
67+
},
68+
},
69+
{
70+
files: ["**/*.test.ts", "**/*.testdata.ts"],
71+
rules: { "@typescript-eslint/no-explicit-any": "off" },
72+
},
73+
{
74+
files: ["src/ui/*", "src/ui/**/*"],
75+
rules: {
76+
"@typescript-eslint/no-explicit-any": "off",
77+
"@typescript-eslint/no-unused-vars": "off",
78+
"no-console": ["error", { allow: ["warn", "error"] }],
79+
},
80+
},
81+
]);

package.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,58 +27,58 @@
2727
},
2828
"dependencies": {},
2929
"devDependencies": {
30-
"@eslint/compat": "^1.1.1",
31-
"@playwright/test": "^1.49.1",
32-
"@tsconfig/node22": "^22.0.0",
33-
"@types/node": "^22.1.0",
30+
"@eslint/compat": "^1.2.8",
31+
"@eslint/eslintrc": "^3.3.1",
32+
"@eslint/js": "^9.25.1",
33+
"@playwright/test": "^1.52.0",
34+
"@tsconfig/node22": "^22.0.1",
35+
"@types/node": "^22.15.2",
3436
"@types/pluralize": "^0.0.33",
35-
"@types/react": "^18.3.3",
36-
"@types/react-dom": "^18.3.0",
37-
"@types/supertest": "^6.0.2",
37+
"@types/react": "^19.1.2",
38+
"@types/react-dom": "^19.1.2",
39+
"@types/supertest": "^6.0.3",
3840
"@typescript-eslint/eslint-plugin": "^8.0.1",
3941
"@typescript-eslint/parser": "^8.0.1",
4042
"@vitejs/plugin-react": "^4.3.1",
41-
"@vitest/coverage-istanbul": "2.1.9",
42-
"@vitest/ui": "^2.0.5",
43+
"@vitest/coverage-istanbul": "3.1.2",
44+
"@vitest/ui": "^3.1.2",
4345
"aws-sdk-client-mock": "^4.1.0",
4446
"concurrently": "^9.1.2",
4547
"cross-env": "^7.0.3",
46-
"esbuild": "^0.23.0",
48+
"esbuild": "^0.25.3",
4749
"esbuild-plugin-copy": "^2.1.1",
48-
"eslint": "^8.57.0",
50+
"eslint": "^9.25.1",
4951
"eslint-config-airbnb": "^19.0.4",
5052
"eslint-config-airbnb-typescript": "^18.0.0",
5153
"eslint-config-esnext": "^4.1.0",
52-
"eslint-config-mantine": "^3.2.0",
53-
"eslint-config-prettier": "^9.1.0",
54-
"eslint-import-resolver-typescript": "^3.6.1",
54+
"eslint-config-mantine": "^4.0.3",
55+
"eslint-config-prettier": "^10.1.2",
56+
"eslint-import-resolver-typescript": "^4.3.4",
5557
"eslint-plugin-import": "^2.29.1",
5658
"eslint-plugin-jsx-a11y": "^6.9.0",
57-
"eslint-plugin-prettier": "^5.2.1",
58-
"eslint-plugin-react": "^7.35.0",
59-
"eslint-plugin-react-hooks": "^4.6.2",
59+
"eslint-plugin-prettier": "^5.2.6",
60+
"eslint-plugin-react": "^7.37.5",
61+
"eslint-plugin-react-hooks": "^5.2.0",
6062
"husky": "^9.1.4",
6163
"identity-obj-proxy": "^3.0.0",
62-
"jsdom": "^24.1.1",
64+
"jsdom": "^26.1.0",
6365
"node-ical": "^0.20.1",
64-
"postcss": "^8.4.41",
66+
"postcss": "^8.5.3",
6567
"postcss-preset-mantine": "^1.17.0",
6668
"postcss-simple-vars": "^7.0.1",
67-
"prettier": "^3.3.3",
69+
"prettier": "^3.5.3",
6870
"prop-types": "^15.8.1",
6971
"request": "^2.88.2",
70-
"storybook": "^8.2.8",
71-
"storybook-dark-mode": "^4.0.2",
72-
"stylelint": "^16.8.1",
73-
"stylelint-config-standard-scss": "^13.1.0",
74-
"supertest": "^7.0.0",
72+
"stylelint": "^16.19.1",
73+
"stylelint-config-standard-scss": "^14.0.0",
74+
"supertest": "^7.1.0",
7575
"synp": "^1.9.14",
76-
"tsx": "^4.16.5",
77-
"typescript": "^5.5.4",
78-
"typescript-eslint": "^8.0.1",
76+
"tsx": "^4.19.3",
77+
"typescript": "^5.8.3",
78+
"typescript-eslint": "^8.31.0",
7979
"vite-tsconfig-paths": "^5.0.1",
80-
"vitest": "^2.0.5",
81-
"yarn-upgrade-all": "^0.7.4"
80+
"vitest": "^3.1.2",
81+
"yarn-upgrade-all": "^0.7.5"
8282
},
8383
"resolutions": {
8484
"pdfjs-dist": "^4.8.69"

src/api/build.js

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import esbuild from "esbuild";
22
import { resolve } from "path";
3-
import { copy } from 'esbuild-plugin-copy'
4-
3+
import { copy } from "esbuild-plugin-copy";
54

65
const commonParams = {
76
bundle: true,
@@ -16,9 +15,22 @@ const commonParams = {
1615
target: "es2022", // Target ES2022
1716
sourcemap: false,
1817
platform: "node",
19-
external: ["aws-sdk", "moment-timezone", "passkit-generator", "fastify", "zod", "zod-openapi", "@fastify/swagger", "@fastify/swagger-ui", "argon2"],
18+
external: [
19+
"aws-sdk",
20+
"moment-timezone",
21+
"passkit-generator",
22+
"fastify",
23+
"zod",
24+
"zod-openapi",
25+
"@fastify/swagger",
26+
"@fastify/swagger-ui",
27+
"argon2",
28+
],
2029
alias: {
21-
'moment-timezone': resolve(process.cwd(), '../../node_modules/moment-timezone/builds/moment-timezone-with-data-10-year-range.js')
30+
"moment-timezone": resolve(
31+
process.cwd(),
32+
"../../node_modules/moment-timezone/builds/moment-timezone-with-data-10-year-range.js",
33+
),
2234
},
2335
banner: {
2436
js: `
@@ -33,22 +45,22 @@ const commonParams = {
3345
}, // Banner for compatibility with CommonJS
3446
plugins: [
3547
copy({
36-
resolveFrom: 'cwd',
48+
resolveFrom: "cwd",
3749
assets: {
38-
from: ['../../node_modules/@fastify/swagger-ui/static/*'],
39-
to: ['../../dist/lambda/static'],
50+
from: ["../../node_modules/@fastify/swagger-ui/static/*"],
51+
to: ["../../dist/lambda/static"],
4052
},
4153
}),
4254
copy({
43-
resolveFrom: 'cwd',
55+
resolveFrom: "cwd",
4456
assets: {
45-
from: ['./public/*'],
46-
to: ['../../dist/lambda/public'],
57+
from: ["./public/*"],
58+
to: ["../../dist/lambda/public"],
4759
},
4860
}),
4961
],
5062
inject: [resolve(process.cwd(), "./zod-openapi-patch.js")],
51-
}
63+
};
5264
esbuild
5365
.build({
5466
...commonParams,
@@ -62,7 +74,7 @@ esbuild
6274
process.exit(1);
6375
});
6476

65-
esbuild
77+
esbuild
6678
.build({
6779
...commonParams,
6880
entryPoints: ["api/sqs/index.js", "api/sqs/driver.js"],

src/api/components/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function withRoles<T extends FastifyZodOpenApiSchema>(
4747
"x-disable-api-key-auth": disableApiKeyAuth,
4848
description:
4949
roles.length > 0
50-
? `${disableApiKeyAuth ? "API key authentication is not permitted for this route.\n\n" : ""}Requires one of the following roles: ${roles.join(", ")}.${schema.description ? "\n\n" + schema.description : ""}`
50+
? `${disableApiKeyAuth ? "API key authentication is not permitted for this route.\n\n" : ""}Requires one of the following roles: ${roles.join(", ")}.${schema.description ? `\n\n${schema.description}` : ""}`
5151
: "Requires valid authentication but no specific role.",
5252
...schema,
5353
};

0 commit comments

Comments
 (0)