From 8df41f4cea9e9a91cd32492c5e3980f38213557d Mon Sep 17 00:00:00 2001 From: Jorge Orpinel Date: Tue, 5 May 2020 21:40:16 -0500 Subject: [PATCH] try to replace pretty-quick fully with lint-staged --- content/docs/user-guide/contributing/docs.md | 6 ++---- package.json | 8 +++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/content/docs/user-guide/contributing/docs.md b/content/docs/user-guide/contributing/docs.md index 9eab9e7e2a..fa82385122 100644 --- a/content/docs/user-guide/contributing/docs.md +++ b/content/docs/user-guide/contributing/docs.md @@ -115,7 +115,7 @@ set of wrapper commands for your convenience: properly formatted. This command does not fix any found issue, only reports them. - `yarn format-all` - fix all found problems. -- `yarn format-staged` - same, but only on staged files. +- `yarn format-staged` - same, but only on Git-staged files. - `yarn format ` - run this command `yarn format ` to format a specific file. @@ -156,9 +156,7 @@ pre-commit hook that is integrated when `yarn` installs the project dependencies - We use [Prettier](https://prettier.io/) to format our source code (see [its configuration](https://github.com/iterative/dvc.org/blob/master/.prettierrc)). The formatting of staged files will automatically be done by a Git pre-commit - hook. You may also run `yarn format ` (format specific file/pattern), - `yarn format-staged` (all staged files), or `yarn format-all` (all `.md`, - `.js` and other source files) before committing changes if needed. + hook. You may also run the formatting [commands](#all-commands) manually. ([Advanced usage](https://prettier.io/docs/en/cli.html) of Prettier is available through `yarn prettier ...`) diff --git a/package.json b/package.json index 3b321c483a..63d8d9fbb0 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "start": "./scripts/clear-cloudflare-cache.js; node ./src/server/index.js", "heroku-postbuild": "./scripts/deploy-with-s3.js", "test": "jest", - "format-staged": "pretty-quick --staged --no-restage --bail", + "format-staged": "lint-staged --no-stash", "format-check": "prettier --check '**/*.{js,jsx,md,tsx,ts,json}'", "format-all": "prettier --write '**/*.{js,jsx,md,tsx,ts,json}'", "format": "prettier --write", @@ -58,7 +58,6 @@ "nanoid": "^3.0.2", "node-cache": "^5.1.0", "perfect-scrollbar": "^1.5.0", - "pretty-quick": "^2.0.1", "prismjs": "^1.20.0", "promise-polyfill": "^8.1.3", "prop-types": "^15.7.2", @@ -154,13 +153,16 @@ }, "husky": { "hooks": { - "pre-commit": "yarn format-staged && yarn lint-staged" + "pre-commit": "yarn lint-staged --no-stash" } }, "lint-staged": { "*.{js,ts,tsx,json}": [ "eslint" ], + "*.md": [ + "yarn prettier --write" + ], "*.css": [ "yarn stylelint --fix" ]