Skip to content

xxx is not allowed because it is not a valid JavaScript identifier. #176

@iwashi1t

Description

@iwashi1t

Dear mizdra,

Thank you for your great work on happy-css-modules — I really appreciate the excellent library.

I’m currently trying to migrate to css-modules-kit, but I encountered the error mentioned in the title when running cmk.

In my environment, I use Vite with CSS Modules and follow a kebab-case naming convention for class names (hoge-fuga) for personal reasons. I configure localsConvention: 'camelCaseOnly' in Vite so that class names can be used in camelCase on the JS/TS side.

happy-css-modules works fine with this setup, but I'm wondering: does css-modules-kit require class names to be camelCase in the CSS as well?

Thank you for your time, and I’d appreciate it if you could take a look when convenient.


みずどらさん

happy-css-modules から大変お世話になっております。素晴らしいライブラリをありがとうございます。
こちらのライブラリに移行させていただこうと使用を試してみたのですが、 cmk 実行時にタイトルのエラーが表示されます。

こちらの環境としてはVite + CSS Moduleを使用しており、CSSクラス名の命名には宗教上の理由からケバブケース( hoge-fuga 形式)を採用しています。Vite configの localsConventioncamelCaseOnly に設定して、JS(TS)側ではキャメルケースを使用できるようにしています。

happy-css-modules では hcm コマンドの localsConvention オプションが利用可能ですが、 cmk の場合はCSSクラス名にキャメルケースしか使用できないような制限があったりしますでしょうか?

お忙しいところ恐れ入りますが、ご確認のほどよろしくお願いいたします。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions