inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

[리뉴얼] React로 NodeBird SNS 만들기

바뀐 상태 적용하고 eslint 점검하기

eslint

485

제이제이

작성한 질문수 11

0

저는 왜 제로초님처럼 didpatch가 없는 걸 잡아 주지않을까요?..
느낌이 recommended 했던때랑 비슷한거 같아요..
확장 프로그램으로는 Eslint, Prettier-eslint 깔려있어요
밑에는 제 파일들 입니다.
<eslint>
{
  "parser": "babel-eslint",
  "parserOptions": {
    "ecmaVersion": 2021,
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": true
    },
    "env": {
      "browser": true,
      "node": true,
      "es6": true
    },
    "extends": [
      "airbnb",
      "plugin:prettier/recommended"
    ],
    "plugins" : [
      "import",
      "react-hooks",
      "prettier"
    ],
    "rules": {
      "prettier/prettier": "error",
      "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",
      "object-curly-newline": "off",
      "linebreak-style": "off",
      "no-param-reassign": "off"
    }
  }
}
<package.json>
{
  "name": "react-nodebird-front",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "next"
  },
  "author": "",
  "license": "MIT",
  "dependencies": {
    "@ant-design/icons": "^4.6.2",
    "antd": "^4.16.6",
    "axios": "^0.21.1",
    "next": "^10.2.3",
    "next-redux-wrapper": "^7.0.2",
    "prop-types": "^15.7.2",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-hook-form": "^7.11.0",
    "react-redux": "^7.2.4",
    "react-slick": "^0.28.1",
    "redux": "^4.1.0",
    "redux-devtools-extension": "^2.13.9",
    "redux-saga": "^1.1.3",
    "styled-components": "^5.3.0"
  },
  "devDependencies": {
    "babel-eslint": "^10.1.0",
    "eslint": "^7.30.0",
    "eslint-config-airbnb": "^18.2.1",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-import": "^2.23.4",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-prettier": "^3.4.1",
    "eslint-plugin-react": "^7.24.0",
    "eslint-plugin-react-hooks": "^4.2.0",
    "prettier-eslint": "^13.0.0"
  }
}
<setting.json>
{
    "javascript.updateImportsOnFileMove.enabled": "always",
    "editor.wordWrap": "on",
    "workbench.preferredLightColorTheme": "Dracula Soft",
    "workbench.iconTheme": "material-icon-theme",
    "javascript.preferences.quoteStyle": "single",
    "typescript.preferences.quoteStyle": "single",
    "liveServer.settings.donotShowInfoMsg": true,
    "editor.fontSize": 17,
    "files.autoSaveDelay": 500,
    "editor.mouseWheelZoom": true,
    "liveServer.settings.fullReload": true,
    "editor.tabSize": 2,
    "javascript.format.enable": false,
    "workbench.sideBar.location": "right",
    "explorer.confirmDelete": false,
    "explorer.confirmDragAndDrop": false,
    "terminal.integrated.tabs.enabled": true,
    "editor.accessibilitySupport": "off",
    "eslint.alwaysShowStatus": true,
    "eslint.workingDirectories": [
    {
        "mode": "auto"
    }
],
"window.zoomLevel": 1,
"workbench.colorTheme": "Default Light+",
"files.autoSave": "afterDelay",
"[json]": {

    "editor.quickSuggestions": {
        "strings": true
    },
    "editor.suggest.insertMode": "replace"
}
}

eslint react nodejs redux express Next.js

답변 4

0

hee0735

저도 eslint를 써도 dispatch없는걸 잡아내지 못하네요 .. 왜그러지 ㅠㅠㅠ 

0

제로초(조현영)

제 깃헙이랑 버전 똑같이 맞추고 npm i 해서도 에러가 뜨지 않는다면 에디터 설정 문제입니다.

0

제이제이

"rules": {
      "no-undef": "error",
      "prettier/prettier": "error",
      "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",
      "object-curly-newline": "off",
      "linebreak-style": "off",
      "no-param-reassign": "off"
   }
추가했는데 에러가 안뜨네요 ㅜㅡㅜ.. 왜 에러를 내고 싶은데 못내게 하는지..아이러니,,

0

제이제이

아 그 영상에서 CommentForm 파일에서 제로초님이 useDispatch 모르고 안적으셨을때 dispatch변수 아래에 줄이 그여있었어서 저도 실험해볼려고 useDispatch 주석 처리해봤는데 dispatch에 줄이 안그이더라구요.. 그래서 ..

아 그리고 저 "jsx-a11y"는 위에서는 추가 안했었는데 방금 추가 했어요!

0

제로초(조현영)

ESLint: 'dispatch' is not defined.(no-undef)

이 에러가 떠야하긴 합니다.

rules에 "no-undef": "error" 추가해보세요.

0

제로초(조현영)

dispatch가 어디에 없는 것을 말씀하시는 건가요??

넥스트 버젼 질문

0

145

2

로그인시 401 Unauthorized 오류가 뜹니다

0

152

1

무한 스크롤 중 스크롤 튐 현상

0

246

1

특정 페이지 접근을 막고 싶을 때

0

173

2

createGlobalStyle의 위치와 영향범위

0

145

2

인라인 스타일 리렌더링 관련

0

139

2

vsc 에서 npm init 설치시 오류

0

206

2

nextjs 15버전 사용 가능할까요?

0

196

1

화면 새로고침 문의

0

161

1

RTK에서 draft, state 차이가 있나요?

0

203

2

Next 14 사용해도 될까요?

0

487

1

next, node 버전 / 폴더 구조 질문 드립니다.

0

393

1

url 오류 질문있습니다

0

248

1

ssh xxxxx로 우분투에 들어가려니까 port 22: Connection timed out

0

430

1

sudo certbot --nginx 에러

0

1351

2

Minified React error 콘솔에러 (hydrate)

0

532

1

카카오 공유했을 때 이전에 작성했던 글이 나오는 버그

0

287

1

프론트서버 배포 후 EADDRINUSE에러 발생

0

375

1

npm run build 에러

0

570

1

front 서버 npm run build 중에 발생한 에러들

0

450

1

서버 실행하고 브라우저로 들어갔을때 404에러

0

387

2

css 서버사이드 랜더링이 적용되지 않아서 문의 드립니다.

0

318

1

팔로워 3명씩 불러오고 데이터 합쳐주는걸로 바꾸고 서버요청을 무한으로하고있습니다.

0

294

2

해시태그 검색에서 throttle에 관해 질문있습니다.

0

231

1