-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
@maxdzin
Description
Steps to Reproduce
- Install
pnpm add -d @commitlint/cli @commitlint/config-conventional @commitlint/config-pnpm-scopes @commitlint/cz-commitlint @commitlint/types
- Create
commitlint.config.ts
:import scopes from '@commitlint/config-pnpm-scopes' import type { UserConfig } from '@commitlint/types' import { RuleConfigSeverity } from '@commitlint/types' const Configuration: UserConfig = { extends: [ '@commitlint/config-conventional', '@commitlint/config-pnpm-scopes', ], rules: { 'type-enum': [ RuleConfigSeverity.Error, 'always', [ 'build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test', ], ], // @ts-expect-error Context is missing in declaration of config-pnpm-scopes 'scope-enum': async (ctx) => { const scopeEnum = await scopes.rules['scope-enum'](ctx) return [ scopeEnum[0], scopeEnum[1], [ ...scopeEnum[2], 'workspace', // for project workspace related changes 'workflows', // for project github workflows actions related changes 'deps', // for Dependabot or Renovate - dependency updates 'dev-deps', // for Dependabot or Renovate - dev dependency updates 'release', // for release commits ], ] }, }, ignores: [(commit) => /^Bumps\[.+\]\(.+\)from.+to.+\.$/m.test(commit)], prompt: { settings: { enableMultipleScopes: true, }, }, } export default Configuration
See TS error for the first line:
Could not find a declaration file for module '@commitlint/config-pnpm-scopes'.
Current Behavior
When defining config as a TS file, it is impossible to use @commitlint/config-pnpm-scopes because it lacks TS support.
Expected Behavior
Since it is possible to define commitlint in TS nowadays, its additional tools (like '@commitlint/config-pnpm-scopes') require TS support too.
Affected packages
- cli
- core
- prompt
- config-angular
Possible Solution
No response
Context
No response
commitlint --version
@commitlint/cli@19.8.1
git --version
2.51.0
node --version
v22.18.0