Skip to content

Commit

Permalink
🐕 Feature/husky implementation (#2851)
Browse files Browse the repository at this point in the history
* husky added

* additional rule added

* new rule

* additional rule

* html added

* test lint

* new rules added

* Optimize tsconfig

* Run eslint first

* Fix the typescript config

Co-authored-by: tomekstepien <tomasz.stepien@elliptic.co>
Co-authored-by: Theophile Sandoz <theophile.sandoz@gmail.com>
  • Loading branch information
3 people authored Apr 15, 2022
1 parent 9b39641 commit 5a1776d
Show file tree
Hide file tree
Showing 8 changed files with 251 additions and 26 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
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
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,24 @@
]
},
"scripts": {
"lint": "wsrun --package ui -c lint",
"lint": "wsrun --package ui -c lint:fix",
"build": "wsrun --fast-exit --stages -c --exclude @joystream/markdown-editor build",
"build:storybook": "wsrun --fast-exit --stages -c --exclude ui --exclude-missing build && wsrun --package ui -c build:storybook",
"storybook": "wsrun --exclude-missing -c storybook",
"test": "wsrun --fast-exit --package ui -c test",
"ci-test": "NODE_OPTIONS=--max_old_space_size=7000 wsrun --fast-exit --package ui -c test",
"start": "wsrun --package ui -c start"
"start": "wsrun --package ui -c start",
"prepare": "husky install"
},
"dependencies": {
"eslint-plugin-import": "^2.23.4",
"wsrun": "^5.2.4"
},
"devDependencies": {
"eslint": "^7.29.0"
"@typescript-eslint/parser": "^5.19.0",
"eslint": "^7.29.0",
"husky": ">=6",
"lint-staged": ">=10"
},
"resolutions": {
"@polkadot/api": "5.9.1",
Expand All @@ -47,5 +51,11 @@
"engines": {
"node": ">=14.0.0",
"yarn": "^1.22.0"
},
"lint-staged": {
"packages/ui/src/**/*.{js,ts,tsx,html}": [
"eslint --fix",
"prettier --write"
]
}
}
1 change: 0 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
"@types/mime": "^2.0.3",
"@types/yargs": "^17.0.3",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"babel": "^6.23.0",
"babel-jest": "^27.2.5",
"babel-loader": "^8.2.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const LeaveRoleSignModal = ({ onClose, transaction, worker, service }: Pr
signer: signer?.address ?? '',
service,
})

return (
<TransactionModal service={service} onClose={onClose}>
<ModalBody>
Expand Down
19 changes: 4 additions & 15 deletions packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
{
"ts-node": {
"files": false
},
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"sourceMap": true,
"strict": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"jsx": "react",
"lib": ["DOM", "ES2020"],
"types": ["jest"],
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"@polkadot/api/augment": ["../types/augment/augment-api.ts"],
"@polkadot/types/augment": ["../types/augment/augment-types.ts"]
},
"baseUrl": "."
}
},
"include": ["dev", "src", "test"],
}
19 changes: 19 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"ts-node": {
"files": false
},
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"sourceMap": true,
"strict": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"jsx": "react",
"lib": ["DOM", "ES2020"],
"types": ["jest"],
"baseUrl": "."
},
"exclude": ["**/node_modules"]
}
Loading

1 comment on commit 5a1776d

@vercel
Copy link

@vercel vercel bot commented on 5a1776d Apr 15, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

pioneer-2 – ./

pioneer-2-git-dev-joystream.vercel.app
pioneer-2.vercel.app
pioneer-2-joystream.vercel.app

Please sign in to comment.