micantoine / svelte-preprocess-cssmodules

Svelte preprocessor to generate CSS Modules classname on Svelte components
MIT License
61 stars 12 forks source link

Linter flagging required parameters #94

Open patricknelson opened 1 year ago

patricknelson commented 1 year ago

Fairly minor, but it appears TypeScript is flagging cssModules() arguments as being required when in fact they're actually optional:

TS2554: Expected 1 arguments, but got 0.

image

micantoine commented 1 year ago

Yes, there is a type mistake, the parameter is still not optional

Instead of

cssModules(options: Partial<PluginOptions>): PreprocessorGroup

it should be

cssModules(options: Partial<PluginOptions> = {}): PreprocessorGroup

for the time being, you can pass an empty object cssModules({})