Skip to content

Commit

Permalink
feat: add VSCode extension recommendations (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhhbstudio authored Aug 18, 2023
1 parent 10d8408 commit c288345
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions utils/renderEslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,13 @@ export default function renderEslint(
const fullPath = path.resolve(rootDir, fileName)
fs.writeFileSync(fullPath, content as string, 'utf-8')
}

// update .vscode/extensions.json
const extensionsJsonPath = path.resolve(rootDir, '.vscode/extensions.json')
const existingExtensions = JSON.parse(fs.readFileSync(extensionsJsonPath, 'utf8'))
existingExtensions.recommendations.push('dbaeumer.vscode-eslint')
if (needsPrettier) {
existingExtensions.recommendations.push('esbenp.prettier-vscode')
}
fs.writeFileSync(extensionsJsonPath, JSON.stringify(existingExtensions, null, 2) + '\n', 'utf-8')
}

0 comments on commit c288345

Please sign in to comment.