Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try to replace pretty-quick fully with lint-staged #1252

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 2 additions & 4 deletions content/docs/user-guide/contributing/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <file>` - run this command `yarn format <file-name>` to format a
specific file.

Expand Down Expand Up @@ -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 <file>` (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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part I'm going to keep in a regular updates PR thouhg.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 3c41819

([Advanced usage](https://prettier.io/docs/en/cli.html) of Prettier is
available through `yarn prettier ...`)

Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
]
Expand Down