728x90
반응형
$ yarn add --dev eslint-plugin-prettier
$ yarn add --dev eslint-config-prettier

 

해당 명령어로 eslint 를 설정해주고

 

생성되어있는

 

.eslint.json을

 

{
"parser": "@typescript-eslint/parser",
"plugins": ["react", "@typescript-eslint"],
"extends": [
"eslint:recommended",
"@react-native-community",
"airbnb",
"airbnb/hooks",
"plugin:prettier/recommended"
],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"prettier/prettier": ["error", { "endOfLine": "auto" }],
"react/react-in-jsx-scope": "off"
},
"settings": {
"react": {
"version": "detect"
}
},
"env": {
"browser": true,
"node": true
},
"globals": {
"__DEV__": true
}
}

 

로 변경해주고 vscode 를 재시작 하면 된다.

 

아래 옵션은 'React' must be in scope when using JSX 라는 워닝이 나올때 꺼주면, 모든 컴포넌트에서

 

import react from 'React'를 사용할 필요가 없다.

 

"react/react-in-jsx-scope": "off"

728x90
반응형

+ Recent posts