-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc
More file actions
59 lines (59 loc) · 2.12 KB
/
.eslintrc
File metadata and controls
59 lines (59 loc) · 2.12 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"extends": [
"airbnb",
"plugin:import/recommended",
"plugin:jsx-a11y/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"consistent-return": "off", // 항상 return하거나 아예 return 하지 않아야 함.
"import/extensions": "off", // 확장자 명시
"import/no-extraneous-dependencies": [
// package.json에 명시되지 않은 의존성 import 금지
// 여기서는 위 extends의 설정에 의해 devDependencies에 명시되어 있어도 에러를 일으켜서 devDependencies를 true로 변경함
"error",
{
"devDependencies": true
}
],
"import/prefer-default-export": "off", // export가 1개면 default export로 작성
"no-shadow": "off", // 상위 스코프의 변수명과 동일한 변수명 사용 금지
"no-nested-ternary": "off", // 중첩 삼항연산자 사용 금지
"no-useless-escape": "off", // 불필요한 이스케이프 문자 금지
"react/jsx-no-useless-fragment": "off", // 불필요한 fragment 금지
"react/jsx-props-no-spreading": "off", // JSX에 props를 스프레드 연산자로 전달 금지
"react/react-in-jsx-scope": "off", // jsx파일에서 React를 import 해야 함
// jsx 문법을 포함할 수 있는 파일 확장자 제한
"react/jsx-filename-extension": [
"error",
{ "extensions": [".jsx", ".tsx"] }
],
"react/prop-types": ["off"], // propTypes를 작성해야 함
"react/require-default-props": "off", // defaultProps를 작성해야 함
"react-hooks/exhaustive-deps": "off" // react hook deps 배열에 의존성 입력, useCallback의 경우 함수 표현식 사용
},
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
},
"typescript": {}
}
}
}