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

Adds TypeScript support for configuration file #219

Open
8 of 10 tasks
AlvaroIsrael opened this issue Oct 24, 2023 · 4 comments
Open
8 of 10 tasks

Adds TypeScript support for configuration file #219

AlvaroIsrael opened this issue Oct 24, 2023 · 4 comments

Comments

@AlvaroIsrael
Copy link

AlvaroIsrael commented Oct 24, 2023

Description

Hello, I love adding emojis to my commits and recently I found this repository to be a good tool to automate this process to me and also other devs of projects I work on. The thing is, I like TypeScript and have a tendency of not allowing any .js files in projects I work with. The fact this project only supported configuration file in .js format kind of bothered me a little, so I decided to add typescript support for the configuration file devmoji.config.ts.
The PR is here: #220

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I ran all the test suits with both yarn test and yarn test:cov and provided a new test to the new typescript configuration file.

  • load typescript from config file

image

(Also tried to improve coverage a bit by adding a test for a uncovered scenario config file does not exist).

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
@AlvaroIsrael
Copy link
Author

Hello @folke, could you please take a look here when you can?

@AlvaroIsrael
Copy link
Author

Hey @folke I am not giving up, I still want this to be evaluated and merged! Could you please take a look here?

@ap0nia
Copy link

ap0nia commented Nov 6, 2024

If it's any help, I use JSDoc type-checking in my JS files which gets me the type-safety I'm looking for. It's not the same thing as explicit TS support, but it works well enough for me.

devmoji.config.js

// @ts-check

/**
 * @type import('devmoji/lib/config-options').ConfigOptions
 */
const config = {
  types: ['feat', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'chore', 'build', 'ci'],
  devmoji: [
    {
      code: 'feat',
      description: 'a new feature',
      emoji: '🌠',
    },
    // ...
  ]
}

@AlvaroIsrael
Copy link
Author

AlvaroIsrael commented Nov 7, 2024

Thanks for the reply @ap0nia, but my main issue is with the file extension itself! My projects do not have any .js files but this one from devmoji, my main goal here is to have only .ts files in my src folder!

In theory my PR fixes/ provides that, but I can't merge, I need someone to approve and merge this!

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

No branches or pull requests

2 participants