chore: solve the eslint error about null (#45328)

This commit is contained in:
kiner-tang(文辉) 2023-10-13 05:18:07 -05:00 committed by GitHub
parent 92644fe2d3
commit c727bed0e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -155,12 +155,12 @@ const RoutesPlugin = (api: IApi) => {
// 2. 提取每个样式到独立 css 文件 // 2. 提取每个样式到独立 css 文件
styles.forEach((result) => { styles.forEach((result) => {
api.logger.event( api.logger.event(
`${chalk.yellow(file.path)} include ${chalk.blue`[${result.key}]`} ${chalk.yellow( `${chalk.yellow(file.path)} include ${chalk.blue`[${result!.key}]`} ${chalk.yellow(
result.ids.length, result!.ids.length,
)} styles`, )} styles`,
); );
const cssFile = writeCSSFile(result.key, result.ids.join(''), result.css); const cssFile = writeCSSFile(result!.key, result!.ids.join(''), result!.css);
file.content = addLinkStyle(file.content, cssFile); file.content = addLinkStyle(file.content, cssFile);
}); });