Skip to content

Commit a9978dd

Browse files
authored
fix(types): remove null from CSSModulesOptions.localsConvention (#10904)
1 parent a309058 commit a9978dd

File tree

1 file changed

+3
-9
lines changed
  • packages/vite/src/node/plugins

1 file changed

+3
-9
lines changed

packages/vite/src/node/plugins/css.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,9 @@ export interface CSSModulesOptions {
9999
| ((name: string, filename: string, css: string) => string)
100100
hashPrefix?: string
101101
/**
102-
* default: null
102+
* default: undefined
103103
*/
104-
localsConvention?:
105-
| 'camelCase'
106-
| 'camelCaseOnly'
107-
| 'dashes'
108-
| 'dashesOnly'
109-
| null
104+
localsConvention?: 'camelCase' | 'camelCaseOnly' | 'dashes' | 'dashesOnly'
110105
}
111106

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

0 commit comments

Comments
 (0)