Skip to content

Commit 5146fbb

Browse files
committed
fix: eslint configuration
1 parent dce95e8 commit 5146fbb

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

apps/book-web/eslint.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import nextConfig from '@packages/eslint-config/base.mjs'
1+
import nextConfig from '@packages/eslint-config/next.mjs'
22

33
/** @type {import("eslint").Linter.Config} */
44
export default [
5+
...nextConfig,
56
{
67
rules: {
78
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
89
},
910
},
10-
...nextConfig,
1111
]

apps/web/eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import nextConfig from '@packages/eslint-config/base.mjs'
1+
import nextConfig from '@packages/eslint-config/next.mjs'
22

33
/** @type {import("eslint").Linter.Config} */
44
export default [

eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export default [
66
{
77
ignores: [
88
'node_modules',
9-
'./packages/*',
109
'./apps/*',
1110
'./infrastructure/*',
1211
'.lintstagedrc.mjs',

packages/eslint-config/src/base.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
21
import { Linter } from 'eslint'
3-
import { resolve } from 'path'
2+
import { resolve, dirname } from 'node:path'
3+
import { fileURLToPath } from 'node:url'
44
import { FlatCompat } from '@eslint/eslintrc'
55
import js from '@eslint/js'
66

77
const project = resolve(process.cwd(), 'tsconfig.json')
8-
const __dirname = new URL('.', import.meta.url).pathname
8+
const __filename = fileURLToPath(import.meta.url)
9+
const __dirname = dirname(__filename)
910

1011
const compat = new FlatCompat({
1112
baseDirectory: __dirname,

packages/eslint-config/src/next.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// eslint-disable-next-line @typescript-eslint/no-unused-vars
22
import { Linter } from 'eslint'
3-
import { resolve } from 'node:path'
3+
import { resolve, dirname } from 'node:path'
4+
import { fileURLToPath } from 'node:url'
45
import { FlatCompat } from '@eslint/eslintrc'
56
import js from '@eslint/js'
67

78
const project = resolve(process.cwd(), 'tsconfig.json')
8-
const __dirname = new URL('.', import.meta.url).pathname
9+
const __filename = fileURLToPath(import.meta.url)
10+
const __dirname = dirname(__filename)
911

1012
const compat = new FlatCompat({
1113
baseDirectory: __dirname,

0 commit comments

Comments
 (0)