Add husky and lint-staged

This commit is contained in:
seunghyunOh
2022-12-10 12:13:48 +09:00
parent 059f15b172
commit 9a3caac75f
12 changed files with 22490 additions and 19575 deletions

5
.husky/pre-commit Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged

7
.prettierrc Normal file
View File

@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 80,
"useTabs": false
}

View File

@ -1,18 +1,13 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"prettier"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-console": 2,
"prettier/prettier": 2
}
}
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-console": 2
}
}

View File

@ -1,7 +0,0 @@
{
"semi": true,
"trailingComma": "none",
"singleQuote": true,
"printWidth": 80,
"useTabs": true
}

39159
backend/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -30,12 +30,20 @@
"version": "1.0.0",
"main": "src/index.js",
"scripts": {
"prepare": "cd .. && npm install",
"start": "npm run build && node build/index.js",
"dev": "nodemon",
"build": "rimraf ./build && tsc && cp -R ./src/templates ./src/json ./build",
"lint": "eslint . --ext .ts",
"lint-and-fix": "eslint . --ext .ts --fix",
"prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write"
"prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write",
"lint-staged": "lint-staged"
},
"lint-staged": {
"*.{js,ts}": [
"eslint --fix",
"prettier --write"
]
},
"repository": {
"type": "git",
@ -66,6 +74,7 @@
"husky": "^8.0.1",
"install": "^0.13.0",
"jest": "^29.3.1",
"lint-staged": "^13.1.0",
"nodemon": "^2.0.19",
"npm": "^8.19.3",
"prettier": "^2.7.1",

View File

@ -15,7 +15,6 @@
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"simple-import-sort/exports": "warn",
"simple-import-sort/imports": [
"warn",

View File

@ -1,4 +0,0 @@
{
"tabWidth": 2,
"useTabs": false
}

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,19 @@
{
"private": true,
"scripts": {
"prepare": "cd .. && npm install",
"dev": "next dev",
"build": "next build",
"start": "next start",
"start:docker": "next build && next start",
"lint": "next lint"
"lint": "next lint",
"lint-staged": "lint-staged"
},
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
]
},
"dependencies": {
"@emotion/css": "^11.10.0",
@ -64,6 +72,7 @@
"postcss": "^8.4.14",
"prettier": "2.7.1",
"tailwindcss": "^3.1.4",
"typescript": "^4.9.3"
"typescript": "^4.9.3",
"lint-staged": "^13.1.0"
}
}

1154
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

28
package.json Normal file
View File

@ -0,0 +1,28 @@
{
"name": "infisical",
"repository": {
"type": "git",
"url": "git+https://github.com/infisical/infisical.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/infisical/infisical/issues"
},
"homepage": "https://github.com/infisical/infisical#readme",
"scripts": {
"prepare": "husky install"
},
"lint-staged": {
"**/*": "prettier --write --ignore-unknown",
"*.{ts,tsx}": [
"eslint --fix",
"prettier --write"
]
},
"devDependencies": {
"eslint": "^8.29.0",
"husky": "^8.0.2",
"prettier": "^2.8.1"
}
}