Skip to content

Commit

Permalink
add lint-staged
Browse files Browse the repository at this point in the history
  • Loading branch information
mebtte committed May 7, 2022
1 parent 4574542 commit 88c1c47
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module.exports = {
node: true,
},
globals: {
ValueOf: 'readonly',
AsyncReturnType: 'readonly',
},
extends: ['plugin:react/recommended', 'airbnb', 'prettier'],
Expand Down
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
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,jsx,ts,tsx,json,md,css}": ["prettier --write"]
}
2 changes: 0 additions & 2 deletions global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ declare module '*.png' {
export default value;
}

type ValueOf<T> = T[keyof T];

type AsyncReturnType<T extends (...args: any[]) => Promise<any>> = T extends (
...args: any[]
) => infer P
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
"eslint-plugin-react-hooks": "^4.5.0",
"fork-ts-checker-webpack-plugin": "^7.2.11",
"html-webpack-plugin": "^5.5.0",
"husky": "^7.0.4",
"lint-staged": "^12.4.1",
"prettier": "^2.6.2",
"react": "^18.1.0",
"react-dom": "^18.1.0",
Expand All @@ -70,7 +72,8 @@
"scripts": {
"dev:pwa": "npm run dev -w apps/pwa",
"dev:server": "npm run dev -w apps/server",
"tslint": "ts-node-esm scripts/tslint.ts"
"tslint": "ts-node-esm scripts/tslint.ts",
"prepare": "husky install"
},
"overrides": {
"react": "^18.1.0",
Expand Down

0 comments on commit 88c1c47

Please sign in to comment.