From 4f55981842d89078cacae5c4d1ca204d23c04dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Sun, 24 May 2020 11:37:15 +0200 Subject: [PATCH] feat: Add format to validate script --- README.md | 9 +++++---- src/scripts/validate.js | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8d702cac..6447643e 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,6 @@ for linting, testing, building, and more. - - [Installation](#installation) - [Usage](#usage) - [Overriding Config](#overriding-config) @@ -126,7 +125,7 @@ add `@babel/preset-flow` to the `presets`-section. ### TypeScript Support -If the `tsconfig.json`-file is present in the project root directory and +If the `tsconfig.json`-file is present in the project root directory and `typescript` is a dependency the `@babel/preset-typescript` will automatically get loaded when you use the default babel config that comes with `kcd-scripts`. If you customised your `.babelrc`-file you might need to manually add @@ -135,8 +134,9 @@ If you customised your `.babelrc`-file you might need to manually add `kcd-scripts` will automatically load any `.ts` and `.tsx` files, including the default entry point, so you don't have to worry about any rollup configuration. -`tsc --build tsconfig.json` will run during before committing to verify that files will compile. -So make sure to add the `noEmit` flag to the `tsconfig.json`'s `compilerOptions`. +`tsc --build tsconfig.json` will run during before committing to verify that +files will compile. So make sure to add the `noEmit` flag to the +`tsconfig.json`'s `compilerOptions`. ## Inspiration @@ -203,6 +203,7 @@ Thanks goes to these people ([emoji key][emojis]): + This project follows the [all-contributors][all-contributors] specification. diff --git a/src/scripts/validate.js b/src/scripts/validate.js index 7d6b5d64..4547e016 100644 --- a/src/scripts/validate.js +++ b/src/scripts/validate.js @@ -18,6 +18,9 @@ const useDefaultScripts = typeof validateScripts !== 'string' const scripts = useDefaultScripts ? { build: ifScript('build', 'npm run build --silent'), + format: preCommit + ? null + : ifScript('format', 'npm run format -- --check'), lint: preCommit ? null : ifScript('lint', 'npm run lint --silent'), test: preCommit ? null