Lint your lerna project commits
Shareable commitlint
config enforcing lerna package and workspace names as scopes.
Use with @commitlint/cli and @commitlint/prompt-cli.
npm install --save-dev @commitlint/config-lerna-scopes @commitlint/cli
echo "export default {extends: ['@commitlint/config-lerna-scopes']};" > commitlint.config.js
β― cat commitlint.config.js
{
extends: ['@commitlint/config-lerna-scopes']
}
β― tree packages
packages
βββ api
βββ app
βββ web
β― echo "build(api): change something in api's build" | commitlint
β§ input: build(api): change something in api's build
β found 0 problems, 0 warnings
β― echo "test(foo): this won't pass" | commitlint
β§ input: test(foo): this won't pass
β scope must be one of [api, app, web] [scope-enum]
β found 1 problems, 0 warnings
β― echo "ci: do some general maintenance" | commitlint
β§ input: ci: do some general maintenance
β found 0 problems, 0 warnings
Consult Rules reference for a list of available rules.