Skip to content

Add ESLint rule ensuring peerDependencies are also declared in devDependencies#90

Merged
yceffort-naver merged 2 commits intomainfrom
feature/82_rule
Feb 27, 2025
Merged

Add ESLint rule ensuring peerDependencies are also declared in devDependencies#90
yceffort-naver merged 2 commits intomainfrom
feature/82_rule

Conversation

@yceffort-naver
Copy link
Contributor

Description

this resolves #82

This pull request adds a new ESLint rule that validates the project's package.json to ensure that all dependencies under "peerDependencies" are also declared in "devDependencies". This is important for local development because peer dependencies often need to be present in the developer's environment for builds, tests, and other tooling to work properly.

Implementation Details

  • The rule targets files named package.json.
  • It parses package.json as JSON and compares the keys in peerDependencies against those in devDependencies.
  • If any package is missing from devDependencies, an ESLint error is reported for each missing package.

@yceffort-naver yceffort-naver self-assigned this Feb 26, 2025
@yceffort-naver yceffort-naver requested a review from a team as a code owner February 26, 2025 14:36
@npayfebot
Copy link
Contributor

npayfebot commented Feb 26, 2025

✅ Changeset detected

Latest commit: 5ba84c5

@naverpay/eslint-plugin package have detected changes.

If no version change is needed, please add skip-detect-change to the label.

The changes in this PR will be included in the next version bump.

powered by: naverpay changeset detect-add actions

Copy link
Contributor

@byhhh2 byhhh2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~~ 감사합니다 👍

Copy link
Contributor

@yujeong-jeon yujeong-jeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다~! 현재 변경이 #82 (comment) 에서 말씀드린 바대로 에러만 Report하는 형태일것 같습니다

@yceffort-naver
Copy link
Contributor Author

@yujeong-jeon 이게 버전 까지 지정해줘야 되서 fixable 로 해야할지 고민이 좀 되더라구요. 지금 그대로는 어떠세요?

@yujeong-jeon
Copy link
Contributor

@yujeong-jeon 이게 버전 까지 지정해줘야 되서 fixable 로 해야할지 고민이 좀 되더라구요. 지금 그대로는 어떠세요?

아 네네 저도 auto-fix는 미지원해도 될거 같았습니다 :) 린트 검사만 터지는게 나을것 같습니다

@yceffort-naver
Copy link
Contributor Author

꼬꼬 감사합니다!

@yceffort-naver yceffort-naver merged commit c9f26fa into main Feb 27, 2025
3 checks passed
@yceffort-naver yceffort-naver deleted the feature/82_rule branch February 27, 2025 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce peerDependencies to be included in devDependencies

4 participants