Skip to content

Propose Using eslint-plugin-package-json for package.json Validation #83

@yceffort-naver

Description

@yceffort-naver

Propose Using eslint-plugin-package-json for package.json Validation

Description

Currently, our ESLint setup does not include any rules for validating package.json. This can lead to inconsistencies in dependencies, scripts, and other configurations. By integrating eslint-plugin-package-json, we can enforce consistency and catch potential issues automatically. (also see #82)

Proposal

  • Add eslint-plugin-package-json to our ESLint configuration.
  • Use its built-in rules to validate package.json fields such as dependencies, scripts, and metadata.
  • Optionally, define custom rules if necessary to enforce project-specific guidelines.

Comparison with publint

publint is another tool that helps validate package.json, but it primarily focuses on package publishing issues, such as:

  • Incorrect exports field configuration
  • Issues with main, module, and types fields
  • Missing files in the published package

On the other hand, eslint-plugin-package-json is more general-purpose, providing rules for consistency and correctness across all package.json fields, not just those related to package publishing.

Benefits

  • Ensures consistency in package.json.
  • Helps prevent dependency mismatches and missing required fields.
  • Improves maintainability of the project by enforcing best practices.
  • Complements publint by focusing on broader package.json validation beyond publishing concerns.

Integrating this plugin will enhance the reliability of our dependency management and project configuration.

cc @NaverPayDev/frontend

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions