Skip to content

Commit

Permalink
chore: Add Husky/lint-staged for local precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni committed Sep 7, 2022
1 parent dbb6077 commit 1d8cab2
Show file tree
Hide file tree
Showing 4 changed files with 273 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*": "prettier --ignore-unknown --write",
"*.md": "markdownlint-cli2-fix"
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
"lint:json": "prettier -c \"**/*.json(c)?\"",
"lint:md": "markdownlint-cli2 \"**/*.md\"",
"lint:yml": "prettier -c \"**/*.yml\"",
"prepare": "husky install",
"start": "yarn up-to-date-check && env-cmd --silent cross-env CONTENT_ROOT=files REACT_APP_DISABLE_AUTH=true BUILD_OUT_ROOT=build yari-server",
"up-to-date-check": "node scripts/up-to-date-check.js"
},
"dependencies": {
"@mdn/yari": "1.18.23",
"cross-env": "7.0.3",
"env-cmd": "10.1.0",
"husky": "8.0.1",
"lint-staged": "13.0.3",
"markdownlint-cli2": "0.5.1",
"markdownlint-rule-search-replace": "1.0.5",
"prettier": "2.7.1"
Expand Down
Loading

0 comments on commit 1d8cab2

Please sign in to comment.