Support commitlint.config.ts with TypeScript
See original GitHub issueExpected 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)
- Install
- Add
commitlint.config.ts
- Perform an unconventional commit
- 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 |
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
@commitlint/config-conventional - npm
Shareable commitlint config enforcing conventional commits. Use with @commitlint/cli and @commitlint/prompt-cli. Getting started. npm install -- ...
Read more >Support commitlint.config.ts with TypeScript - Bountysource
Support commitlint.config.ts with TypeScript · Expected Behavior · Current Behavior · Affected packages · Steps to Reproduce (for bugs) · Context.
Read more >commitlint - Lint commit messages
By supporting npm-installed configurations it makes sharing of commit conventions easy. Getting started. Install. npm install -g @commitlint/cli @commitlint/ ...
Read more >@commitlint/config-validator | Yarn - Package Manager
17.1.0 (2022-08-27). Bug Fixes. update dependency cosmiconfig-typescript-loader to v3 (#3253 (4e87d14); update dependency cosmiconfig-typescript-loader ...
Read more >Ts-node NPM - npm.io
TypeScript execution and REPL for node.js, with source map and native ESM support. ... ts-node supports --project and --showConfig similar to the tsc...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Somehow documentation already mentions using TypeScript for configuration, yet it’s unclear how to use it.
@songhn233 If someone accidentally used
tsc
on all*.ts
files, includingcommitlint.config.ts
, now changes tocommitlint.config.ts
would be magically ignored.Common resolution strategy is
.ts
config if exists, error if nots-node
around;.js
config if exists;