toss / es-hangul

A modern JavaScript library for handling Hangul characters.
https://es-hangul.slash.page/
MIT License
1.24k stars 83 forks source link

fix: vitest ESLint parsing error #175

Closed po4tion closed 1 month ago

po4tion commented 2 months ago

Overview

eslintrc의 parseOptions.project 값에 의해 vitest.config.mts 파일을 include 해야 합니다.

image

inlcude에 파일 경로를 추가할 시 tsconfig의 설정이 적용되어 다음과 같은 오류가 발생합니다.

image

tsconfig의 resolveJsonModule 옵션을 활성화하여 해결하였습니다.

PR Checklist

  1. I have read the Contributing Guide
  2. I have written documents and tests, if needed.
changeset-bot[bot] commented 2 months ago

⚠️ No Changeset found

Latest commit: a37968a15d175021d02ea3c5b23aa8b317edca7d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
es-hangul ❌ Failed (Inspect) Jul 7, 2024 4:52pm
codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (16b77b2) to head (a37968a).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/toss/es-hangul/pull/175/graphs/tree.svg?width=650&height=150&src=pr&token=My9jTW6bSr&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toss)](https://app.codecov.io/gh/toss/es-hangul/pull/175?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=toss) ```diff @@ Coverage Diff @@ ## main #175 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 16 16 Lines 260 260 Branches 58 58 ========================================= Hits 260 260 ```
okinawaa commented 2 months ago

vitest.config.mts 를 includes에 추가하는것은 이해를 하였는데, Json파일이 아님에도 resolveJsonModule 옵션을 켜야하는 이유가 궁금합니당!

po4tion commented 2 months ago

@okinawaa typescript에서 JSON을 모듈형태로 가져오기 위해서는 resolveJsonModule을 true로 적용하여야 합니다. vitest.config.mts에서 package.json을 가져오기 때문에 resolveJsonModule 옵션을 활성화했어요. 참고하실 수 있는 자료 공유드려요. https://www.typescriptlang.org/tsconfig/#resolveJsonModule