From 431e3df61b01445bc3aecef4de561c2830245b7f Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Mon, 19 May 2025 11:42:26 +0200 Subject: [PATCH] chore: linting and build fixes Signed-off-by: Erik Michelson --- .../src/api/private/notes/notes.controller.ts | 1 + database/.eslintrc.cjs | 47 ++++++------------- database/src/types/authorship-info.ts | 1 - database/tsconfig.test.json | 2 +- 4 files changed, 17 insertions(+), 34 deletions(-) diff --git a/backend/src/api/private/notes/notes.controller.ts b/backend/src/api/private/notes/notes.controller.ts index 9f970b262..c9dffd757 100644 --- a/backend/src/api/private/notes/notes.controller.ts +++ b/backend/src/api/private/notes/notes.controller.ts @@ -202,6 +202,7 @@ export class NotesController { @RequestNoteId() noteId: number, @Param('username') username: NoteUserPermissionEntryDto['username'], ): Promise { + // TODO Fix this removing wrong user permission! try { await this.permissionService.removeUserPermission(noteId, userId); return await this.noteService.toNotePermissionsDto(noteId); diff --git a/database/.eslintrc.cjs b/database/.eslintrc.cjs index 90db6a39d..bbb314774 100644 --- a/database/.eslintrc.cjs +++ b/database/.eslintrc.cjs @@ -5,36 +5,19 @@ */ module.exports = { - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": [ - "./tsconfig.test.json" - ] - }, - "plugins": [ - "@typescript-eslint", - "jest", - "prettier" - ], - "env": { - "jest": true, - "jest/globals": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - "plugin:@typescript-eslint/recommended", - "prettier" - ], - "rules": { - "prettier/prettier": ["error", - require('./.prettierrc.json') - ], - "jest/no-disabled-tests": "warn", - "jest/no-focused-tests": "error", - "jest/no-identical-title": "error", - "jest/prefer-to-have-length": "warn", - "jest/valid-expect": "error" - } + parser: '@typescript-eslint/parser', + parserOptions: { + project: ['./tsconfig.test.json'], + }, + plugins: ['@typescript-eslint', 'prettier'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + 'plugin:@typescript-eslint/recommended', + 'prettier', + ], + rules: { + 'prettier/prettier': ['error', require('./.prettierrc.json')], + }, } diff --git a/database/src/types/authorship-info.ts b/database/src/types/authorship-info.ts index 0c8996222..970f59359 100644 --- a/database/src/types/authorship-info.ts +++ b/database/src/types/authorship-info.ts @@ -3,7 +3,6 @@ * * SPDX-License-Identifier: AGPL-3.0-only */ -import { FieldNameApiToken } from './api-token' /** * The AuthorshipInfo holds the information from where to where one {@link User} has changed a {@link Note} diff --git a/database/tsconfig.test.json b/database/tsconfig.test.json index 67bc6edb2..23ca2cfd7 100644 --- a/database/tsconfig.test.json +++ b/database/tsconfig.test.json @@ -1,4 +1,4 @@ { - "extends" : "./tsconfig.esm.json", + "extends" : "./tsconfig.cjs.json", "exclude": ["./dist"] }