적용 단계는 다음과 같습니다.
1. tsconfig.json추가 하여 typescript 설정
2. 라이브러리 type 설치
3. eslint 설정
1. tsconfig.jon 추가 : 기존 jsconfig.jscon 파일이 있다면 삭제
{ "compilerOptions": { "target": "es6", "lib": [ "dom", "dom.iterable", "esnext" ], "incremental": true, "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", "baseUrl": ".", "paths": { "@/*": ["./src/*"] } }, "include": [ "src" ] }
2. 사용하는 라이브러리의 type 설치
npm i --save-dev @types/react-transition-group npm i --save-dev @types/react-router-dom npm i --save-dev @types/react npm i --save-dev @types/styled-components
3. eslint 설정
extends: [... 'plugin:@typescript-eslint/recommended'], plugins: [... '@typescript-eslint'], // type or interface 적용시 parameter lint 설정 'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
댓글 영역