Skip to content

Commit 70c6c6f

Browse files
committed
update dependencies
1 parent 4ecf128 commit 70c6c6f

10 files changed

Lines changed: 1209 additions & 1241 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,16 @@
11
# Update the VARIANT arg in docker-compose.yml to pick a Node version: 10, 12, 14
2-
ARG VARIANT=18
3-
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
2+
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:24-trixie
43

54
# See https://github.com/microsoft/vscode-dev-containers/tree/master/containers/docker-from-docker for more documentation
65
# On how to use docker from within docker
76

8-
# Install Docker CE CLI
9-
RUN apt-get update \
10-
&& apt-get install -y apt-transport-https ca-certificates curl gnupg2 lsb-release \
11-
&& curl -fsSL https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/gpg | apt-key add - 2>/dev/null \
12-
&& echo "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list \
13-
&& apt-get update \
14-
&& apt-get install -y docker-ce-cli
15-
16-
# Install Docker Compose
17-
RUN LATEST_COMPOSE_VERSION=$(curl -sSL "https://api.github.com/repos/docker/compose/releases/latest" | grep -o -P '(?<="tag_name": ").+(?=")') \
18-
&& curl -sSL "https://github.com/docker/compose/releases/download/${LATEST_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \
19-
&& chmod +x /usr/local/bin/docker-compose
20-
217
# Update args in docker-compose.yaml to set the UID/GID of the "node" user.
228
ARG USER_UID=1000
239
ARG USER_GID=$USER_UID
10+
ENV USER_UID=${USER_UID}
11+
ENV USER_GID=${USER_GID}
2412
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then groupmod --gid $USER_GID node && usermod --uid $USER_UID --gid $USER_GID node; fi
2513

26-
# Add the node user to the docker group to access
27-
# the daemon without sudo
28-
RUN groupadd docker
29-
RUN usermod -a -G docker node
30-
3114
# Add minio CLI
3215
# See https://min.io/download#/linux
3316
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc \

.devcontainer/docker-compose.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ services:
1616
context: .
1717
dockerfile: Dockerfile
1818
args:
19-
VARIANT: 20
20-
USER_UID: 1000
21-
USER_GID: 1000
19+
# Use the default non-root user 1000
20+
# On MacOS: Add the line export UID="$(id -u $(whoami))" to your .zshrc
21+
USER_UID: '${UID:-1000}'
22+
USER_GID: '${UID:-1000}'
2223
networks:
2324
- imgproxy-url-builder-network
2425
volumes:

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v3
1212
- uses: actions/setup-node@v3
1313
with:
14-
node-version: '22.10.0'
14+
node-version: '24.11.1'
1515
- run: npm install
1616
- run: npm run build
1717
- run: npm run lint

.github/workflows/publish-npm-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v3
1818
- uses: actions/setup-node@v3
1919
with:
20-
node-version: '22.10.0'
20+
node-version: '24.11.1'
2121
registry-url: 'https://npm.pkg.github.com'
2222
scope: '@bitpatty'
2323
- run: npm install
@@ -36,7 +36,7 @@ jobs:
3636
- uses: actions/checkout@v3
3737
- uses: actions/setup-node@v3
3838
with:
39-
node-version: '22.10.0'
39+
node-version: '24.11.1'
4040
registry-url: 'https://registry.npmjs.org'
4141
- run: npm install
4242
- run: npm run build

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.10.0
1+
v24.11.1

eslint.config.mjs

Lines changed: 125 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { defineConfig, globalIgnores } from 'eslint/config';
2-
import typescriptEslint from '@typescript-eslint/eslint-plugin';
3-
import jest from 'eslint-plugin-jest';
4-
import prettier from 'eslint-plugin-prettier';
51
import globals from 'globals';
6-
import tsParser from '@typescript-eslint/parser';
2+
3+
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
4+
75
import path from 'node:path';
86
import { fileURLToPath } from 'node:url';
7+
98
import js from '@eslint/js';
109
import { FlatCompat } from '@eslint/eslintrc';
1110

@@ -17,51 +16,71 @@ const compat = new FlatCompat({
1716
allConfig: js.configs.all,
1817
});
1918

