- 세팅날 해야 되는 것
- 환경변수 세팅 (서로 헷갈리지 않게…)
컨벤션 정하기
개발서버 (Vite)
Eslint
eslint.json
예시파일
{ "env": { "browser": true, "es2021": true }, "extends": [ "next/core-web-vitals", "prettier", "eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended", "plugin:storybook/recommended" ], "overrides": [], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": "latest", "sourceType": "module" }, "plugins": ["react", "import", "@typescript-eslint", "simple-import-sort"], ----------------- 우리팀꺼 "rules": { "react/prop-types": "off", "no-unused-vars": "warn", "@typescript-eslint/no-unused-vars": ["warn"], "simple-import-sort/imports": "error", "simple-import-sort/exports": "error", "react/react-in-jsx-scope": "off", "react/jsx-curly-brace-presence": ["error", { "props": "always", "children": "always" }], "react/function-component-definition": [ "error", { "namedComponents": "arrow-function", "unnamedComponents": "arrow-function" } ], "@typescript-eslint/naming-convention": [ "error", { "format": ["camelCase", "UPPER_CASE", "PascalCase"], "selector": "variable", "leadingUnderscore": "allow" }, { "format": ["camelCase", "PascalCase"], "selector": "function" }, { "format": ["PascalCase"], "selector": "interface" }, { "format": ["PascalCase"], "selector": "typeAlias" } ], "import/order": [ "error", { "groups": ["builtin", "external", ["parent", "sibling"], "index"], "pathGroups": [ { "pattern": "react", "group": "builtin" }, { "pattern": "@/**", "group": "external", "position": "after" } ], "alphabetize": { "order": "asc", "caseInsensitive": true }, "newlines-between": "always" } ] } }
package.json
{ "name": "13th-7team-fe", "version": "0.1.0", "private": true, "scripts": { "dev": "NEXT_PUBLIC_API_MOCKING=disable next dev", "build": "next build", "start": "node server.js", "lint": "next lint", "prepare": "husky install", "sb": "storybook dev -p 6006", "build-storybook": "storybook build", "msw": "NEXT_PUBLIC_API_MOCKING=enable next dev" }, "dependencies": { "@faker-js/faker": "^8.0.2", "@sentry/nextjs": "^7.57.0", "@sentry/utils": "^7.57.0", "@tanstack/react-query": "^4.29.7", "@tanstack/react-query-devtools": "^4.29.7", "@types/event-source-polyfill": "^1.0.1", "@types/node": "20.2.3", "@types/react": "18.2.6", "@types/react-dom": "18.2.4", "axios": "^1.4.0", "chromatic": "^6.18.0", "eslint-config-next": "13.4.3", "event-source-polyfill": "^1.0.31", "framer-motion": "^10.12.16", "lodash": "^4.17.21", "msw": "^1.2.1", "next": "13.4.3", "next-auth": "^4.22.1", "react": "18.2.0", "react-dom": "18.2.0", "react-error-boundary": "^4.0.10", "react-hook-form": "^7.43.9", "react-intersection-observer": "^9.4.4", "server-only": "^0.0.1", "swiper": "^9.3.2", "tailwind-merge": "^1.13.0", "tailwindcss": "3.3.2", "zustand": "^4.3.8" }, "devDependencies": { "@hookform/resolvers": "^3.1.0", "@storybook/addon-essentials": "^7.0.14", "@storybook/addon-interactions": "^7.0.14", "@storybook/addon-links": "^7.0.14", "@storybook/addon-styling": "^1.0.8", "@storybook/addon-viewport": "^7.0.18", "@storybook/blocks": "^7.0.14", "@storybook/nextjs": "^7.0.14", "@storybook/react": "^7.0.14", "@storybook/testing-library": "^0.0.14-next.2", "@types/lodash": "^4.14.195", "@typescript-eslint/eslint-plugin": "^5.59.7", "@typescript-eslint/parser": "^5.59.7", "autoprefixer": "^10.4.14", "eslint": "^8.22.0", "eslint-config-prettier": "^8.8.0", "eslint-import-resolver-typescript": "^3.5.5", "eslint-plugin-import": "^2.27.5", "eslint-plugin-react": "^7.32.2", "eslint-plugin-simple-import-sort": "^10.0.0", "eslint-plugin-storybook": "^0.6.12", "husky": "^8.0.0", "lint-staged": "^13.2.2", "msw-storybook-addon": "^1.8.0", "postcss": "^8.4.23", "prettier": "^2.8.8", "prettier-plugin-tailwindcss": "^0.3.0", "storybook": "^7.0.14", "storybook-addon-cookie": "^3.0.1", "typescript": "5.0.4", "yup": "^1.1.1" }, "lint-staged": { "src/**/*.{ts,tsx}": [ "eslint --ext .tsx --ext .ts ./src --fix" ], "src/**": [ "prettier --write \"**/*.{js,jsx,ts,tsx,md,css}\"" ] }, "msw": { "workerDirectory": "public" }, "readme": "ERROR: No README data found!", "_id": "13th-7team-fe@0.1.0" }
// Your JavaScript or TypeScript file (e.g., eslintConfig.js) module.exports = { rules: { 'react/prop-types': 'off', 'no-unused-vars': 'warn', '@typescript-eslint/no-unused-vars': ['warn'], 'simple-import-sort/imports': 'error', 'simple-import-sort/exports': 'error', 'react/react-in-jsx-scope': 'off', 'react/jsx-curly-brace-presence': ['error', { props: 'always', children: 'always' }], 'react/function-component-definition': [ 'error', { namedComponents: 'arrow-function', unnamedComponents: 'arrow-function', }, ], '@typescript-eslint/naming-convention': [ 'error', { format: ['camelCase', 'UPPER_CASE', 'PascalCase'], selector: 'variable', leadingUnderscore: 'allow', }, { format: ['camelCase', 'PascalCase'], selector: 'function', }, { format: ['PascalCase'], selector: 'interface', }, { format: ['PascalCase'], selector: 'typeAlias', }, ], 'import/order': [ 'error', { groups: ['builtin', 'external', ['parent', 'sibling'], 'index'], pathGroups: [ { pattern: 'react', group: 'builtin', }, { pattern: '@/**', group: 'external', position: 'after', }, ], alphabetize: { order: 'asc', caseInsensitive: true, }, 'newlines-between': 'always', }, ], }, };
Prettier 설정
레포지토리 (커밋 컨벤션, 이슈템플릿, PR템플릿, PR규칙)
보일러플레이트 코드 (폴더구조)
Main.tsx → Recoil, Emotion, Global UI 세팅 같이 파일 보면서
axios 모듈 세팅 (인스턴스를 미리 만들어놔서,,. 서로 어떻게 쓰는지 확인을 해야 함)
절대경로 alias 세팅