Skip to content

Commit 72ed1a3

Browse files
committed
chore: update infra eslint config
1 parent a248b60 commit 72ed1a3

File tree

8 files changed

+1767
-36
lines changed

8 files changed

+1767
-36
lines changed

Diff for: apps/cron/src/services/PostReadService/index.mts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { NotFoundError } from '@errors/NotfoundError.mjs'
21
import { DbService } from '@lib/db/DbService.mjs'
32
import { PostRead } from '@packages/database/velog-rds'
43
import { injectable, singleton } from 'tsyringe'
@@ -43,11 +42,12 @@ export class PostReadService implements Service {
4342
console.log(`Not found postReadId: ${postReadId}`)
4443
return
4544
}
46-
47-
await this.db.postRead.delete({
48-
where: {
49-
id: postReadId,
50-
},
51-
})
45+
try {
46+
await this.db.postRead.deleteMany({
47+
where: {
48+
id: postReadId,
49+
},
50+
})
51+
} catch (_) {}
5252
}
5353
}

Diff for: infrastructure/eslint.config.js

+52-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,58 @@
1-
import baseConfig from '@packages/eslint-config/base.mjs'
2-
import { resolve } from 'node:path'
1+
/* eslint-disable @typescript-eslint/no-require-imports */
2+
const { resolve } = require('node:path')
3+
const { FlatCompat } = require('@eslint/eslintrc')
4+
const js = require('@eslint/js')
35

4-
const projectPath = resolve(process.cwd())
6+
const projectPath = resolve(__dirname)
7+
const tsconfigPath = resolve(projectPath, 'tsconfig.json')
58

6-
/** @type {Linter.Config} */
7-
export default [
8-
...baseConfig(projectPath),
9+
const compat = new FlatCompat({
10+
baseDirectory: projectPath,
11+
resolvePluginsRelativeTo: projectPath,
12+
recommendedConfig: js.configs.recommended,
13+
allConfig: js.configs.all,
14+
})
15+
16+
/** @type {import('eslint').Linter.Config} */
17+
const config = [
918
{
1019
ignores: ['node_modules', 'dist'],
1120
},
21+
...compat.config({
22+
parser: '@typescript-eslint/parser',
23+
parserOptions: {
24+
project: tsconfigPath,
25+
sourceType: 'module',
26+
tsconfigRootDir: projectPath,
27+
},
28+
plugins: ['@typescript-eslint'],
29+
extends: ['plugin:@typescript-eslint/recommended'],
30+
root: true,
31+
env: {
32+
node: true,
33+
jest: true,
34+
},
35+
rules: {
36+
'@typescript-eslint/interface-name-prefix': 'off',
37+
'@typescript-eslint/explicit-function-return-type': 'off',
38+
'@typescript-eslint/explicit-module-boundary-types': 'off',
39+
'@typescript-eslint/no-explicit-any': 'off',
40+
'@typescript-eslint/no-non-null-assertion': 'off',
41+
'@typescript-eslint/no-empty-interface': 'off',
42+
'no-unused-vars': 'off',
43+
'@typescript-eslint/no-unused-vars': [
44+
'off',
45+
{
46+
ignoreRestSiblings: true,
47+
argsIgnorePattern: '^_',
48+
caughtErrors: 'all',
49+
caughtErrorsIgnorePattern: '^_',
50+
destructuredArrayIgnorePattern: '^_',
51+
varsIgnorePattern: '^_',
52+
},
53+
],
54+
},
55+
}),
1256
]
57+
58+
module.exports = config

Diff for: infrastructure/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"zod": "^3.21.4"
1818
},
1919
"devDependencies": {
20-
"@packages/eslint-config": "workspace:*",
20+
"@eslint/eslintrc": "^3.1.0",
21+
"@eslint/js": "^9.5.0",
2122
"@packages/tsconfig": "workspace:*"
2223
}
2324
}

Diff for: infrastructure/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"strict": true,
44
"target": "es2022",
5-
"module": "commonjs",
5+
"module": "CommonJS",
66
"moduleResolution": "node",
77
"experimentalDecorators": true,
88
"pretty": true,
@@ -29,5 +29,5 @@
2929
"src/env.ts",
3030
"src/index.ts"
3131
],
32-
"exclude": ["node_modules", "dist"],
32+
"exclude": ["node_modules", "dist"]
3333
}

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@eslint/eslintrc": "^3.1.0",
3434
"@packages/eslint-config": "workspace:*",
3535
"@packages/tsconfig": "workspace:*",
36-
"@types/eslint": "^9.6.0",
36+
"@types/eslint": "^9.6.1",
3737
"@types/eslint__js": "^8.42.3",
3838
"@types/node": "^20.14.0",
3939
"@typescript-eslint/eslint-plugin": "^8.3.0",

Diff for: packages/eslint-config/src/base.mts

+13-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const baseConfig = (projectPath: string) => {
1212
recommendedConfig: js.configs.recommended,
1313
allConfig: js.configs.all,
1414
})
15+
1516
return [
1617
{
1718
ignores: ['node_modules'],
@@ -37,7 +38,18 @@ const baseConfig = (projectPath: string) => {
3738
'@typescript-eslint/no-explicit-any': 'off',
3839
'@typescript-eslint/no-non-null-assertion': 'off',
3940
'@typescript-eslint/no-empty-interface': 'off',
40-
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
41+
'no-unused-vars': 'off',
42+
'@typescript-eslint/no-unused-vars': [
43+
'off',
44+
{
45+
ignoreRestSiblings: true,
46+
argsIgnorePattern: '^_',
47+
caughtErrors: 'all',
48+
caughtErrorsIgnorePattern: '^_',
49+
destructuredArrayIgnorePattern: '^_',
50+
varsIgnorePattern: '^_',
51+
},
52+
],
4153
},
4254
}),
4355
] satisfies Linter.Config[]

Diff for: packages/eslint-config/tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"allowJs": true,
99
"typeRoots": ["./node_modules/@types", "./types"]
1010
},
11+
"include": ["./src", "./types.d.ts"],
1112
"exclude": ["node_modules", "dist"]
1213
}

0 commit comments

Comments
 (0)