Skip to content

Commit

Permalink
Merge pull request #1779 from flexn-io/fix/linting
Browse files Browse the repository at this point in the history
format json files  + add json formatting to husky pre-commit hook
  • Loading branch information
locksten authored Nov 14, 2024
2 parents b9eb638 + 76ced4a commit 3a02834
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 384 deletions.
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
. "$(dirname "$0")/_/husky.sh"

npm run sanity

npx lint-staged
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
"generateSchema": "npx rnv hooks run -x generateSchema",
"link:rnv": "npm r rnv -g && cd packages/rnv && npm link",
"lint": "npx eslint ./packages",
"postinstall": "npx lerna link --force-local && npx jetify",
"postinstall": "npx lerna link --force-local && npx jetify && npx husky install ",
"pre-publish": "yarn build && yarn link:rnv && yarn lint && yarn test && rnv hooks run -x prePublish && rnv hooks run -x gitCommitAndTag && yarn generateSchema",
"prettier-write-all": "npx prettier '**/*.{js,jsx,ts,tsx,mjs,cjs,json,md}' --write --config .prettierrc.js",
"prettier-write-json": "npx prettier '**/{package.json,renative.plugins.json,renative.json,renative.templates.json,renative.template.json,renative.plugin.json,renative.engine.json}' --write --config .prettierrc.js",
"prettier-write-json": "npx prettier '**/{package.json,renative.plugins.json,renative.json,renative.templates.json,renative.template.json,renative.plugin.json,renative.engine.json,rnv.json}' --write --config .prettierrc.js",
"report-circular": "npx madge --circular --extensions ts --exclude '\\.(d.ts)$' ./packages",
"report-jest": "jest --coverage",
"report-ts-coverage": "typescript-coverage-report -p ./packages/core/tsconfig.json -t 99",
Expand Down Expand Up @@ -128,10 +128,13 @@
"title": "ReNative",
"husky": {
"hooks": {
"pre-commit": "yarn sanity"
"pre-commit": "yarn sanity && yarn prettier-write-json"
}
},
"lint-staged": {
"*.json": [
"prettier --write"
],
"*.js": [
"eslint"
]
Expand Down
Loading

0 comments on commit 3a02834

Please sign in to comment.