Skip to content

Commit

Permalink
🔧 Update: chore eslint-config
Browse files Browse the repository at this point in the history
  • Loading branch information
ws-071211 committed Aug 24, 2024
1 parent 3d99c71 commit 0767db8
Show file tree
Hide file tree
Showing 4 changed files with 1,321 additions and 600 deletions.
71 changes: 69 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,70 @@
{
"extends": "next/core-web-vitals"
}
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"ignorePatterns": ["node_modules/**", "**/dist/**"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint", "import"],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"no-console": ["error", { "allow": ["warn", "error", "info"] }],
"@typescript-eslint/no-empty-interface": "off",
"react-hooks/exhaustive-deps": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-function": "off",
"react/react-in-jsx-scope": "off",
"import/order": [
"warn",
{
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object",
"type"
]
}
],// 일단 style의 경우 {}같은 형식으로 불러오는 hook또는 함수 사이에 있어 import에서 걸림 -> import를 아래쪽으로 내려 해결
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],// 사용하지않는 기능을 불러오는 경우 -> 삭제
"react/self-closing-comp": [
"error",
{
"component": true,
"html": true
}
],
// 수정해야할 부분들
"no-empty": "off",// 대부분 catch라서 off..
"react/prop-types": "off",// 아직 파악을 제대로 하지 못 함
"prefer-const": "warn", //const로 바꿔도 문제가 없는 let
"no-extra-boolean-cast":"warn", // 불필요한 !!사용 필요한 경우 Boolean()으로 바꾸는게 더 좋을 수도 있음
"no-constant-condition": "warn",// 항상 결과가 참 또는 거짓임
"@typescript-eslint/no-inferrable-types": "warn",//추론 가능 타입
"@typescript-eslint/ban-types": "warn"// Object -> NonNullable<object>
}
}
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"build:dev": "env-cmd -f .env.development next build",
"start": "next start",
"lint": "next lint",
"analyze": "ANALYZE=true next build"
"analyze": "ANALYZE=true next build",
"prettier": "prettier --write **/*.{ts,tsx}"
},
"dependencies": {
"@emotion/css": "^11.10.5",
Expand All @@ -25,8 +26,6 @@
"axios": "^1.2.3",
"caniuse-lite": "^1.0.30001559",
"env-cmd": "^10.1.0",
"eslint": "8.32.0",
"eslint-config-next": "13.1.2",
"jwt-decode": "^3.1.2",
"lottie-react": "^2.4.0",
"msw": "^1.2.1",
Expand All @@ -47,6 +46,12 @@
"workerDirectory": "public"
},
"devDependencies": {
"@next/bundle-analyzer": "^14.2.3"
"@next/bundle-analyzer": "^14.2.3",
"@typescript-eslint/eslint-plugin": "^5.57.1",
"@typescript-eslint/parser": "^5.57.1",
"eslint": "8.32.0",
"eslint-config-next": "^14.2.6",
"eslint-config-prettier": "^9.1.0",
"prettier": "^3.3.3"
}
}
1 change: 0 additions & 1 deletion src/components/Home/atoms/Script/SomeScript.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @next/next/inline-script-id */
import Script from 'next/script';

const ChannelIOScript = ({stunumName,theme}:{stunumName:string,theme:string}) => (
Expand Down
Loading

0 comments on commit 0767db8

Please sign in to comment.