Skip to content

Commit

Permalink
chore: upgrade eslint, update deps, ci setup
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Jan 17, 2025
1 parent 1c54dde commit a1225db
Show file tree
Hide file tree
Showing 12 changed files with 278 additions and 2,218 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ aliases:
- &install-deps
run:
name: Install dependencies
command: npm ci --ignore-scripts
command: npm install --ignore-scripts
- &build-packages
run:
name: Build
Expand All @@ -24,7 +24,7 @@ jobs:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Install dependencies
command: npm ci --ignore-scripts
command: npm install --ignore-scripts
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
Expand Down
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

25 changes: 0 additions & 25 deletions .eslintrc.js

This file was deleted.

40 changes: 40 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// @ts-check
import eslint from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
ignores: ['tests/**'],
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintPluginPrettierRecommended,
{
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
ecmaVersion: 5,
sourceType: 'module',
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-base-to-string': 'warn',
},
},
);
8 changes: 7 additions & 1 deletion lib/conditional.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { DynamicModule, ForwardReference, Logger, ModuleMetadata, Type } from '@nestjs/common';
import {
DynamicModule,
ForwardReference,
Logger,
ModuleMetadata,
Type,
} from '@nestjs/common';
import { ConfigModule } from './config.module';

/**
Expand Down
1 change: 0 additions & 1 deletion lib/config-host.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
} from './config.constants';
import { ConfigService } from './config.service';


/**
* @publicApi
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/config.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class ConfigModule {
.map(factory =>
createConfigProvider(factory as ConfigFactory & ConfigFactoryKeyHost),
)
.filter(item => item) as FactoryProvider[];
.filter(item => item);

const configProviderTokens = providers.map(item => item.provide);
const configServiceProvider = {
Expand Down
14 changes: 7 additions & 7 deletions lib/types/path-value.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export type PathImpl<T, Key extends keyof T> = Key extends string
? IsAny<T[Key]> extends true
? never
: T[Key] extends Record<string, any>
?
| `${Key}.${PathImpl<T[Key], Exclude<keyof T[Key], keyof any[]>> &
string}`
| `${Key}.${Exclude<keyof T[Key], keyof any[]> & string}`
: never
?
| `${Key}.${PathImpl<T[Key], Exclude<keyof T[Key], keyof any[]>> &
string}`
| `${Key}.${Exclude<keyof T[Key], keyof any[]> & string}`
: never
: never;

export type PathImpl2<T> = PathImpl<T, keyof T> | keyof T;
Expand All @@ -39,5 +39,5 @@ export type PathValue<
: never
: never
: P extends keyof T
? T[P]
: never;
? T[P]
: never;
2 changes: 1 addition & 1 deletion lib/utils/create-config-factory.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { FactoryProvider } from '@nestjs/common/interfaces';
import { ConfigFactory } from '../interfaces';
import { getConfigToken } from './get-config-token.util';
import { ConfigFactoryKeyHost } from './register-as.util';
import { randomUUID } from "crypto";
import { randomUUID } from 'crypto';

/**
* @publicApi
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/register-as.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface ConfigFactoryKeyHost<T = unknown> {

/**
* @publicApi
*
*
* Registers the configuration object behind a specified token.
*/
export function registerAs<
Expand Down
Loading

0 comments on commit a1225db

Please sign in to comment.