Skip to content

Commit

Permalink
create-wmr: install eslint and eslint-config-preact as dev dependenci…
Browse files Browse the repository at this point in the history
…es (#940)

* create-wmr: install eslint and eslint-config-preact as devDependencies

* changeset
  • Loading branch information
joebeachjoebeach authored Oct 25, 2022
1 parent cc70ed6 commit ab4b512
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/thick-apes-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-wmr': patch
---

Install eslint and eslint-config-preact as dev dependencies
7 changes: 5 additions & 2 deletions packages/create-wmr/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ sade('create-wmr [dir]', true)

if (opts.eslint) {
spinner.start('installing eslint configuration...');
await install(['eslint', 'eslint-config-preact'], { prefer: packageManager, cwd });
await install(['eslint', 'eslint-config-preact'], { prefer: packageManager, cwd, dev: true });
spinner.succeed('installed eslint.');
}

spinner.stop();
if (dir) {
// eslint-disable-next-line no-console
console.log(
`\n${bold('To get started:')}\n${dim('$')} ${cyan('cd ' + relative(origCwd, cwd).replace(/^\.[\\/]/, ''))}`
);
Expand All @@ -83,11 +84,13 @@ sade('create-wmr [dir]', true)
Serve the app in production mode:
${dim('$ PORT=8080')} ${cyan(`${packageManager === 'npm' ? 'npm run' : 'yarn'} serve`)}
`;
// eslint-disable-next-line no-console
console.log('\n' + result.trim().replace(/^\t\t\t/gm, '') + '\n');
if (!opts.eslint) {
// eslint-disable-next-line no-console
console.log(
`\n${bold('To enable ESLint:')} (optional)\n${dim('$')} ${cyan(
`${packageManager === 'npm' ? 'npm i' : 'yarn add'} eslint eslint-config-preact`
`${packageManager === 'npm' ? 'npm i' : 'yarn add'} -D eslint eslint-config-preact`
)}\n`
);
}
Expand Down

0 comments on commit ab4b512

Please sign in to comment.