@@ -20,7 +20,6 @@ const getPostCssConfigPlugins = (directory: string) => {
2020 }
2121} ;
2222
23- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
2423function init ( { typescript : ts } : { typescript : typeof tsModule } ) {
2524 let _isCSS : isCSSFn ;
2625
@@ -33,16 +32,18 @@ function init({ typescript: ts }: { typescript: typeof tsModule }) {
3332 process . chdir ( directory ) ;
3433
3534 // User options for plugin.
36- const options : Options = info . config . options || { } ;
35+
36+ const config = info . config as { options ?: Options } ;
37+ const options = config . options ?? { } ;
3738 logger . log ( `options: ${ JSON . stringify ( options ) } ` ) ;
3839
3940 // Load environment variables like SASS_PATH.
4041 // TODO: Add tests for this option.
41- const dotenvOptions = options . dotenvOptions || { } ;
42+ const dotenvOptions = options . dotenvOptions ;
4243 if ( dotenvOptions ) {
4344 dotenvOptions . path = path . resolve (
4445 directory ,
45- dotenvOptions . path || '.env' ,
46+ dotenvOptions . path ?? '.env' ,
4647 ) ;
4748 }
4849 dotenv . config ( dotenvOptions ) ;
@@ -60,7 +61,7 @@ function init({ typescript: ts }: { typescript: typeof tsModule }) {
6061
6162 // Add postCSS config if enabled.
6263 const postcssOptions =
63- options . postcssOptions || options . postCssOptions || { } ;
64+ options . postcssOptions ?? options . postCssOptions ?? { } ;
6465
6566 let userPlugins : AcceptedPlugin [ ] = [ ] ;
6667 if ( postcssOptions . useConfig ) {
@@ -212,7 +213,7 @@ function init({ typescript: ts }: { typescript: typeof tsModule }) {
212213
213214 // Filter to only one extension type, and remove that extension. This leaves us with the actual filename.
214215 // Example: "usr/person/project/src/dir/File.module.css/index.d.ts" > "usr/person/project/src/dir/File.module.css"
215- const normalizedLocations = failedLocations . reduce (
216+ const normalizedLocations = failedLocations . reduce < string [ ] > (
216217 ( locations , location ) => {
217218 if (
218219 ( baseUrl ? location . includes ( baseUrl ) : true ) &&
@@ -222,7 +223,7 @@ function init({ typescript: ts }: { typescript: typeof tsModule }) {
222223 }
223224 return locations ;
224225 } ,
225- [ ] as string [ ] ,
226+ [ ] ,
226227 ) ;
227228
228229 // Find the imported CSS module, if it exists.
0 commit comments