From e7fa3febf2cb3df3930f1f71751eda4405660116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E4=BC=9F=E5=BC=BA?= Date: Mon, 29 May 2023 17:25:16 +0800 Subject: [PATCH] chore: change lint rule --- web/.eslintignore | 7 +++++++ web/.eslintrc.json | 4 ++-- web/.husky/pre-commit | 4 ++++ web/.lintstagedrc.js | 4 ---- .../(commonLayout)/app/(appDetailLayout)/layout.tsx | 6 +++--- web/package.json | 10 +++++++++- 6 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 web/.eslintignore create mode 100755 web/.husky/pre-commit delete mode 100644 web/.lintstagedrc.js diff --git a/web/.eslintignore b/web/.eslintignore new file mode 100644 index 0000000000..8a8bc38d80 --- /dev/null +++ b/web/.eslintignore @@ -0,0 +1,7 @@ +/**/node_modules/* +node_modules/ + +dist/ +build/ +out/ +.next/ \ No newline at end of file diff --git a/web/.eslintrc.json b/web/.eslintrc.json index db813b0b25..9d8ea2cc8d 100644 --- a/web/.eslintrc.json +++ b/web/.eslintrc.json @@ -23,6 +23,6 @@ ] } ], - "react-hooks/exhaustive-deps": "warning" + "react-hooks/exhaustive-deps": "warn" } -} +} \ No newline at end of file diff --git a/web/.husky/pre-commit b/web/.husky/pre-commit new file mode 100755 index 0000000000..7a8fabf9e8 --- /dev/null +++ b/web/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +cd ./web && npx lint-staged diff --git a/web/.lintstagedrc.js b/web/.lintstagedrc.js deleted file mode 100644 index f3ada3baf0..0000000000 --- a/web/.lintstagedrc.js +++ /dev/null @@ -1,4 +0,0 @@ -export default { - '**/*.js?(x)': ['next lint --fix'], - '**/*.ts?(x)': ['next lint --fix'], -} \ No newline at end of file diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/layout.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/layout.tsx index d71a000f2b..7164a00be0 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/layout.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/layout.tsx @@ -7,9 +7,9 @@ export type IAppDetail = { const AppDetail: FC = ({ children }) => { return ( - <> - {children} - + <> + {children} + ) } diff --git a/web/package.json b/web/package.json index 0397d2f627..ff6fd51bfd 100644 --- a/web/package.json +++ b/web/package.json @@ -8,7 +8,7 @@ "start": "next start", "lint": "next lint", "fix": "next lint --fix", - "prepare": "cd ../ && husky install" + "prepare": "cd ../ && husky install ./web/.husky" }, "dependencies": { "@emoji-mart/data": "^1.1.2", @@ -84,5 +84,13 @@ "miragejs": "^0.1.47", "postcss": "^8.4.21", "tailwindcss": "^3.2.7" + }, + "lint-staged": { + "**/*.js?(x)": [ + "eslint --fix" + ], + "**/*.ts?(x)": [ + "eslint --fix" + ] } } \ No newline at end of file