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

env: 개발 환경 세팅 #2

Merged
merged 5 commits into from
Sep 24, 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
133 changes: 133 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"env": {
"browser": true,
"es2020": true
},
"extends": [
"plugin:react/recommended",
"airbnb",
"prettier",
"plugin:@tanstack/eslint-plugin-query/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react",
"react-refresh",
"react-hooks",
"@typescript-eslint",
"unused-imports",
"@tanstack/query"
],
"ignorePatterns": [
"!**/.storybook/**/*"
],
"rules": {
"import/extensions": [
"off"
],
"import/prefer-default-export": "off",
"no-plusplus": "off",
"semi": [
"error",
"always"
],
"react/jsx-filename-extension": [
"error",
{
"extensions": [
".tsx",
".jsx"
]
}
],
"import/order": [
"error",
{
"groups": [
"internal",
"external"
]
}
],
"@typescript-eslint/type-annotation-spacing": [
"error"
],
"@typescript-eslint/method-signature-style": [
"error"
],
"unused-imports/no-unused-imports": [
"error"
],
"react/jsx-indent-props": [
"error",
"first"
],
"react/jsx-curly-newline": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-props-no-spreading": "off",
"react/jsx-wrap-multilines": "off",
"no-unused-vars": "off",
"no-proto": "off",
"camelcase": "off",
"class-methods-use-this": "off",
"jsx-a11y/label-has-associated-control": "off",
"max-classes-per-file": "off",
"max-len": "off",
"no-param-reassign": "off",
"no-shadow": "off",
"no-undef": "off",
"no-underscore-dangle": "off",
"no-use-before-define": "off",
"no-useless-escape": "off",
"react/jsx-no-useless-fragment": "off",
"react/no-array-index-key": "off",
"react/no-unused-prop-types": "off",
"react/require-default-props": "off",
"react/function-component-definition": "off",
"react/react-in-jsx-scope": "off",
"no-console": "off",
"no-alert": "off",
"import/no-unresolved": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"react/destructuring-assignment": "off",
"no-promise-executor-return": "off",
"no-nested-ternary": "off",
"import/no-extraneous-dependencies": "off",
"no-restricted-syntax": "off",
"@tanstack/query/exhaustive-deps": "error",
"@tanstack/query/no-rest-destructuring": "warn",
"@tanstack/query/stable-query-client": "error"
},
"overrides": [
{
"files": [
"src/**/*.spec.ts",
"src/**/*.spec.tsx"
],
"plugins": [
"vitest"
],
"extends": [
"plugin:vitest/recommended"
],
"rules": {
"vitest/expect-expect": "off"
},
"globals": {
"describe": true,
"it": true,
"expect": true,
"beforeEach": true,
"afterEach": true,
"beforeAll": true,
"afterAll": true,
"vi": true
}
}
]
}
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'CI'

on:
- pull_request

jobs:
ci:
name: CI
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: v20.17.0

- name: Install Dependencies
run: yarn install

- name: Check ESLint
run: yarn g:lint

- name: Check Prettier
run: yarn g:prettier:check

# - name: Check Unit Test
# run: yarn run test
4 changes: 4 additions & 0 deletions .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"

yarn lint-staged
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "auto"
}
3 changes: 3 additions & 0 deletions apps/review-note/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
},
"dependencies": {
"@review-note/ui": "workspace:^",
"@tanstack/react-query": "^5.40.0",
"@types/react-router-dom": "^5.3.3",
"axios": "^1.7.2",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
24 changes: 24 additions & 0 deletions barrels-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"delete": true,
"directory": [
"./packages/ui/src",
"./apps/review-note/src/components",
"./apps/review-note/src/pages",
"./apps/review-note/src/features",
"./apps/review-note/src/shared"
],
"exclude": [
".spec.tsx",
".stories.tsx",
".css.ts",
".css.tsx",
".style.ts",
".style.tsx",
".constant.ts",
".constant.tsx",
".test.tsx",
"vite-env"
],
"location": "all",
"singleQuotes": true
}
32 changes: 29 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,48 @@
"packages/*"
],
"scripts": {
"dev:review": "yarn workspace @review-note/review dev"
"dev:review": "yarn workspace @review-note/review dev",
"g:prettier:check": "yarn workspaces foreach -Apt run prettier:check",
"g:prettier:write": "yarn workspaces foreach -Apt run prettier:write",
"g:lint": "yarn workspaces foreach -Apt run lint",
"preview:review": "yarn workspace @review-note/review preview",
"generate-barrels": "npx barrelsby --config barrels-config.json"
},
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.17.7",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"barrelsby": "^2.8.1",
"eslint": "^8.42.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.1",
"eslint-plugin-unused-imports": "^2.0.0",
"eslint-plugin-vitest": "^0.3.22",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"prettier": "^2.8.8",
"typescript": "5.0.2"
},
"dependencies": {
"@chakra-ui/icon": "^3.2.0",
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/react": "^2.8.2",
"@chakra-ui/system": "^2.6.2",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"framer-motion": "^10.15.1",
"zustand": "^4.3.8"
},
"lint-staged": {
"*.{ts,tsx}": [
"yarn g:lint",
"yarn g:prettier:check"
]
}
}
Loading
Loading