Skip to content

Commit 0d6aa45

Browse files
committed
fix(lint): fixup some lint issues
1 parent afdc7d6 commit 0d6aa45

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/apiProject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default function (plop: NodePlopAPI) {
8383
cli('yarn config set nodeLinker node-modules'),
8484
cli('yarn plugin import interactive-tools'),
8585
cli('yarn'),
86-
cli('yarn lint --fix'),
86+
cli('yarn lint --fix --max-warnings 10'),
8787
data?.features.includes('db') && cli('yarn migration:create initial-schema'),
8888
{
8989
type: 'gitInit',

templates/all/src/index.ts.hbs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ import { Kysely, PostgresDialect } from 'kysely';
77
import type { DB } from './generated/database';
88
{{else}}
99
{{/inArray}}
10-
import type { {{properCase name}}, {{properCase name}}ConfigSchema } from './types';
11-
12-
type Config = {{properCase name}}ConfigSchema;
1310

1411
export function service(): {{properCase name}}['Service'] {
1512
const base = useService<{{properCase name}}['ServiceLocals']>();
@@ -21,13 +18,13 @@ export function service(): {{properCase name}}['Service'] {
2118
{{#inArray features 'db'}}
2219
const db = new Kysely<DB>({
2320
dialect: new PostgresDialect({
24-
pool: new Pool(app.locals.config.get<Config['db']>('db') as Config['db']),
21+
pool: new Pool(app.locals.config.db),
2522
}),
2623
});
2724
{{/inArray}}
2825

2926
{{#inArray features 'redis'}}
30-
const { enabled: redisEnabled, ...redisConfig } = app.locals.config.get<Config['redis']>('redis') || {};
27+
const { enabled: redisEnabled, ...redisConfig } = app.locals.config.redis || {};
3128
const redis = redisEnabled ? new Redis(redisConfig) : undefined;
3229
{{/inArray}}
3330

templates/all/src/types/service.ts.hbs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
{{#inArray features 'redis'}}import type { Redis } from 'ioredis';{{/inArray}}
33
import type {
44
RequestLocals,
5-
RequestWithApp,
6-
Service,
7-
ServiceExpress,
85
ServiceLocals,
96
ServiceTypes,
107
} from '@openapi-typescript-infra/service';
@@ -14,6 +11,8 @@ import type { DB } from '../generated/database';
1411
{{/inArray}}
1512
import type { operationHandlers } from '../generated/service';
1613

14+
import type { {{properCase name}}, {{properCase name}}ConfigSchema } from './types';
15+
1716
export interface {{properCase name}}Locals extends ServiceLocals<{{properCase name}}ConfigSchema> {
1817
{{#inArray features 'db'}} db: Kysely<DB>;
1918
{{/inArray}}{{#inArray features 'redis'}} redis?: Redis;

0 commit comments

Comments
 (0)