Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

husky #63

Merged
merged 7 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 52 additions & 1 deletion client/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
{
"extends": "next/core-web-vitals"
"root": true,
"env": {
"es6": true,
"browser": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": { "jsx": true }
},
"settings": {
"import/resolver": {
"node": {}
},
"import/parsers": { "@typescript-eslint/parser": [".ts", ".tsx"] }
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"next",
"next/core-web-vitals",
"prettier"
],
"plugins": ["@typescript-eslint", "react"],
"rules": {
"@typescript-eslint/no-explicit-any": ["off"],
"@typescript-eslint/no-var-requires": "warn",
"@typescript-eslint/naming-convention": [
"error",
{ "format": ["camelCase", "PascalCase"], "selector": "function" },
{ "format": ["PascalCase"], "selector": "interface" },
{ "format": ["PascalCase"], "selector": "typeAlias" }
],
"@typescript-eslint/no-unused-vars": [
"error",
{ "ignoreRestSiblings": true }
],
"import/order": [
"error",
{
"groups": ["builtin", "external", "parent", "sibling", "index"],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
},
"newlines-between": "never"
}
]
},
"ignorePatterns": ["node_modules/", "out/", "build/", ".next/", "public/"]
}
4 changes: 4 additions & 0 deletions client/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

cd ./client && npx lint-staged
4 changes: 4 additions & 0 deletions client/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package-lock.json
yarn.lock
node_modules
.github
8 changes: 8 additions & 0 deletions client/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"bracketSpacing": true,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80,
"tabWidth": 2
}
21 changes: 19 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next dev",
"lint": "next lint"
"prepare": "cd .. && husky install client/.husky",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
},
"dependencies": {
"@emotion/react": "^11.11.1",
Expand All @@ -24,6 +25,7 @@
"date-fns": "^2.30.0",
"eslint": "8.47.0",
"eslint-config-next": "13.4.13",
"eslint-plugin-import": "^2.29.1",
"i18next": "^23.6.0",
"leaflet": "^1.9.4",
"next": "13.4.13",
Expand All @@ -44,6 +46,21 @@
"devDependencies": {
"@svgr/webpack": "^8.1.0",
"@types/leaflet": "^1.9.8",
"@types/react-swipeable-views": "^0.13.5"
"@types/react-swipeable-views": "^0.13.5",
"@typescript-eslint/eslint-plugin": "^6.2.0",
"@typescript-eslint/parser": "^6.2.0",
"eslint-config-prettier": "^8.9.0",
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-react": "^7.33.1",
"husky": "^8.0.3",
"lint-staged": "13.2.2",
"prettier": "2.8.8"
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write"
]
}
}
8 changes: 4 additions & 4 deletions client/src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { NextIntlClientProvider } from "next-intl";
import { notFound } from "next/navigation";
import { notFound } from 'next/navigation';
import { NextIntlClientProvider } from 'next-intl';

export function generateStaticParams() {
return [{ locale: "en" }, { locale: "kr" }];
return [{ locale: 'en' }, { locale: 'kr' }];
}

export default async function LocaleLayout({
Expand All @@ -18,7 +18,7 @@ export default async function LocaleLayout({

return (
<html lang={locale}>
<body style={{ margin: 0}}>
<body style={{ margin: 0 }}>
<NextIntlClientProvider locale={locale} messages={messages}>
{children}
</NextIntlClientProvider>
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/[locale]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ export default function Home() {
<MenuItem value="coming-soon">{t("future")}</MenuItem>
<MenuItem value="past">{t("present")}</MenuItem>
</Select>

{/* Change View */}
<IconButton onClick={controlChangeView}>
{swipeView ? <WindowIcon /> : <ListIcon />}
Expand Down Expand Up @@ -185,6 +184,7 @@ export default function Home() {
},
}}
>

<MultiPageForm closeForm={closeTravelNote} />
</Dialog>
</div>
Expand Down
Loading
Loading