mizdra / happy-css-modules

Typed, definition jumpable CSS Modules. Moreover, easy!
MIT License
225 stars 5 forks source link

Accept patterns without `--pattern` and obsolete `--pattern` #38

Closed mizdra closed 2 years ago

mizdra commented 2 years ago

I would like to change it to accept patterns without options. This is the interface used by eslint and prettier, and is also common. I think it is important to provide an interface that is as familiar as possible.

In addition, I would like to deprecate the --pattern option.

mizdra commented 2 years ago

tcm . should be equivalent to tsc '**/*.css'. That is, the accepted extensions are implicitly limited to .css. In the future, it should be improved to accept .less and .scss by adding an option like --ext in eslint, but MPV does not need to go that far.

mizdra commented 2 years ago

The extension pattern used by css-loader is as follows:

https://github.com/webpack-contrib/css-loader/blob/5e6cf91fd3f0c8b5fb4b91197b98dc56abdef4bf/src/utils.js#L535-L536

mizdra commented 2 years ago

For the time being, I'm going to make the interface to require the specification of the extension. If automatic search for specific extensions becomes necessary, I will implement it.