Skip to content

Commit

Permalink
fix: eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Dive12300 committed Oct 30, 2024
1 parent fdb327f commit 3819682
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/genMaterial.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function createNpmConfig(name) {
}
}

function createWidget(type, key) {
function createWidget(type, _key) {
let component = EMPTY_VALUE
if (Array.isArray(type) && type.length > 0) {
type = type[0]
Expand Down Expand Up @@ -482,14 +482,15 @@ async function loadBaseDataByMenus(menus, concurrency) {


function generateJSONFile(jsonData, fileName = 'output.json', filePath = './') {
const logger = console
const jsonString = JSON.stringify(jsonData, null, 2)
const fullFilePath = filePath.endsWith('/') ? filePath + fileName : filePath + '/' + fileName
fs.writeFile(fullFilePath, jsonString, 'utf8', (err) => {
if (err) {
console.error('写入文件时出错:', err)
logger.error('写入文件时出错:', err)
}
else {
console.log(`JSON 数据已成功写入到文件 ${fullFilePath}`)
logger.log(`JSON 数据已成功写入到文件 ${fullFilePath}`)
}
})
}
Expand Down

0 comments on commit 3819682

Please sign in to comment.