From a9978ddcb6382df96f1c3d3bcd00bf6105934de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Sun, 13 Nov 2022 17:34:11 +0900 Subject: [PATCH] fix(types): remove `null` from `CSSModulesOptions.localsConvention` (#10904) --- packages/vite/src/node/plugins/css.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index caa7a36f80cbeb..7b44559009742a 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -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)($|\\?)` @@ -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,