ESLint Release Tool

raw JSON →
3.3.0 verified Sat Apr 25 auth: no javascript

ESLint Release Tool v3.3.0 is a CLI and API for automating releases in ESLint projects. It generates release versions, updates changelogs, publishes to npm, and creates GitHub releases with proper tags. Key differentiators: tightly coupled to ESLint's commit message conventions (conventional commits), supports both regular and prerelease workflows, and requires minimal configuration via environment variables. Release cadence is irregular focused on ESLint ecosystem needs. Alternative to generic tools like semantic-release but opinionated for ESLint processes.

error Error: Cannot find module 'eslint-release'
cause Package not installed or incorrect import path.
fix
Install: npm install eslint-release --save-dev
error TypeError: generateRelease is not a function
cause Using require on default export when named export is intended.
fix
Use const { generateRelease } = require('eslint-release');
error Error: 'NPM_TOKEN' is not defined?
cause Environment variable not set.
fix
Set NPM_TOKEN environment variable before running commands.
error fatal: not a git repository (or any of the parent directories): .git
cause Commands must be run inside a git repository.
fix
Initialize git: git init; or cd to a git repository.
breaking Breaking: minimum Node.js version raised to 10.0.0 in v3.0.0.
fix Upgrade Node.js to >=10.0.0.
deprecated Package maintains minimal tests and API is rapidly changing. Not for general use.
fix Consider using semantic-release for broader use cases; this tool is ESLint-specific.
gotcha Environment variables NPM_TOKEN and ESLINT_GITHUB_TOKEN must be set; otherwise commands fail silently or with generic error.
fix Always export both tokens before running eslint-generate-release or eslint-publish-release.
gotcha The .eslint-release-info.json file is required for publishRelease() - if missing or corrupted, publish fails.
fix Ensure generateRelease() completes successfully and .eslint-release-info.json exists before publishRelease().
gotcha CLI commands eslint-generate-release and eslint-publish-release assume git repository with proper commit history; otherwise version calculation fails.
fix Ensure you're in a git repo with commits following conventional commit format.
npm install eslint-release
yarn add eslint-release
pnpm add eslint-release

Demonstrates programmatic usage of eslint-release: generateRelease() and publishRelease() with required environment variables.

const { generateRelease, publishRelease } = require('eslint-release');

// Set environment variables
process.env.NPM_TOKEN = 'your-npm-token';
process.env.ESLINT_GITHUB_TOKEN = 'your-github-token';

// Generate a regular release (prereleaseId undefined, packageTag defaults to 'latest')
generateRelease()
  .then(() => console.log('Release generated successfully'))
  .catch(err => console.error('Generation failed:', err));

// Publish the generated release
publishRelease()
  .then(() => console.log('Release published successfully'))
  .catch(err => console.error('Publication failed:', err));