Skip to content

Commit 56346a9

Browse files
committed
style: format code
1 parent c7f5230 commit 56346a9

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

index.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,15 @@ async function init() {
311311
: 'npm'
312312

313313
// README generation
314-
fs.writeFileSync(path.resolve(root, 'README.md'), generateReadme({
315-
projectName: result.projectName || defaultProjectName,
316-
packageManager,
317-
needsTypeScript,
318-
needsTests
319-
}))
314+
fs.writeFileSync(
315+
path.resolve(root, 'README.md'),
316+
generateReadme({
317+
projectName: result.projectName || defaultProjectName,
318+
packageManager,
319+
needsTypeScript,
320+
needsTests
321+
})
322+
)
320323

321324
console.log(`\nDone. Now run:\n`)
322325
if (root !== cwd) {

utils/generateReadme.js

+15-10
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ export default function generateReadme({
2121
template = template.replace('{{projectName}}', projectName)
2222

2323
if (needsTypeScript) {
24-
template = template.replace('<!-- SFC-TYPE-SUPPORT -->\n', sfcTypeSupportDoc)
24+
template = template.replace(
25+
'<!-- SFC-TYPE-SUPPORT -->\n',
26+
sfcTypeSupportDoc
27+
)
2528
} else {
2629
template = template.replace('<!-- SFC-TYPE-SUPPORT -->\n\n', '')
2730
}
2831

29-
let npmScriptsDescriptions =
30-
`\`\`\`sh
32+
let npmScriptsDescriptions = `\`\`\`sh
3133
${getCommand(packageManager, 'install')}
3234
\`\`\`
3335
@@ -45,25 +47,28 @@ ${getCommand(packageManager, 'build')}
4547
`
4648

4749
if (needsTests) {
48-
npmScriptsDescriptions +=`
50+
npmScriptsDescriptions += `
4951
### Run Unit Tests with [Cypress Component Testing](https://docs.cypress.io/guides/component-testing/introduction)
5052
5153
\`\`\`sh
52-
${getCommand(packageManager, 'test:unit')} # or \`${getCommand(packageManager, 'test:unit:ci')}\` for headless testing
54+
${getCommand(packageManager, 'test:unit')} # or \`${getCommand(
55+
packageManager,
56+
'test:unit:ci'
57+
)}\` for headless testing
5358
\`\`\`
5459
5560
### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
5661
5762
\`\`\`sh
58-
${getCommand(packageManager, 'test:e2e')} # or \`${getCommand(packageManager, 'test:e2e:ci')}\` for headless testing
63+
${getCommand(packageManager, 'test:e2e')} # or \`${getCommand(
64+
packageManager,
65+
'test:e2e:ci'
66+
)}\` for headless testing
5967
\`\`\`
6068
`
6169
}
6270

63-
template = template.replace(
64-
'<!-- NPM-SCRIPTS -->\n',
65-
npmScriptsDescriptions
66-
)
71+
template = template.replace('<!-- NPM-SCRIPTS -->\n', npmScriptsDescriptions)
6772

6873
return template
6974
}

utils/getCommand.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
export default function getCommand(packageManager, scriptName) {
22
if (scriptName === 'install') {
3-
return packageManager === 'yarn' ? 'yarn': `${packageManager} install`
3+
return packageManager === 'yarn' ? 'yarn' : `${packageManager} install`
44
}
55

6-
return packageManager === 'npm' ? `npm run ${scriptName}` : `${packageManager} ${scriptName}`
6+
return packageManager === 'npm'
7+
? `npm run ${scriptName}`
8+
: `${packageManager} ${scriptName}`
79
}

0 commit comments

Comments
 (0)