Skip to content

Commit af0de1a

Browse files
authored
chore: linting (#7532)
* chore: linting * fix: broken tests * fix: formatting
1 parent 09a7291 commit af0de1a

33 files changed

+2633
-701
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ max_line_length = off
1616
trim_trailing_whitespace = false
1717

1818
[*.{yml,yaml}]
19-
quote_type = double
19+
quote_type = single

.github/workflows/test.yml

+20-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Checkout code
3636
uses: actions/checkout@v4
3737
with:
38-
submodules: "recursive"
38+
submodules: 'recursive'
3939

4040
- name: Run e2e tests
4141
run: make server-e2e-jobs
@@ -184,7 +184,7 @@ jobs:
184184
- name: Checkout code
185185
uses: actions/checkout@v4
186186
with:
187-
submodules: "recursive"
187+
submodules: 'recursive'
188188

189189
- name: Setup Node
190190
uses: actions/setup-node@v4
@@ -194,25 +194,40 @@ jobs:
194194
- name: Run setup typescript-sdk
195195
run: npm ci && npm run build
196196
working-directory: ./open-api/typescript-sdk
197+
if: ${{ !cancelled() }}
197198

198199
- name: Run setup cli
199200
run: npm ci && npm run build
200201
working-directory: ./cli
202+
if: ${{ !cancelled() }}
201203

202204
- name: Install dependencies
203205
run: npm ci
206+
if: ${{ !cancelled() }}
207+
208+
- name: Run linter
209+
run: npm run lint
210+
if: ${{ !cancelled() }}
211+
212+
- name: Run formatter
213+
run: npm run format
214+
if: ${{ !cancelled() }}
204215

205216
- name: Install Playwright Browsers
206217
run: npx playwright install --with-deps chromium
218+
if: ${{ !cancelled() }}
207219

208220
- name: Docker build
209221
run: docker compose build
222+
if: ${{ !cancelled() }}
210223

211224
- name: Run e2e tests (api & cli)
212225
run: npm run test
226+
if: ${{ !cancelled() }}
213227

214228
- name: Run e2e tests (web)
215229
run: npx playwright test
230+
if: ${{ !cancelled() }}
216231

217232
mobile-unit-tests:
218233
name: Mobile
@@ -222,8 +237,8 @@ jobs:
222237
- name: Setup Flutter SDK
223238
uses: subosito/flutter-action@v2
224239
with:
225-
channel: "stable"
226-
flutter-version: "3.16.9"
240+
channel: 'stable'
241+
flutter-version: '3.16.9'
227242
- name: Run tests
228243
working-directory: ./mobile
229244
run: flutter test -j 1
@@ -241,7 +256,7 @@ jobs:
241256
- uses: actions/setup-python@v5
242257
with:
243258
python-version: 3.11
244-
cache: "poetry"
259+
cache: 'poetry'
245260
- name: Install dependencies
246261
run: |
247262
poetry install --with dev --with cpu

docker/docker-compose.dev.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# - https://immich.app/docs/developer/setup
33
# - https://immich.app/docs/developer/troubleshooting
44

5-
version: "3.8"
5+
version: '3.8'
66

77
name: immich-dev
88

@@ -30,7 +30,7 @@ x-server-build: &server-common
3030
services:
3131
immich-server:
3232
container_name: immich_server
33-
command: [ "/usr/src/app/bin/immich-dev", "immich" ]
33+
command: ['/usr/src/app/bin/immich-dev', 'immich']
3434
<<: *server-common
3535
ports:
3636
- 3001:3001
@@ -41,7 +41,7 @@ services:
4141

4242
immich-microservices:
4343
container_name: immich_microservices
44-
command: [ "/usr/src/app/bin/immich-dev", "microservices" ]
44+
command: ['/usr/src/app/bin/immich-dev', 'microservices']
4545
<<: *server-common
4646
# extends:
4747
# file: hwaccel.transcoding.yml
@@ -57,7 +57,7 @@ services:
5757
image: immich-web-dev:latest
5858
build:
5959
context: ../web
60-
command: [ "/usr/src/app/bin/immich-web" ]
60+
command: ['/usr/src/app/bin/immich-web']
6161
env_file:
6262
- .env
6363
ports:

docker/docker-compose.prod.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "3.8"
1+
version: '3.8'
22

33
name: immich-prod
44

@@ -17,7 +17,7 @@ x-server-build: &server-common
1717
services:
1818
immich-server:
1919
container_name: immich_server
20-
command: [ "start.sh", "immich" ]
20+
command: ['start.sh', 'immich']
2121
<<: *server-common
2222
ports:
2323
- 2283:3001
@@ -27,7 +27,7 @@ services:
2727

2828
immich-microservices:
2929
container_name: immich_microservices
30-
command: [ "start.sh", "microservices" ]
30+
command: ['start.sh', 'microservices']
3131
<<: *server-common
3232
# extends:
3333
# file: hwaccel.transcoding.yml

docker/docker-compose.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "3.8"
1+
version: '3.8'
22

33
#
44
# WARNING: Make sure to use the docker-compose.yml of the current release:
@@ -14,7 +14,7 @@ services:
1414
immich-server:
1515
container_name: immich_server
1616
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
17-
command: [ "start.sh", "immich" ]
17+
command: ['start.sh', 'immich']
1818
volumes:
1919
- ${UPLOAD_LOCATION}:/usr/src/app/upload
2020
- /etc/localtime:/etc/localtime:ro
@@ -33,7 +33,7 @@ services:
3333
# extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding
3434
# file: hwaccel.transcoding.yml
3535
# service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
36-
command: [ "start.sh", "microservices" ]
36+
command: ['start.sh', 'microservices']
3737
volumes:
3838
- ${UPLOAD_LOCATION}:/usr/src/app/upload
3939
- /etc/localtime:/etc/localtime:ro

e2e/.eslintrc.cjs

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
project: 'tsconfig.json',
5+
sourceType: 'module',
6+
tsconfigRootDir: __dirname,
7+
},
8+
plugins: ['@typescript-eslint/eslint-plugin'],
9+
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', 'plugin:unicorn/recommended'],
10+
root: true,
11+
env: {
12+
node: true,
13+
},
14+
ignorePatterns: ['.eslintrc.js'],
15+
rules: {
16+
'@typescript-eslint/interface-name-prefix': 'off',
17+
'@typescript-eslint/explicit-function-return-type': 'off',
18+
'@typescript-eslint/explicit-module-boundary-types': 'off',
19+
'@typescript-eslint/no-explicit-any': 'off',
20+
'@typescript-eslint/no-floating-promises': 'error',
21+
'unicorn/prefer-module': 'off',
22+
curly: 2,
23+
'prettier/prettier': 0,
24+
'unicorn/prevent-abbreviations': 'off',
25+
'unicorn/filename-case': 'off',
26+
'unicorn/no-null': 'off',
27+
'unicorn/prefer-top-level-await': 'off',
28+
'unicorn/prefer-event-target': 'off',
29+
'unicorn/no-thenable': 'off',
30+
},
31+
};

e2e/.prettierignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/package
5+
.env
6+
.env.*
7+
!.env.example
8+
*.md
9+
*.json
10+
coverage
11+
dist
12+
13+
# Ignore files for PNPM, NPM and YARN
14+
pnpm-lock.yaml
15+
package-lock.json
16+
yarn.lock

e2e/.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 120,
5+
"semi": true,
6+
"organizeImportsSkipDestructiveCodeActions": true,
7+
"plugins": ["prettier-plugin-organize-imports"]
8+
}

e2e/docker-compose.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "3.8"
1+
version: '3.8'
22

33
name: immich-e2e
44

@@ -23,14 +23,14 @@ x-server-build: &server-common
2323
services:
2424
immich-server:
2525
container_name: immich-e2e-server
26-
command: [ "./start.sh", "immich" ]
26+
command: ['./start.sh', 'immich']
2727
<<: *server-common
2828
ports:
2929
- 2283:3001
3030

3131
immich-microservices:
3232
container_name: immich-e2e-microservices
33-
command: [ "./start.sh", "microservices" ]
33+
command: ['./start.sh', 'microservices']
3434
<<: *server-common
3535

3636
redis:

0 commit comments

Comments
 (0)