conventional-changelog-eslint
raw JSON → 6.1.0 verified Sat Apr 25 auth: no javascript
ESLint preset for conventional-changelog. Generates changelogs from Git commits following the ESLint convention (Fix, Update, New, Breaking, Docs, Build, Upgrade, Chore). Current stable version 6.1.0, released as part of the conventional-changelog monorepo. ESM-only, requires Node >=18. Compared to other presets (e.g., angular, conventionalcommits), this preset enforces ESLint-specific tags and format.
Common errors
error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/node_modules/conventional-changelog-eslint/index.js from /path/project.js not supported. ↓
cause Trying to require() an ESM-only package.
fix
Use import instead:
import { createPreset } from 'conventional-changelog-eslint' error TypeError: preset is not a function ↓
cause Passing the string 'eslint' as preset to conventional-changelog instead of using createPreset().
fix
Use
const preset = await createPreset(); and pass the returned object. Warnings
breaking v6.x dropped CommonJS support, switched to ESM-only. ↓
fix Use import syntax and Node >=18. Convert CJS project or use dynamic import().
breaking Node.js <18 no longer supported. ↓
fix Upgrade Node.js to >=18.
deprecated Direct use of `conventional-changelog-eslint` as a string preset name is deprecated; use `createPreset()` function instead. ↓
fix Import and call `createPreset()` to get the preset object.
gotcha Commit messages must follow the exact ESLint tag format (e.g., 'Fix: '). Non-conforming commits may be parsed incorrectly. ↓
fix Ensure commits use one of: Fix, Update, New, Breaking, Docs, Build, Upgrade, Chore.
Install
npm install conventional-changelog-eslint yarn add conventional-changelog-eslint pnpm add conventional-changelog-eslint Imports
- createPreset wrong
const createPreset = require('conventional-changelog-eslint')correctimport { createPreset } from 'conventional-changelog-eslint' - gitRawCommitsOpts wrong
const { gitRawCommitsOpts } = require('conventional-changelog-eslint')correctimport { gitRawCommitsOpts } from 'conventional-changelog-eslint' - whatBump
import { whatBump } from 'conventional-changelog-eslint'
Quickstart
import { createPreset } from 'conventional-changelog-eslint';
import conventionalChangelog from 'conventional-changelog';
const preset = await createPreset();
const changelogStream = conventionalChangelog({
preset,
releaseCount: 1,
});
changelogStream.pipe(process.stdout);