Skip to content

Commit

Permalink
Update husky (#6302)
Browse files Browse the repository at this point in the history
* chore(packages): update husky and lint-staged

* chore(node): update repo and github actions to use node 18

* chore(actions): do not install husky on CI
  • Loading branch information
mperdomo-bc committed Mar 7, 2024
1 parent ff5e8b7 commit 5c18981
Show file tree
Hide file tree
Showing 8 changed files with 299 additions and 173 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ on:
pull_request:
types: [opened, synchronize, reopened]

env:
HUSKY: 0

jobs:
pull-request:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.16]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install node.js v${{ matrix.node-version }}
uses: actions/setup-node@v2
- name: Install node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version-file: './.nvmrc'
cache: 'yarn'

- name: Install dependencies
run: yarn
run: yarn --frozen-lockfile

# TODO: enable once all lint issues are fixed
#- name: Lint code
Expand All @@ -34,4 +34,4 @@ jobs:
run: yarn ci:test:core:components

- name: Test package - frontend
run: yarn ci:test:frontend
run: yarn ci:test:frontend
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn commitlint --edit $1
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarn lint-staged --allow-empty
node ./scripts/commitHook.js
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node ./scripts/checkForCircularDeps.js
5 changes: 5 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"packages/*/src/**/*.{js,ts,tsx}": ["eslint --fix", "yarn jest --bail --findRelatedTests --passWithNoTests"],
"packages/*/src/**/*.{js,tsx}": ["stylelint './packages/*/src/**/*.{js,tsx}'"],
"packages/**/!(*package).json": ["eslint --fix"]
}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.16
v18
29 changes: 5 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,12 @@
"wallet"
],
"engines": {
"node": ">= 14.16",
"node": ">= 18",
"yarn": ">= 1.22"
},
"workspaces": [
"packages/*"
],
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged && node ./scripts/commitHook.js",
"pre-push": "node ./scripts/checkForCircularDeps.js"
}
},
"lint-staged": {
"packages/*/src/**/*.{js,ts,tsx}": [
"eslint --fix",
"yarn test --bail --findRelatedTests"
],
"packages/*/src/**/*.{js,tsx}": [
"stylelint './packages/*/src/**/*.{js,tsx}'"
],
"packages/**/!(*package).json": [
"eslint --fix"
]
},
"postinstall": "rm -rf node_modules/@types/react-native",
"scripts": {
"analyze": "yarn workspace blockchain-wallet-v4-frontend analyze",
"build": "yarn workspace blockchain-wallet-v4-frontend build:dev",
Expand Down Expand Up @@ -96,7 +76,8 @@
"test:frontend:update": "yarn workspace blockchain-wallet-v4-frontend test:update",
"test:frontend:watch": "yarn workspace blockchain-wallet-v4-frontend test:watch",
"release": "release-it",
"vet": "yarn lint:fix && yarn lint:css && yarn test"
"vet": "yarn lint:fix && yarn lint:css && yarn test",
"postinstall": "husky"
},
"devDependencies": {
"@babel/cli": "7.14.8",
Expand Down Expand Up @@ -181,14 +162,14 @@
"hoist-non-react-statics": "3.3.2",
"html-replace-webpack-plugin": "2.6.0",
"html-webpack-plugin": "5.5.0",
"husky": "3.0.5",
"husky": "^9.0.11",
"identity-obj-proxy": "3.0.0",
"istanbul": "0.4.5",
"jest": "27.0.6",
"jest-cli": "27.0.6",
"jest-css-modules": "2.1.0",
"jest-fetch-mock": "3.0.3",
"lint-staged": "10.5.4",
"lint-staged": "15.2.2",
"madge": "5.0.1",
"mock-socket": "9.0.3",
"node-polyfill-webpack-plugin": "1.1.4",
Expand Down
Loading

0 comments on commit 5c18981

Please sign in to comment.