Skip to content

Commit

Permalink
Task #217402 fix: Husky Implementation and Integration in React
Browse files Browse the repository at this point in the history
  • Loading branch information
deechavhan098 committed Jun 19, 2024
1 parent 79be4f6 commit d717315
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 6 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
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "es5",
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"useTabs": false
}
11 changes: 7 additions & 4 deletions eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,26 @@
"eslint:recommended",
"plugin:import/errors",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended"
"plugin:jsx-a11y/recommended",
"prettier"
],
"plugins": ["react", "import", "jsx-a11y"],
"plugins": ["react", "import", "jsx-a11y", "prettier"],
"rules": {
"react/prop-types": 0,
"indent": ["error", 2],
"linebreak-style": 1,
"quotes": ["error", "double"]
"quotes": ["error", "double"],
"prettier/prettier": "error"
},
"parserOptions": {
"ecmaVersion": 2021,
"ecmaVersion": 12,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"es2021": true,
"es6": true,
"browser": true,
"node": true
Expand Down
27 changes: 25 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"split-graphemes": "^0.5.0",
"use-sound": "^4.0.1",
"web-vitals": "^2.1.4",
"eslint": "^8.46.0",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.33.1"
Expand All @@ -70,7 +69,10 @@
"react-app",
"react-app/jest"
],
"ignorePatterns": ["build/", "public/js/jquery-3.7.0.min.js"]
"ignorePatterns": [
"build/",
"public/js/jquery-3.7.0.min.js"
]
},
"browserslist": {
"production": [
Expand All @@ -83,5 +85,26 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"eslint": "^7.32.0",
"prettier": "^2.3.2",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^3.4.0",
"husky": "^9.0.11",
"lint-staged": "^11.0.0",
"react": "^18.2.0",
"@mui/styles": "^5.15.10"
},
"lint-staged": {
"src/**/*.{js,jsx}": [
"npx eslint --fix",
"npx prettier --write"
]
},
"husky": {
"hooks": {
"pre-commit": "npx lint-staged"
}
}
}

0 comments on commit d717315

Please sign in to comment.