Skip to content

Support commitlint.config.ts with TypeScript #2652

@seahindeniz

Description

@seahindeniz

Expected Behavior

Commitlint should be able to parse the config file written in TypeScript

Current Behavior

Commitlint asks me to add a config file

> git ls-files --stage -- C:\Users\.....(reducted)......\commitlint.config.ts
⧗   input: Add commitlint and husky
✖   Please add rules to your `commitlint.config.js`
    - Getting started guide: https://git.io/fhHij
    - Example config: https://git.io/fhHip [empty-rules]

✖   found 1 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

husky - commit-msg hook exited with code 1 (error)

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Steps to Reproduce (for bugs)

  1. Install
  2. Add commitlint.config.ts
  3. Perform an unconventional commit
  4. See Git log
commitlint.config.ts
export default { extends: ['@commitlint/config-conventional'] };

Context

Well, I want my repo to have only TS files rather than combining with JS files- including config files on my repository and I need Commitlint would also respect this choice.

Your Environment

Executable Version
commitlint --version 12.1.4
git --version 2.31.1.windows.1
node --version v14.16.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions