Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TypeScript commitlint configs don't load #244

Open
jaytavares opened this issue Apr 27, 2022 · 1 comment
Open

[BUG] TypeScript commitlint configs don't load #244

jaytavares opened this issue Apr 27, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jaytavares
Copy link

Describe the bug

When using typescript config files with commitlint, the Conventional Commits extension does not load configuration.

To reproduce

Steps to reproduce the behavior:

  1. Create file .commitlintrc.js file with contents:
const Configuration = {
  rules: {
    'type-enum': [2, 'always', ['javascript', 'example']]
  }
}

module.exports = Configuration
  1. Activate extension
  2. Notice that scopes are loaded from JavaScript config file
  3. Rename JavaScript file to .commitlintrc.ts; replace contents with:
import { UserConfig } from '@commitlint/types'

const Configuration: UserConfig = {
  rules: {
    'type-enum': [2, 'always', ['typescript', 'example']]
  }
}

export default Configuration
  1. Activate Conventional Commits extension
  2. Notice that default conventional commits types are displayed as the type options are not pulled from the typescript config file

Expected behavior

Config should be loaded from typescript config files as described in commitlint docs

Application logs

[info] Extension Activated
[info] vscode.env.language: en
[info] last used version: 1.24.0
[info] Conventional commits started.
[info] VSCode version: 1.66.2
[info] Git version: 1.0.0
[info] VSCode Conventional Commits version: 1.24.0
[info] conventionalCommits.autoCommit: true
[info] conventionalCommits.silentAutoCommit: false
[info] conventionalCommits.emojiFormat: code
[info] conventionalCommits.gitmoji: true
[info] conventionalCommits.lineBreak:
[info] conventionalCommits.promptBody: true
[info] conventionalCommits.promptCI: false
[info] conventionalCommits.promptFooter: true
[info] conventionalCommits.promptScopes: true
[info] conventionalCommits.scopes:
[info] conventionalCommits.showEditor: false
[info] conventionalCommits.showNewVersionNotes: true
[info] conventionalCommits.editor.keepAfterSave: false
[info] git.enableSmartCommit: false
[info] git.smartCommitChanges: all
[info] git.postCommitCommand: none
[info] arg: undefined
[info] git.repositories: /Users/jay/dev/demo_project
[info] workspaceFolders: /Users/jay/dev/demo_project
[info] Load commitlint configuration successfully.
[info] commitlintRuleConfigs:
{}

@jaytavares jaytavares added the help wanted Extra attention is needed label Apr 27, 2022
@vivaxy vivaxy added the enhancement New feature or request label May 3, 2022
@vivaxy
Copy link
Owner

vivaxy commented May 3, 2022

@jaytavares Thanks for the notice.

@commitlint/load we depend on is v13.1.0, which does not support loading TypeScript config files. While @commitlint/load@v13.2.0 supports this. conventional-changelog/commitlint@b65aced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants