Skip to content

Commit 951a6a7

Browse files
chore: upgrade eslint, update deps, husky, ci setup
1 parent 05dd714 commit 951a6a7

File tree

10 files changed

+176
-1626
lines changed

10 files changed

+176
-1626
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ aliases:
77
- &install-deps
88
run:
99
name: Install dependencies
10-
command: npm ci --ignore-scripts
10+
command: npm install --ignore-scripts
1111
- &build-packages
1212
run:
1313
name: Build
@@ -24,7 +24,7 @@ jobs:
2424
key: dependency-cache-{{ checksum "package.json" }}
2525
- run:
2626
name: Install dependencies
27-
command: npm ci --ignore-scripts
27+
command: npm install --ignore-scripts
2828
- save_cache:
2929
key: dependency-cache-{{ checksum "package.json" }}
3030
paths:

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

.husky/commit-msg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx --no-install commitlint --edit $1

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx --no-install lint-staged

eslint.config.mjs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// @ts-check
2+
import eslint from '@eslint/js';
3+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
4+
import globals from 'globals';
5+
import tseslint from 'typescript-eslint';
6+
7+
export default tseslint.config(
8+
{
9+
ignores: ['tests/**'],
10+
},
11+
eslint.configs.recommended,
12+
...tseslint.configs.recommendedTypeChecked,
13+
eslintPluginPrettierRecommended,
14+
{
15+
languageOptions: {
16+
globals: {
17+
...globals.node,
18+
...globals.jest,
19+
},
20+
ecmaVersion: 5,
21+
sourceType: 'module',
22+
parserOptions: {
23+
projectService: true,
24+
tsconfigRootDir: import.meta.dirname,
25+
},
26+
},
27+
},
28+
{
29+
rules: {
30+
'@typescript-eslint/no-explicit-any': 'off',
31+
'@typescript-eslint/no-unsafe-assignment': 'off',
32+
'@typescript-eslint/no-unsafe-call': 'off',
33+
'@typescript-eslint/no-unsafe-member-access': 'off',
34+
'@typescript-eslint/no-unsafe-function-type': 'off',
35+
'@typescript-eslint/no-unsafe-argument': 'off',
36+
'@typescript-eslint/no-unsafe-return': 'off',
37+
'@typescript-eslint/no-require-imports': 'off',
38+
'@typescript-eslint/no-unused-expressions': 'warn'
39+
},
40+
},
41+
);

lib/intersection-type.helper.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ export function IntersectionType<T extends Type[]>(...classRefs: T) {
4444

4545
classRefs.forEach((classRef) => {
4646
inheritValidationMetadata(classRef, IntersectionClassType);
47-
inheritTransformationMetadata(classRef, IntersectionClassType, undefined, false);
47+
inheritTransformationMetadata(
48+
classRef,
49+
IntersectionClassType,
50+
undefined,
51+
false,
52+
);
4853
});
4954

5055
const intersectedNames = classRefs.reduce((prev, ref) => prev + ref.name, '');

lib/type-helpers.utils.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Logger, Type } from '@nestjs/common';
22

3-
/* eslint-disable @typescript-eslint/no-var-requires */
43
const logger = new Logger('MappedTypes');
54

65
export function applyIsOptionalDecorator(
@@ -95,7 +94,7 @@ export function inheritTransformationMetadata(
9594
parentClass: Type<any>,
9695
targetClass: Function,
9796
isPropertyInherited?: (key: string) => boolean,
98-
stackDecorators = true
97+
stackDecorators = true,
9998
) {
10099
if (!isClassTransformerAvailable()) {
101100
return;
@@ -113,7 +112,7 @@ export function inheritTransformationMetadata(
113112
parentClass,
114113
targetClass,
115114
isPropertyInherited,
116-
stackDecorators
115+
stackDecorators,
117116
),
118117
);
119118
} catch (err) {
@@ -231,5 +230,7 @@ export function inheritPropertyInitializers(
231230
.forEach((propertyName) => {
232231
target[propertyName] = tempInstance[propertyName];
233232
});
234-
} catch {}
233+
} catch {
234+
// Ignore errors
235+
}
235236
}

0 commit comments

Comments
 (0)