Skip to content

Commit

Permalink
fix(types): remove null from CSSModulesOptions.localsConvention (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Nov 13, 2022
1 parent a309058 commit a9978dd
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/vite/src/node/plugins/css.ts
Expand Up @@ -99,14 +99,9 @@ export interface CSSModulesOptions {
| ((name: string, filename: string, css: string) => string)
hashPrefix?: string
/**
* default: null
* default: undefined
*/
localsConvention?:
| 'camelCase'
| 'camelCaseOnly'
| 'dashes'
| 'dashesOnly'
| null
localsConvention?: 'camelCase' | 'camelCaseOnly' | 'dashes' | 'dashesOnly'
}

const cssLangs = `\\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)($|\\?)`
Expand Down Expand Up @@ -915,8 +910,7 @@ async function compileCSS(
postcssPlugins.unshift(
(await import('postcss-modules')).default({
...modulesOptions,
// TODO: convert null to undefined (`null` should be removed from `CSSModulesOptions.localsConvention`)
localsConvention: modulesOptions?.localsConvention ?? undefined,
localsConvention: modulesOptions?.localsConvention,
getJSON(
cssFileName: string,
_modules: Record<string, string>,
Expand Down

0 comments on commit a9978dd

Please sign in to comment.