From 73d8f6163dade24b6bee010e9261a35b3b4dd09b Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 10 Mar 2023 15:47:05 +0100 Subject: [PATCH] more lint rules eslint-import-plugin --- backend/.eslintrc.js | 4 ++++ backend/jest.config.js | 1 + backend/src/graphql/resolver/UserResolver.ts | 4 ++-- backend/src/password/EncryptorUtils.ts | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/.eslintrc.js b/backend/.eslintrc.js index bb03a23fa..d816c4a42 100644 --- a/backend/.eslintrc.js +++ b/backend/.eslintrc.js @@ -1,3 +1,4 @@ +// eslint-disable-next-line import/no-commonjs module.exports = { root: true, env: { @@ -37,6 +38,9 @@ module.exports = { 'import/no-deprecated': 'error', 'import/no-empty-named-blocks': 'error', 'import/no-mutable-exports': 'error', + 'import/no-unused-modules': 'error', + 'import/no-commonjs': 'error', + 'import/no-import-module-exports': 'error', }, overrides: [ // only for ts files diff --git a/backend/jest.config.js b/backend/jest.config.js index d6683d292..f76e0e5a9 100644 --- a/backend/jest.config.js +++ b/backend/jest.config.js @@ -1,4 +1,5 @@ /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ +// eslint-disable-next-line import/no-commonjs module.exports = { verbose: true, preset: 'ts-jest', diff --git a/backend/src/graphql/resolver/UserResolver.ts b/backend/src/graphql/resolver/UserResolver.ts index 078a29a8e..8f9852d9a 100644 --- a/backend/src/graphql/resolver/UserResolver.ts +++ b/backend/src/graphql/resolver/UserResolver.ts @@ -69,9 +69,9 @@ import { PasswordEncryptionType } from '../enum/PasswordEncryptionType' import LogError from '@/server/LogError' import { EventProtocolType } from '@/event/EventProtocolType' -// eslint-disable-next-line @typescript-eslint/no-var-requires +// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-commonjs const sodium = require('sodium-native') -// eslint-disable-next-line @typescript-eslint/no-var-requires +// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-commonjs const random = require('random-bigint') const LANGUAGES = ['de', 'en', 'es', 'fr', 'nl'] diff --git a/backend/src/password/EncryptorUtils.ts b/backend/src/password/EncryptorUtils.ts index 4c802a86f..4f6238674 100644 --- a/backend/src/password/EncryptorUtils.ts +++ b/backend/src/password/EncryptorUtils.ts @@ -7,7 +7,7 @@ import { backendLogger as logger } from '@/server/logger' import { User } from '@entity/User' import { PasswordEncryptionType } from '@enum/PasswordEncryptionType' -// eslint-disable-next-line @typescript-eslint/no-var-requires +// eslint-disable-next-line @typescript-eslint/no-var-requires, import/no-commonjs const sodium = require('sodium-native') // We will reuse this for changePassword