Coverage for lintro / parsers / astro_check / astro_check_issue.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-04-03 18:53 +0000

1"""Models for astro check issues.""" 

2 

3from __future__ import annotations 

4 

5from dataclasses import dataclass, field 

6 

7from lintro.parsers.base_issue import BaseIssue 

8 

9 

10@dataclass 

11class AstroCheckIssue(BaseIssue): 

12 """Represents an Astro check diagnostic issue. 

13 

14 This class extends BaseIssue with astro-check-specific fields for type 

15 checking errors and warnings in Astro components. 

16 

17 Attributes: 

18 code: TypeScript error code (e.g., "TS2322", "TS1234"). 

19 Empty string if astro check doesn't provide an error code. 

20 severity: Severity level reported by astro check (e.g., "error", "warning"). 

21 None if severity is not specified. 

22 hint: Optional hint text providing additional context. 

23 None if no hint is provided. 

24 

25 Examples: 

26 >>> issue = AstroCheckIssue( 

27 ... file="src/pages/index.astro", 

28 ... line=10, 

29 ... column=5, 

30 ... code="TS2322", 

31 ... severity="error", 

32 ... message="Type 'string' is not assignable to type 'number'.", 

33 ... ) 

34 """ 

35 

36 code: str = field(default="") 

37 severity: str | None = field(default=None) 

38 hint: str | None = field(default=None)