20-
export default defineConfig([
21-
globalIgnores([
22-
'coverage/**/*',
23-
'dist/**/*',
24-
'scripts/**/*',
25-
'**/*.sh',
26-
'coverage/**/*',
27-
'dist/**/*',
28-
'scripts/**/*',
29-
'**/*.sh',
30-
'**/rollup.config.js',
31-
'**/populate-readme.cjs',
32-
'eslint.config.mjs',
33-
]),
19+
export default [
3420
{
35-
extends: compat.extends(
36-
'eslint:recommended',
37-
'plugin:@typescript-eslint/eslint-recommended',
38-
'plugin:@typescript-eslint/recommended',
39-
'plugin:jest/recommended',
40-
'plugin:prettier/recommended',
41-
),
42-
43-
plugins: {
44-
'@typescript-eslint': typescriptEslint,
45-
jest,
46-
prettier,
47-
},
48-
21+
ignores: [
22+
'coverage/**/*',
23+
'dist/**/*',
24+
'scripts/**/*',
25+
'**/*.sh',
26+
'**/*.js',
27+
'eslint.config.mjs',
28+
],
29+
},
30+
...compat.extends(
31+
'eslint:recommended',
32+
'plugin:@typescript-eslint/eslint-recommended',
33+
'plugin:@typescript-eslint/recommended',
34+
'plugin:jest/recommended',
35+
'prettier',
36+
),
37+
{
38+
plugins: { '@typescript-eslint': typescriptPlugin },
4939
languageOptions: {
50-
globals: {
51-
...globals.node,
52-
},
53-
54-
parser: tsParser,
55-
ecmaVersion: 5,
56-
sourceType: 'commonjs',
57-
58-
parserOptions: {
59-
project: './tsconfig.json',
60-
tsconfigRootDir: './',
61-
},
40+
globals: { ...globals.node, ...globals.jest },
41+
parserOptions: { project: 'tsconfig.json', tsConfigRootDir: './' },
6242
},
63-
6443
rules: {
44+
/******************************************************************
45+
* Async / Promises
46+
******************************************************************/
47+
48+
// Don't allow a function to be async if there's no await
49+
'require-await': 'error',
50+
51+
// Don't allow returning await statements
52+
'no-return-await': 'error',
53+
54+
// Prevent unreachable code
55+
'no-unreachable': 'error',
56+
57+
// Don't allow awaiting calls that are not thenable
58+
// (such as example promises)
59+
'@typescript-eslint/await-thenable': 'error',
60+
61+
//
62+
'@typescript-eslint/no-floating-promises': 'error',
63+
64+
// Prevent promises from being used ad illogical locations
65+
// such as in if statements, as this is usually forgetting an await
66+
'@typescript-eslint/no-misused-promises': 'error',
67+
68+
/******************************************************************
69+
* Classes
70+
******************************************************************/
71+
72+
// Always declare accessibility of class members (public, private, ...)
73+
'@typescript-eslint/explicit-member-accessibility': 'error',
74+
75+
// Don't allow unused methods/attributes in classes
76+
// that are not public
77+
'no-unused-private-class-members': 'error',
78+
79+
/******************************************************************
80+
* Misc
81+
******************************************************************/
82+
83+
// Always require a return type on methods
6584
'@typescript-eslint/explicit-function-return-type': [
6685
'error',
6786
{
@@ -70,37 +89,77 @@ export default defineConfig([
7089
},
7190
],
7291

73-
'@typescript-eslint/no-floating-promises': ['error'],
74-
'@typescript-eslint/no-shadow': ['error'],
75-
'@typescript-eslint/explicit-member-accessibility': ['error'],
76-
'no-console': ['error'],
77-
'no-return-await': ['error'],
92+
// Don't allow for..in loops (should generally be for..of)
93+
'@typescript-eslint/no-for-in-array': 'error',
94+
95+
// Warn when working with deprecated code
96+
'@typescript-eslint/no-deprecated': 'error',
97+
98+
// Don't require explicit argument typings but warn if they
99+
// have not been provided
100+
'@typescript-eslint/explicit-module-boundary-types': 'warn',
78101

79-
'padding-line-between-statements': [
102+
// Don't allow the use of `any`
103+
'@typescript-eslint/no-explicit-any': 'off',
104+
105+
// Ensure all cases are handled in a switch
106+
'@typescript-eslint/switch-exhaustiveness-check': [
80107
'error',
81-
{
82-
blankLine: 'always',
83-
prev: '*',
84-
next: 'function',
85-
},
108+
{ considerDefaultExhaustiveForUnions: true },
86109
],
87110

88-
'prettier/prettier': [
111+
// Don't allow shadowing of variables (i.e. redeclaring a
112+
// variable with the same name)
113+
'@typescript-eslint/no-shadow': 'error',
114+
115+
// Only allow toString to be called on values where
116+
// it makes sense
117+
'@typescript-eslint/no-base-to-string': 'error',
118+
119+
// Require variable initialization
120+
// Only use the typescript-eslint version
121+
'init-declarations': 'off',
122+
'@typescript-eslint/init-declarations': 'error',
123+
124+
// Don't allow unused variables unless they start with _
125+
// Only use the typescript-eslint version
126+
'no-unused-vars': 'off',
127+
'@typescript-eslint/no-unused-vars': [
89128
'error',
90-
{},
91-
{
92-
usePrettierrc: true,
93-
},
129+
{ args: 'all', argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
94130
],
95131

96-
'require-await': ['error'],
132+
// Don't allow unused expressions unless they start with _
133+
// Only use typescript-eslint version
134+
'no-unused-expressions': 'off',
135+
'@typescript-eslint/no-unused-expressions': 'error',
136+
137+
// Don't allow ts-comments
138+
'@typescript-eslint/ban-ts-comment': 'error',
139+
140+
// Warn on deprecations
141+
'@typescript-eslint/no-deprecated': 'warn',
97142
},
98143
},
99144
{
100-
files: ['test/**/*.js'],
145+
files: ['test/**'],
146+
rules: {
147+
// Allow non-null assertions in test files
148+
'@typescript-eslint/no-non-null-assertion': 'off',
101149

150+
// Don't require intialization in test files
151+
'init-declarations': 'off',
152+
'@typescript-eslint/init-declarations': 'off',
153+
},
154+
},
155+
{
156+
files: ['mock-server/**'],
102157
rules: {
103-
'@typescript-eslint/explicit-function-return-type': 'off',
158+
// Allow non-boolan statements
159+
'@typescript-eslint/strict-boolean-expressions': 'off',
160+
161+
// Allow returning promises where no promises are expected
162+
'@typescript-eslint/no-misused-promises': 'off',
104163
},
105164
},
106-
]);
165+
];

0 commit comments

Comments
 (0)