인프런 커뮤니티 질문&답변
VScode에서 prettier, eslint 설정시 에러
작성
·
728
0
강의 대로 따라가다라 에러가나서 구글링해서 제가 임의로 수정하였습니다. eslint 사용해본 경험이 없어 제가 임의로 한 설정에 의구심이 드네요
eslint-config-prettier, eslint-plugin-prettier 설치하고
.eslintrc
{
"parser": "@babel/eslint-parser",
"parserOptions" :{
"ecmaVersion" : 2020,
"sourceType" : "module",
"ecmaFeatures" : {
"jsx" : true
}
},
"env": {
"browser" : true,
"node" : true,
"es6" : true
},
"extends" : [
"airbnb",
"plugin:prettier/recommended"
],
"plugins" : [
"import",
"react-hooks"
],
"rules": {
"jsx-a11y/label-has-associated-control": "off",
"jsx-a11y/anchor-is-valid": "off",
"no-console": "off",
"no-underscore-dangle": "off",
"react/forbid-prop-types": "off",
"react/jsx-filename-extension": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-wrap-multilines": "off",
"react/no-array-index-key": "off",
"object-curly-newline": "off",
"linebreak-style": "off",
"arrow-body-style": "off",
"comma-dangle": "off",
"consistent-return": "off",
"operator-linebreak": "off",
"react/function-component-definition" : "off",
"jsx-a11y/no-noninteractive-element-interactions" : "off",
"jsx-a11y/click-events-have-key-events" : "off"
}
}
PostImages.js 에서 img 태그에 onClick={onZoom} 하는 부분에서 jsx-a11y 에러가 나서 그냥 off 했는데 상관없는지, eslintrc 설정은 문제없는지 봐주시면 감사하겠습니다.
퀴즈
Redux Thunk의 주된 역할은 무엇일까요?
상태 변화 로깅하기
비동기 액션 처리 돕기
액션 타입 상수화 강제하기
리듀서 불변성 자동으로 관리하기
답변 1
0
제로초(조현영)
지식공유자
jsx-a11y는 접근성 관련한 것인데요. 웹 접근성 반드시 지켜야하는 것 아니면 다 끄셔도 됩니다.
다른 부분은 크게 문제가 없습니다. 저는 요즘 airbnb 대신 prettier 추가해서 쓰고 있습니다.





감사합니다. airbnb 대신 prettier 추가한다는 말이 .eslintrc 에서 extends에 "puglin:prettier/recommended" 만 추가한다는 말인가요?