Skip to content

Commit

Permalink
chore: bring back lint-staged (DIYgod#12844)
Browse files Browse the repository at this point in the history
* chore: bring back lint-staged

* fix: gha label

* fix: yml format
  • Loading branch information
Tony authored Jul 20, 2023
1 parent 94e4f07 commit e291fb5
Show file tree
Hide file tree
Showing 4 changed files with 373 additions and 252 deletions.
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ core enhancement:
- any: ['lib/**', '!lib/radar-rules.js', '!lib/router.js', '!lib/routes/**', '!lib/v2/**']

dependencies:
- package.json
- pnpm-lock.yaml
- yarn.lock
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run format:staged
npx lint-staged
23 changes: 15 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,26 @@
"build:maintainer": "node scripts/workflow/build-maintainer.js",
"build:radar": "node scripts/workflow/build-radar.js",
"dev": "cross-env NODE_ENV=dev nodemon --inspect lib/index.js",
"format": "eslint \"**/*.{js,yml}\" --fix && node docs/.format/format.js && prettier \"**/*.{js,json}\" --write",
"format:check": "eslint \"**/*.{js,yml}\" && prettier-check \"**/*.{js,json}\"",
"format:staged": "eslint --cache \"**/*.{js,yml}\" --fix && node docs/.format/format.js --staged && pretty-quick --staged --verbose --pattern \"**/*.{js,json}\"",
"format": "eslint --cache --fix \"**/*.{js,yml}\" && node docs/.format/format.js && prettier \"**/*.{js,json}\" --write",
"format:check": "eslint --cache \"**/*.{js,yml}\" && prettier \"**/*.{js,json}\" --check",
"format:staged": "lint-staged",
"jest": "cross-env NODE_ENV=test jest --runInBand --forceExit --detectOpenHandles",
"jest:coverage": "cross-env NODE_ENV=test jest --coverage --reporters=default --reporters=jest-junit --runInBand --forceExit --detectOpenHandles",
"jest:watch": "cross-env NODE_ENV=test jest --watch",
"lint": "eslint .",
"lint": "eslint --cache .",
"prepare": "node -e \"try { require('husky').install() } catch (e) {if (e.code !== 'MODULE_NOT_FOUND') throw e}\"",
"profiling": "NODE_ENV=production node --prof lib/index.js",
"start": "node lib/index.js",
"test": "npm run format:check && npm run jest:coverage"
},
"lint-staged": {
"*.js": [
"eslint --cache --fix",
"prettier --ignore-unknown --ignore-path ./.gitignore --write"
],
"*.md": "node docs/.format/format.js --staged",
"*.yml": "eslint --cache --fix"
},
"nodemonConfig": {
"ext": "art,js,mjs,json",
"watch": [
Expand Down Expand Up @@ -78,7 +86,7 @@
"@koa/router": "12.0.0",
"@notionhq/client": "2.2.8",
"@postlight/parser": "2.2.3",
"@sentry/node": "7.59.2",
"@sentry/node": "7.59.3",
"aes-js": "3.1.2",
"art-template": "4.13.2",
"bbcodejs": "0.0.4",
Expand Down Expand Up @@ -119,7 +127,7 @@
"pidusage": "3.0.2",
"plist": "3.1.0",
"proxy-chain": "2.3.0",
"puppeteer": "20.8.3",
"puppeteer": "20.9.0",
"puppeteer-extra": "3.3.6",
"puppeteer-extra-plugin-stealth": "2.11.2",
"puppeteer-extra-plugin-user-data-dir": "2.4.1",
Expand Down Expand Up @@ -153,12 +161,11 @@
"husky": "8.0.3",
"jest": "29.6.1",
"jest-junit": "16.0.0",
"lint-staged": "13.2.3",
"mockdate": "3.0.5",
"nock": "13.3.2",
"nodemon": "3.0.1",
"prettier": "3.0.0",
"prettier-check": "2.0.0",
"pretty-quick": "3.1.3",
"remark": "13.0.0",
"remark-frontmatter": "3.0.0",
"remark-gfm": "1.0.0",
Expand Down
Loading

0 comments on commit e291fb5

Please sign in to comment.