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

[Feature Request] Provide a type helper function for config auto-complete #193

Closed
Mister-Hope opened this issue Oct 12, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Mister-Hope
Copy link

Mister-Hope commented Oct 12, 2024

💭 Describe the feature

It's a bit annoying to use as in typescript and @type annotation in javascript.

Instead, a function helepr could be exported:

export const config = (userConfig: UserConfig) => UserConfig

This is exactly what a lot of tools like vite and vuepress are using.

Before:

/** @type {import('cz-git').UserConfig} */
module.exports = {
  // ...
}
improt type { UserConfig } from 'cz-git'

export default {
  // ...
} as UserConfig

After:

const { config } = require('cz-git');

module.exports = config({
  // ...
})
import { config } from 'cz-git';

export default config({
  // ...
})

💡 Proposed Solution

No response

@Zhengqbbb
Copy link
Owner

The latest version 🌟(v1.11.0)🌟 released and provide config file type helper fn defineConfig and definePrompt
Docs Link: https://cz-git.qbb.sh/config/
💪 Please have a try. 👀 Let me know if there are still any issues. 🎉

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

No branches or pull requests

2 participants