/packagelint

A linter for the files that live around your code

Primary LanguageTypeScriptMIT LicenseMIT

Packagelint

build status test coverage

Packagelint is a linter for the files that live around your code. It's meant to complement traditional code linters like ESLint.

Packagelint runs a series of validation rules -- defined in .packagelint.js -- against your project directory. It's most useful when you have a group of projects that should all follow common standards.

Some things you can do with it (once published)

  • Enforce .nvmrc and a specific version of NodeJS
  • Require specific NPM registry settings (e.g. to prevent Dependency Confusion)
  • Suggest particular config values for ESLint, Jest, or other tools
  • Require a minimum version of React, or some other dependency

STILL IN DEVELOPMENT

This tool is not yet ready for public use. Version 0.1.0 will be the first public release. Full docs will be available after 0.2.0.

At a Glance

  • .packagelint.js sets options and errorLevels for the rules you want to run
  • You can configure multiple copies of a rule. For example, the nvmrc rule can be run once to require a .nvmrc file with NodeJS >=12, at errorLevel "error"; and again with NodeJS ^16 at errorLevel "suggestion"
  • Reporters and exit code conditions may be customized to be strict or lenient

It's like a hybrid between ESLint and Jest: rules are configured as if they're for a linter, but they're evaluated and reported as if they're automated tests.

Packages

@packagelint/packagelint

npm version test coverage dependencies status

The packagelint runtime, available as a CLI tool or as an importable API

@packagelint/core

npm version test coverage dependencies status

A collection of configurable rules, covering various standards and tools

@packagelint/presets

npm version dependencies status

A collection of validation presets: ready-to-use rulesets for common scenarios

@packagelint/packagelint-cli

npm version dependencies status

Run your local Packagelint via a global command

@packagelint/types

npm version test coverage dependencies status

Types, utilities, and validators for Packagelint internals

Documentation (pending/incomplete)

Roadmap and Status

  • Proof of concept
  • Project scaffolding and CLI setup
  • Core functionality: Rule preparation
  • Core functionality: Validation
  • Core functionality: Reporting
  • Initial rules
  • Initial rulesets and combos
  • Docs in repo (in progress)
  • Docs online
  • Test coverage
  • Examples
  • Rule entry shorthands
  • Full RuleCheck support (in progress)
  • Full RuleSet support
  • Full RuleCombo support
  • Support for Jest reporters
  • Configs and patching
  • Rule/reporter import aliases
  • Run Packagelint through a unit test runner