Skip to content

Commit 5e1d20d

Browse files
authored
Merge pull request #127 from NaverPayDev/eslint-plugin/97_fix_bug
[eslint-plugin] fix filename bug in `peer-deps-in-dev-deps`
2 parents 8be5dcb + cab04d7 commit 5e1d20d

File tree

4 files changed

+36
-1
lines changed

4 files changed

+36
-1
lines changed

.changeset/social-results-camp.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@naverpay/eslint-plugin": patch
3+
---
4+
5+
[eslint-plugin] fix filename bug in `peer-deps-in-dev-deps`
6+
7+
PR: [[eslint-plugin] fix filename bug in `peer-deps-in-dev-deps`](https://github.com/NaverPayDev/code-style/pull/127)

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"devDependencies": {
2828
"@changesets/cli": "^2.26.2",
2929
"@naverpay/eslint-config": "workspace:*",
30+
"@naverpay/eslint-plugin": "workspace:*",
3031
"@naverpay/markdown-lint": "workspace:*",
3132
"@naverpay/pite": "1.1.2",
3233
"@naverpay/prettier-config": "workspace:*",

packages/eslint-plugin/lib/rules/peer-deps-in-dev-deps.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import path from 'path'
2+
13
import {getIndentationLength} from '../utils/getIndentationLength.js'
24

35
/**
@@ -20,7 +22,8 @@ export default {
2022
create(context) {
2123
return {
2224
Program(node) {
23-
const filename = context.filename.replace(context.cwd, '')
25+
const filename = path.basename(context.filename)
26+
2427
if (filename !== 'package.json') {
2528
return
2629
}

pnpm-lock.yaml

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)