
eslint.config 에 rule을 추가하던 도중 rules 속성의 타입이 어떻게 작동하는지 궁금하여 분석타입을 추적하다보면 /* Config.d.ts */type Severity = 0 | 1 | 2;type SeverityString = 'error' | 'off' | 'warn';type RuleLevel = Severity | SeverityString;type RuleLevelAndOptions = [RuleLevel, ...unknown[]];type RuleEntry = RuleLevel | RuleLevelAndOptions;type RulesRecord = Partial>; 이런식으로 rules 속성에 타입이 어떻게 정의되어 있는지 확인 할 수있다.먼저 Partial은 모든 속성을 옵..

'console' is not defined no-undef 에러해결eslint 에서 tseslint 설정 추가를 하던 도중 다음과 같은 에러가 발생하였다. 에러가 난 코드는 다음과 같다.test.tsclass Test { constructor() { console.debug('test'); }}new Test();문제 원인eslint 에서는 console 메서드를 사용하지 않는것을 권장 한다고 한다.공식문서 https://eslint.org/docs/latest/rules/no-console#rule-details해결방법eslint.config 설정 파일에 rules 에 다음과 같이 "no-console" : "off"를 추가하면 된다.경고만 뜨게 하고 싶다면 'warn'을 ..