Skip to content

Commit 28402db

Browse files
authored
Merge branch 'main' into backend_unused_code
2 parents 08db31f + b669448 commit 28402db

27 files changed

Lines changed: 420 additions & 58 deletions

File tree

.github/workflows/backend.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,3 @@ jobs:
2929
- uses: extractions/setup-just@v1
3030
- name: license checker
3131
run: 'cd backend && npx license-checker --onlyAllow="MIT;ISC;Python-2.0;Apache-2.0;BSD;MPL;CC;Custom: http://github.com/dscape/statsd-parser;" --excludePrivatePackages'
32-
lint:
33-
runs-on:
34-
labels: ubuntu-latest-4-cores
35-
steps:
36-
- uses: actions/checkout@v3
37-
- uses: extractions/setup-just@v1
38-
- uses: actions/setup-node@v3
39-
with:
40-
node-version: '18'
41-
- run: cd backend && yarn install
42-
- run: cd backend && yarn run lint

.github/workflows/code-quality.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Code quality
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
quality:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v5
15+
with:
16+
persist-credentials: false
17+
- name: Setup Biome
18+
uses: biomejs/setup-biome@v2
19+
with:
20+
version: latest
21+
- name: Run Biome
22+
run: biome ci --formatter-enabled=false --assist-enabled=false .

autoadmin-ws-server/src/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
'use strict';
21
import express, { Router, json } from 'express';
32
import axios from 'axios';
43
const app = express();

backend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"start:dev": "nest start --watch --preserveWatchOutput",
1515
"start:debug": "nest start --debug --watch",
1616
"start:prod": "node dist/main",
17-
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
1817
"test": "ava test/ava-tests/non-saas-tests/* --serial",
1918
"test-all": "ava --timeout=5m",
2019
"test-saas": "ava test/ava-tests/saas-tests/* ",

