강의

멘토링

로드맵

인프런 커뮤니티 질문&답변

유진리님의 프로필 이미지
유진리

작성한 질문수

React 기반 Gatsby로 기술 블로그 개발하기

TypeScript 개발 환경 구성하기

Parsing error: Cannot Read File tsconfig.json

작성

·

2.6K

1

 
// tsconfig.json
{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "allowJs": true,
    "jsx": "preserve",
    "strict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "baseUrl": "./src",
    "paths": {
      "components/*": ["./components/*"],
      "utils/*": ["./utils/*"],
      "hooks/*": ["./hooks/*"]
    },
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "resolveJsonModule": true
  },
  "include": ["src/**/*.tsx"],
  "exclude": ["node_modules"]
}
// eslintrc.json
{
  "env": {
    "browser": true,
    "es2021": true
  },
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:@typescript-eslint/recommended-requiring-type-checking",
    "plugin:prettier/recommended"
  ],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": 12,
    "sourceType": "module",
    "project": "./tsconfig.json"
  },
  "plugins": ["react", "@typescript-eslint"],
  "ignorePatterns": ["dist/", "node_modules/"],
  "rules": {}
}
// eslintignore
gatsby-browser.js
gatsby-config.js
gatsby-node.js
gatsby-ssr.js

 

eslintrc, eslintignore, tsconfig 모두 같은 폴더내부에 위치해있는데 왜 gatsby-browser.js 같은 설정 파일에서 parsing 에러가 날까요 ? ㅜㅜ

퀴즈

강의에서 설명하는 JAM Stack 아키텍처의 주요 이점이 아닌 것은 무엇인가요?

더 빠른 웹사이트 제공

복잡한 서버 백엔드 로직 관리 간소화

향상된 보안

쉬운 스케일링

답변 2

2

유진리님의 프로필 이미지
유진리
질문자

{
  "env": {
    "browser": true,
    "es2021": true
  },
  "extends": [
    "eslint:recommended",
    "@typescript-eslint/parser",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:@typescript-eslint/recommended-requiring-type-checking",
    "plugin:prettier/recommended"
  ],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": 12,
    "sourceType": "module",
    "project": "tsconfig.json"
  },
  "plugins": ["react", "@typescript-eslint"],
  "ignorePatterns": ["dist/", "node_modules/"],
  "rules": {}
}

 

extends에 @typescript-eslint/parser를 넣어서 해결했습니다!

0

주현도님의 프로필 이미지
주현도
지식공유자

안녕하세요, 곽성준님!

질문을 너무 늦게 확인했네요 죄송합니다 ㅠㅠ

스스로 해결 방안을 찾으셔서 정말 다행이네요!

유진리님의 프로필 이미지
유진리

작성한 질문수

질문하기