Update .eslintrc.json and add prettier support
Add pre-commit hook to lint staged files
Add some eslint plugins
Gitlab: #2
Change-Id: Iea7800b66992dcb4b87501544647aedafe07a509
diff --git a/package.json b/package.json
index f8e046a..905c3c3 100644
--- a/package.json
+++ b/package.json
@@ -9,12 +9,20 @@
"scripts": {
"build": "npm run build-client",
"build:prod": "tsc && NODE_ENV=production npm run build-client",
- "build-client": "cd client && webpack",
+ "build-client": "cd client && npm run build",
"clean": "rm -rf dist client/dist",
"clean-all": "npm run clean && rm -rf node_modules client/node_modules",
+ "lint": "eslint \"**/*.{ts,tsx,js,jsx}\"",
+ "prepare": "husky install",
"start": "nodemon",
"start:prod": "NODE_ENV=production node dist/app.js"
},
+ "lint-staged": {
+ "**/*.{ts,tsx,js,jsx,json}": [
+ "eslint --fix",
+ "prettier --write"
+ ]
+ },
"dependencies": {
"@sentry/node": "^7.13.0",
"@sentry/tracing": "^7.13.0",
@@ -37,14 +45,24 @@
},
"devDependencies": {
"@svgr/webpack": "^6.3.1",
+ "@types/cookie-parser": "^1.4.3",
+ "@types/express": "^4.17.14",
+ "@types/express-session": "^1.17.5",
+ "@types/passport": "^1.0.11",
+ "@types/passport-local": "^1.0.34",
+ "@types/webpack-hot-middleware": "^2.25.6",
"@typescript-eslint/eslint-plugin": "^5.37.0",
"@typescript-eslint/parser": "^5.37.0",
"cypress": "^10.8.0",
"eslint": "^8.23.1",
- "eslint-plugin-react": "^7.31.8",
+ "eslint-config-prettier": "^8.5.0",
+ "eslint-plugin-unused-imports": "^2.0.0",
+ "husky": "^8.0.0",
"jami-web-client": "file:client",
+ "lint-staged": "^13.0.3",
"llnode": "^4.0.0",
"nodemon": "^2.0.20",
+ "prettier": "^2.7.1",
"raw-loader": "^4.0.2",
"ts-node": "^10.9.1",
"typescript": "^4.8.3",