Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
}
},
"lint-staged": {
"lib/*.js": [
"src/*.js": [
"prettier --trailing-comma es5 --single-quote --write",
"git add"
]
Expand All @@ -92,4 +92,4 @@
"singleQuote": true,
"trailingComma": "es5"
}
}
}
29 changes: 28 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,26 @@ prog
prepare: 'npm run build',
test: 'tsdx test',
},
husky: {
hooks: {
'pre-commit': 'lint-staged',
},
},
'lint-staged': {
linters: {
'*.{ts,tsx,js,jsx,css,scss,md}': [
'prettier --trailing-comma es5 --single-quote --write',
'git add',
],
ignore: ['**/dist/*, **/node_modules/*'],
},
},
prettier: {
printWidth: 80,
semi: true,
singleQuote: true,
trailingComma: 'es5',
},
};
await fs.outputJSON(path.resolve(projectPath, 'package.json'), pkgJson);
bootSpinner.succeed(`Created ${chalk.bold.green(pkg)}`);
Expand All @@ -148,7 +168,14 @@ prog
logError(error);
process.exit(1);
}
const deps = ['@types/jest', 'tsdx', 'typescript'];
const deps = [
'@types/jest',
'husky',
'lint-staged',
'prettier',
'tsdx',
'typescript',
];

const installSpinner = ora(Messages.installing(deps)).start();
try {
Expand Down