included_file_warning 진단: 포함된 options 파일의 경고

included_file_warning 진단: 포함된 options 파일의 경고

Dart 분석기가 만들어 내는 included_file_warning 진단에 대한 설명이에요.

출처: included_file_warning

본문

include 키로 포함된 분석 옵션 파일에 경고(warning)가 있을 때 이 진단이 발생해요.

설명

분석 options 파일에 include 키가 있고, 그렇게 포함된 파일 안에 경고가 들어 있을 때 분석기는 이 진단을 만들어요.

예시

shared.yaml이라는 파일이 다음과 같은 내용을 담고 있다고 해볼게요.

// %uri="shared.yaml"
linter:
  rules:
    - undefined_lint_rule

이 파일을 analysis_options.yaml에서 include로 가져오면, undefined_lint_rule이라는 규칙이 실제로 존재하지 않는다는 경고가 shared.yaml에 있기 때문에 이 진단이 발생해요.

// %uri="analysis_options.yaml"
include: shared.yaml

흔한 해결 방법

포함되는 파일을 고칠 수 있다면, 그 파일 안의 경고를 고치면 돼요. 만약 그 파일을 고칠 수 없다면, 아예 포함하지 않는 걸 선택해요.

더 알아보기