728x90
에러 현상
Expected an assignment or function call and instead saw an expression @typescript-eslint/no-unused-expressions
할당 또는 함수 호출이 예상되었으나 표현식이 나왔다 @타입스크립트 사용하지 않는 expression이 나왔다.
const setCookie = (name: string, value: string, day: number) => {
let today = new Date();
today.setDate(today.getDate() + day);
document.cookie = name + "=" + value + "; path=/; expires=" + today.toUTCString();📌 + ";"
}
문법적 오류로 인해 할당도 되지 않고 적절한 함수 표현식으로 작성되었다.
728x90
'Typescript & React' 카테고리의 다른 글
'delete' 연산자의 피연산자는 선택 사항이어야 합니다.ts(2790) (0) | 2024.06.18 |
---|---|
React에서 실제 값은 변경 정상 하지만 화면은 변경 안됨 해결 (1) | 2024.06.18 |
React에서 react-hook-form 새로고침 문제 해결 방법은? (0) | 2024.06.12 |
SyntaxError: Unexpected end of JSON input (0) | 2024.02.15 |
useHistory에서 새로고침이 되지 않을 때 해결방안 (0) | 2024.02.03 |