Skip to content

Commit

Permalink
Fix lint-staged and husky internally
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredpalmer committed Apr 30, 2019
1 parent 3738f88 commit c4bd98b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
}
},
"lint-staged": {
"lib/*.js": [
"prettier --trailing-comma es5 --single-quote --write",
"*.{js,css,json,md,ts,tsx}": [
"prettier --write",
"git add"
]
},
Expand Down
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,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

0 comments on commit c4bd98b

Please sign in to comment.