본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Biome 모듈

원문 보기 위키 갱신

Biome 모듈은 JavaScript와 TypeScript 소스에 Biome 린팅을 실행하고, Biome이 문제를 수리할 수 있을 때는 수정된 버전을 반환할 수 있어요. 프로젝트가 Biome을 주요 코드 품질 도구로 사용할 때 이 모듈을 사용하세요. 그러면 ESLint와 Prettier 쌍을 따로 두는 대신, 결합된 하나의 도구가 린트 규칙과 포맷 규칙을 모두 다뤄요.

출처: Dagger Docs

본문

워크스페이스에 추가하기 (Add it to your workspace)

dagger module install dagger.io/js/biome

검사 실행하기 (Run the check)

dagger check              # run every check in the workspace
dagger check dag://biomejs/lint # run Biome against the workspace source

biomejs:lint는 의존성을 설치하고 프로젝트 고유의 biome.json을 사용해 워크스페이스 전체에 biome check를 실행해요. Biome의 check는 린팅과 포맷팅을 모두 다루기 때문에, 이 단일 check가 별개의 ESLint와 Prettier 쌍을 대체해요.

문제 고치기 (Fix issues)

Biome은 fix 함수도 노출하는데, biome check --write를 실행하고 수리된 소스를 changeset(.js, .ts, .jsx, .tsx 커버)으로 반환해요. check가 아니라 평범한 함수이므로 dagger check 동안에는 실행되지 않아요. dagger api call로 호출하세요 (dagger api functions를 실행하면 사용 가능한 함수가 보여요).

설정하기 (Configure it)

dagger module settings biomejs로 현재 설정과 값을 나열하고, dagger module settings biomejs <key> <value>로 하나를 지정하세요. 설정은 dagger.toml의 [modules.biomejs.settings] 아래에 저장돼요:

  • baseImageAddress (기본값 node:25-alpine)는 Biome이 실행되는 Node 베이스 이미지예요. 프로젝트의 Node 버전에 맞춰 고정하세요. 예: node:22-alpine. Biome은 npm으로 설치되기 때문에, ESLint와 Prettier 모듈과 달리 패키지 매니저 설정이 없어요.
[modules.biomejs.settings]
baseImageAddress = "node:22-alpine"

다른 모듈과 함께 쓰기 (Working with other modules)

Biome 설정이 이미 있는 프로젝트에는 Biome을 사용하세요. ESLint와 Prettier를 따로 사용하는 프로젝트는 그 모듈들을 쓰세요.

더 알아보기 (Learn more)