-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.eslintrc.json
46 lines (46 loc) · 1.92 KB
/
.eslintrc.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"root": true,
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended", // eslint --init 명령으로 기본 생성 됨. 단, eslint --init 이후 typescript, react 사용함에 check
"plugin:react/recommended", // eslint --init 명령으로 기본 생성 됨. 단, eslint --init 이후 typescript, react 사용함에 check
"plugin:@typescript-eslint/recommended", // eslint --init 명령으로 기본 생성 됨. 단, eslint --init 이후 typescript, react 사용함에 check
"react-app", // CRA로 프로젝트 생성 시 기본 생성 됨.
"react-app/jest", // CRA로 프로젝트 생성 시 기본 생성 됨.
"prettier" // formatter는 프리티어로 대체함
],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": ["react", "@typescript-eslint"],
"rules": {
// 리액트 17버전 이후는 jsx 문법 사용시 React를 import 하지 않아도 되어서 off
"react/react-in-jsx-scope": 0,
"no-unused-vars": "warn",
// props 구조분해할당 하기 위해 off
"react/jsx-props-no-spreading": "off",
// 컴포넌트 생성시 화살표함수를 이용하도록
"react/function-component-definition": [
2,
{ "namedComponents": "arrow-function" }
],
// 함수 밖에서 선언된 변수와 같은 이름의 변수를 사용하기 위해
"no-shadow": ["warn"],
// export default 뿐 아니라 named export 방식도 사용할 수 있게 off
"import/prefer-default-export": "off",
// Reports if a module's default export is unnamed.
"import/no-anonymous-default-export": "off",
// Disallow specified global variables.
"no-restricted-globals": "off",
// Enforce return statements in callbacks of array methods.
"array-callback-return": "off"
}
}