backend/src/exceptions/custom-exceptions/validation-exception.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ export class ValidationException extends HttpException {
1515
).join(', ')}`;
1616
})
1717
.join('.\n');
18-
} else {
19-
originalMessage = originalMessage;
2018
}
2119
super(originalMessage, HttpStatus.BAD_REQUEST);
2220
this.internalCode = ExceptionsInternalCodes.VALIDATOR_EXCEPTION;

backend/src/helpers/constants/constants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const Constants = {
9292
},
9393

9494
ONE_DAY_AGO: (): Date => {
95-
return new Date(new Date().getTime() - 24 * 60 * 60 * 1000);
95+
return new Date(Date.now() - 24 * 60 * 60 * 1000);
9696
},
9797

9898
CRON_SHEDULE: '30 5 13 * * *',
@@ -274,6 +274,7 @@ export const Constants = {
274274
// break;
275275
case type.toLowerCase().includes('dynamodb'):
276276
connection = parseTestDynamoDBConnectionString(connection_string) as CreateConnectionDto;
277+
break;
277278
default:
278279
break;
279280
}

backend/src/helpers/encryption/encryptor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,17 @@ export class Encryptor {
140140
hash = CryptoJS.SHA384(data);
141141
return hash.toString(CryptoJS.enc.Hex);
142142

143-
case EncryptionAlgorithmEnum.pbkdf2:
143+
case EncryptionAlgorithmEnum.pbkdf2: {
144144
const salt = CryptoJS.lib.WordArray.random(128 / 8);
145145
return CryptoJS.PBKDF2(data, salt, {
146146
keySize: 256 / 32,
147147
}).toString();
148+
}
148149

149-
case EncryptionAlgorithmEnum.bcrypt:
150+
case EncryptionAlgorithmEnum.bcrypt: {
150151
const bSalt = await bcrypt.genSalt();
151152
return await bcrypt.hash(data, bSalt);
153+
}
152154

153155
case EncryptionAlgorithmEnum.argon2:
154156
return await argon2.hash(data);

backend/src/helpers/validators/validation-helper.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ export class ValidationHelper {
5656
return countries.isValid(countryCode);
5757
}
5858

59-
public isValidUrl(url: string): boolean {
60-
return validator.isURL(url);
61-
}
62-
6359
public static validateOrThrowHttpExceptionEmail(email: string): boolean {
6460
const isEmailValid = ValidationHelper.isValidEmail(email);
6561
if (isEmailValid) {

backend/test/mock.factory.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,11 @@ export class MockFactory {
335335
return this.generateConnectionToSchemaOracleDBInDocker();
336336
case 'mssql':
337337
return this.generateConnectionToTestMsSQlDBInDocker();
338-
case 'mysql':
338+
case 'mysql': {
339339
const config = this.generateConnectionToTestMySQLDBInDocker();
340340
config.type = 'mysql2';
341341
return config;
342+
}
342343
}
343344
}
344345

biome.json

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": false
10+
},
11+
"formatter": {
12+
"enabled": true,
13+
"indentStyle": "tab"
14+
},
15+
"linter": {
16+
"enabled": true,
17+
"rules": {
18+
"recommended": false,
19+
"a11y": {
20+
"noAccessKey": "error",
21+
"noAriaHiddenOnFocusable": "error",
22+
"noAriaUnsupportedElements": "error",
23+
"noAutofocus": "error",
24+
"noDistractingElements": "error",
25+
"noHeaderScope": "error",
26+
"noInteractiveElementToNoninteractiveRole": "error",
27+
"noLabelWithoutControl": "error",
28+
"noNoninteractiveElementToInteractiveRole": "error",
29+
"noNoninteractiveTabindex": "error",
30+
"noPositiveTabindex": "error",
31+
"noRedundantAlt": "error",
32+
"noRedundantRoles": "error",
33+
"noStaticElementInteractions": "error",
34+
"noSvgWithoutTitle": "error",
35+
"useAltText": "error",
36+
"useAnchorContent": "error",
37+
"useAriaActivedescendantWithTabindex": "error",
38+
"useAriaPropsForRole": "error",
39+
"useAriaPropsSupportedByRole": "error",
40+
"useButtonType": "error",
41+
"useFocusableInteractive": "error",
42+
"useHeadingContent": "error",
43+
"useHtmlLang": "error",
44+
"useIframeTitle": "error",
45+
"useKeyWithClickEvents": "error",
46+
"useKeyWithMouseEvents": "error",
47+
"useMediaCaption": "error",
48+
"useSemanticElements": "error",
49+
"useValidAnchor": "error",
50+
"useValidAriaProps": "error",
51+
"useValidAriaRole": "error",
52+
"useValidAriaValues": "error",
53+
"useValidAutocomplete": "error",
54+
"useValidLang": "error"
55+
},
56+
"complexity": {
57+
"noAdjacentSpacesInRegex": "error",
58+
"noArguments": "error",
59+
"noBannedTypes": "off",
60+
"noCommaOperator": "off",
61+
"noEmptyTypeParameters": "error",
62+
"noExtraBooleanCast": "error",
63+
"noFlatMapIdentity": "error",
64+
"noStaticOnlyClass": "off",
65+
"noThisInStatic": "off",
66+
"noUselessCatch": "off",
67+
"noUselessConstructor": "off",
68+
"noUselessContinue": "off",
69+
"noUselessEmptyExport": "error",
70+
"noUselessEscapeInRegex": "error",
71+
"noUselessFragments": "error",
72+
"noUselessLabel": "error",
73+
"noUselessLoneBlockStatements": "error",
74+
"noUselessRename": "error",
75+
"noUselessStringRaw": "error",
76+
"noUselessSwitchCase": "error",
77+
"noUselessTernary": "off",
78+
"noUselessThisAlias": "error",
79+
"noUselessTypeConstraint": "error",
80+
"noUselessUndefinedInitialization": "off",
81+
"noVoid": "error",
82+
"useArrowFunction": "off",
83+
"useDateNow": "error",
84+
"useFlatMap": "off",
85+
"useIndexOf": "off",
86+
"useLiteralKeys": "off",
87+
"useNumericLiterals": "error",
88+
"useOptionalChain": "off",
89+
"useRegexLiterals": "error",
90+
"useSimpleNumberKeys": "error"
91+
},
92+
"correctness": {
93+
"noConstAssign": "error",
94+
"noConstantCondition": "error",
95+
"noConstantMathMinMaxClamp": "error",
96+
"noConstructorReturn": "error",
97+
"noEmptyCharacterClassInRegex": "error",
98+
"noEmptyPattern": "error",
99+
"noGlobalObjectCalls": "error",
100+
"noInnerDeclarations": "error",
101+
"noInvalidBuiltinInstantiation": "error",
102+
"noInvalidConstructorSuper": "error",
103+
"noInvalidUseBeforeDeclaration": "off",
104+
"noNonoctalDecimalEscape": "error",
105+
"noPrecisionLoss": "error",
106+
"noSelfAssign": "error",
107+
"noSetterReturn": "error",
108+
"noStringCaseMismatch": "error",
109+
"noSwitchDeclarations": "error",
110+
"noUnreachable": "error",
111+
"noUnreachableSuper": "error",
112+
"noUnsafeFinally": "error",
113+
"noUnsafeOptionalChaining": "error",
114+
"noUnusedFunctionParameters": "off",
115+
"noUnusedImports": "off",
116+
"noUnusedLabels": "error",
117+
"noUnusedPrivateClassMembers": "off",
118+
"noUnusedVariables": "off",
119+
"noVoidElementsWithChildren": "error",
120+
"noVoidTypeReturn": "error",
121+
"useIsNan": "error",
122+
"useParseIntRadix": "off",
123+
"useValidForDirection": "error",
124+
"useValidTypeof": "error",
125+
"useYield": "error"
126+
},
127+
"performance": {
128+
"noAccumulatingSpread": "error",
129+
"noDynamicNamespaceImportAccess": "error"
130+
},
131+
"security": {
132+
"noBlankTarget": "error",
133+
"noGlobalEval": "error"
134+
},
135+
"suspicious": {
136+
"noApproximativeNumericConstant": "error",
137+
"noAssignInExpressions": "off",
138+
"noAsyncPromiseExecutor": "off",
139+
"noCatchAssign": "error",
140+
"noClassAssign": "error",
141+
"noCommentText": "error",
142+
"noCompareNegZero": "error",
143+
"noConfusingLabels": "error",
144+
"noConfusingVoidType": "off",
145+
"noConstEnum": "error",
146+
"noControlCharactersInRegex": "off",
147+
"noDebugger": "error",
148+
"noDocumentCookie": "off",
149+
"noDoubleEquals": "off",
150+
"noDuplicateCase": "error",
151+
"noDuplicateClassMembers": "error",
152+
"noDuplicateElseIf": "error",
153+
"noDuplicateJsxProps": "error",
154+
"noDuplicateObjectKeys": "error",
155+
"noDuplicateParameters": "error",
156+
"noEmptyInterface": "error",
157+
"noExplicitAny": "off",
158+
"noExtraNonNullAssertion": "error",
159+
"noFallthroughSwitchClause": "error",
160+
"noFunctionAssign": "error",
161+
"noGlobalAssign": "error",
162+
"noGlobalIsFinite": "error",
163+
"noGlobalIsNan": "off",
164+
"noHeadImportInDocument": "error",
165+
"noImplicitAnyLet": "off",
166+
"noImportAssign": "error",
167+
"noIrregularWhitespace": "error",
168+
"noLabelVar": "error",
169+
"noMisleadingCharacterClass": "error",
170+
"noMisleadingInstantiator": "error",
171+
"noMisrefactoredShorthandAssign": "error",
172+
"noNonNullAssertedOptionalChain": "error",
173+
"noOctalEscape": "error",
174+
"noPrototypeBuiltins": "off",
175+
"noRedeclare": "error",
176+
"noRedundantUseStrict": "error",
177+
"noSelfCompare": "error",
178+
"noShadowRestrictedNames": "error",
179+
"noSparseArray": "error",
180+
"noSuspiciousSemicolonInJsx": "error",
181+
"noTemplateCurlyInString": "error",
182+
"noThenProperty": "error",
183+
"noTsIgnore": "off",
184+
"noUnsafeDeclarationMerging": "error",
185+
"noUnsafeNegation": "error",
186+
"noUselessEscapeInString": "error",
187+
"noUselessRegexBackrefs": "error",
188+
"noWith": "error",
189+
"useAdjacentOverloadSignatures": "error",
190+
"useAwait": "off",
191+
"useDefaultSwitchClauseLast": "error",
192+
"useGetterReturn": "error",
193+
"useGoogleFontDisplay": "error",
194+
"useIsArray": "error",
195+
"useIterableCallbackReturn": "off",
196+
"useNamespaceKeyword": "error"
197+
198+
}
199+
}
200+
},
201+
"javascript": {
202+
"formatter": {
203+
"quoteStyle": "double"
204+
},
205+
"parser": {
206+
"unsafeParameterDecoratorsEnabled": true
207+
}
208+
},
209+
"html": {
210+
"parser": {
211+
"interpolation": true
212+
}
213+
},
214+
"assist": {
215+
"enabled": true,
216+
"actions": {
217+
"source": {
218+
"organizeImports": "on"
219+
}
220+
}
221+
}
222+
}

0 commit comments

Comments
 (0)