// 최소 게이트 — 전체 스타일 린트가 아니라, tsc 가 못 잡는 런타임 크래시 버그만 막는다. // (negodata 보일러플레이트에서 이식. 도입 계기는 로컬 const 가 동명 import 를 가려 // zustand 셀렉터가 TDZ 참조 → 프로덕션 크래시. 그 케이스는 tsc --noEmit 도 통과했다.) import tseslint from 'typescript-eslint'; import reactHooks from 'eslint-plugin-react-hooks'; export default tseslint.config({ files: ['src/**/*.{ts,tsx}'], ignores: ['src/api/generated/**'], languageOptions: { parser: tseslint.parser, }, plugins: { '@typescript-eslint': tseslint.plugin, 'react-hooks': reactHooks, }, rules: { // 훅 호출 순서 위반은 런타임 크래시라 error, deps 누락은 기존 코드가 많아 warn. 'react-hooks/rules-of-hooks': 'error', 'react-hooks/exhaustive-deps': 'warn', // 선언보다 위에서 변수를 쓰는 것(TDZ) 차단. 함수/타입 호이스팅은 안전하므로 허용. 'no-use-before-define': 'off', '@typescript-eslint/no-use-before-define': [ 'error', {functions: false, classes: false, typedefs: false, enums: false, variables: true}, ], // 상위 스코프(import 포함) 이름을 가리는 재선언 차단. 'no-shadow': 'off', '@typescript-eslint/no-shadow': 'error', }, });