1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#[cfg(feature = "json")]
use serde::Serialize;
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "json", derive(Serialize))]
pub struct Location {
pub line: usize,
pub col: usize,
}
impl Into<Location> for swc_common::Loc {
fn into(self) -> Location {
Location {
line: self.line,
col: self.col.0,
}
}
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "json", derive(Serialize))]
pub struct LintDiagnostic {
pub location: Location,
pub filename: String,
pub message: String,
pub code: String,
pub line_src: String,
pub snippet_length: usize,
}