Skip to content

Add TypeScript type checker and enhance validation engine infrastructure#4

Merged
ikjeong merged 6 commits intomainfrom
feat/engine-improvements
Nov 4, 2025
Merged

Add TypeScript type checker and enhance validation engine infrastructure#4
ikjeong merged 6 commits intomainfrom
feat/engine-improvements

Conversation

@ikjeong
Copy link
Copy Markdown
Contributor

@ikjeong ikjeong commented Nov 4, 2025

Summary

검증 엔진 인프라 강화 및 TypeScript 타입 체커 엔진 추가

  • TypeScript/JavaScript 타입 안전성 검증 엔진
  • ESLint, Prettier, TSC 어댑터 테스트 커버리지 100%
  • 파일 필터링 공통 유틸리티 (언어, glob 패턴)
  • Pattern, Length, Style, AST 엔진 개선
  • 통합 테스트 구조 재구성

What's Changed

1. TypeScript Type Checker Engine

  • internal/engine/typechecker/ - TSC 기반 타입 검증
  • internal/adapter/tsc/ - TypeScript Compiler 래퍼
  • 자동 설치 지원 (npm)
  • 엔진 레지스트리에 등록

2. Core Selector Utility

  • internal/engine/core/selector.go - 파일 필터링 공통 함수
  • 15개 언어 지원, doublestar 패턴 (**/*.js)
  • 모든 엔진에서 재사용 가능

3. Comprehensive Adapter Tests (+882 lines)

  • ESLint adapter & executor tests (424줄)
  • Prettier adapter & executor tests (322줄)
  • TSC adapter tests (136줄)

4. Engine Improvements

  • Pattern: 테스트 확장, 정규식 플래그 지원 강화
  • Length: 라인/파일/함수 길이 검증 개선
  • Style: autofix.go 삭제, 코드 정리
  • AST: ESTree 노드 선택자 개선

5. Test Structure Reorganization

  • tests/testdata/testdata/ (루트 이동)
  • *_test.go*_integration_test.go (명확한 구분)
  • 새 테스트 데이터: TypeScript, JavaScript violations, 혼합 컴포넌트

6. Build Fixes

  • verbose 전역 플래그 추가
  • exportCmd 참조 제거
  • doublestar/v4 의존성 추가

Next Steps

이 PR은 검증 엔진 인프라를 완성합니다. 다음 작업이 필요합니다:

1. Validator 구현 (최우선, ~100줄)

// internal/validator/validator.go
func (v *Validator) Validate(path string) (*Result, error) {
    // TODO: 엔진 연결
    // 1. 파일 수집
    // 2. registry.Global().Get(engine)
    // 3. engine.Validate()
    // 4. Violation 수집
}

2. Converter 구현 (~300줄)

  • A→B 스키마 변환 (자연어 → 구조화된 룰)

3. 실전 테스트

  • 실제 TypeScript 프로젝트 검증
  • ESLint/Prettier 자동 수정
  • 성능 측정

Checklist

  • 모든 테스트 통과
  • 빌드 에러 없음
  • 엔진 레지스트리 확인
  • MCP query_conventions 작동 확인
  • Validator 구현 (다음 PR)
  • Converter 구현 (다음 PR)

Note

중요: 엔진과 어댑터는 모두 작동하지만, validator.Validate()가 아직 엔진을 호출하지 않습니다. 다음 PR에서 validator 구현 시 전체 시스템 작동 예정.

- Move testdata from tests/ to project root
- Rename integration tests for consistency (_integration_test.go)
- Add helper utilities for integration tests
- Add basic workflow E2E test script
- Reorganize JavaScript test fixtures
- Add mixed language test fixtures (JSX/TSX)
- Implement TypeScript compiler (tsc) adapter
- Add type checker validation engine
- Support strict mode and type error detection
- Add comprehensive test coverage
- Register type checker in builtin engines
- Add ESLint adapter tests (adapter, config, executor)
- Add Prettier adapter tests (adapter, executor)
- Improve test coverage for external tool adapters
- Add core selector utility for rule filtering
- Improve AST engine with better error handling
- Enhance length, pattern, and style engines
- Remove deprecated autofix.go
- Add comprehensive engine tests
- Remove old integration test files (moved to *_integration_test.go)
- Remove old testdata location (moved to project root)
- Add missing E2E test script to git tracking
- Add verbose global flag to root.go for convert and validate commands
- Remove exportCmd reference (export command not yet implemented)
- Add mcpCmd to root command list
- Remove duplicate AddCommand calls from convert.go and validate.go init()
- Add missing doublestar/v4 dependency to go.mod

This allows the engine improvements branch to build successfully.
The export command will be implemented in a future update.
@ikjeong ikjeong self-assigned this Nov 4, 2025
@ikjeong ikjeong merged commit 9e0165a into main Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant