Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions crates/oxc_linter/src/tsgolint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl TsGoLintState {

let mut resolved_configs: FxHashMap<PathBuf, ResolvedLinterState> = FxHashMap::default();

let json_input = self.json_input(paths, &mut resolved_configs);
let json_input = self.json_input(paths, None, &mut resolved_configs);
if json_input.configs.is_empty() {
return Ok(());
}
Expand Down Expand Up @@ -336,8 +336,14 @@ impl TsGoLintState {
source_text: String,
) -> Result<Vec<Message>, String> {
let mut resolved_configs: FxHashMap<PathBuf, ResolvedLinterState> = FxHashMap::default();
let mut source_overrides = FxHashMap::default();
source_overrides.insert(path.to_string_lossy().to_string(), source_text.clone());

let json_input = self.json_input(std::slice::from_ref(path), &mut resolved_configs);
let json_input = self.json_input(
std::slice::from_ref(path),
Some(source_overrides),
&mut resolved_configs,
);
let executable_path = self.executable_path.clone();

let fix = self.fix;
Expand Down Expand Up @@ -489,6 +495,7 @@ impl TsGoLintState {
fn json_input(
&self,
paths: &[Arc<OsStr>],
source_overrides: Option<FxHashMap<String, String>>,
resolved_configs: &mut FxHashMap<PathBuf, ResolvedLinterState>,
) -> Payload {
let mut config_groups: FxHashMap<BTreeSet<Rule>, Vec<String>> = FxHashMap::default();
Expand Down Expand Up @@ -527,6 +534,7 @@ impl TsGoLintState {
rules: rules.into_iter().collect(),
})
.collect(),
source_overrides,
}
}
}
Expand All @@ -550,6 +558,7 @@ impl TsGoLintState {
pub struct Payload {
pub version: i32,
pub configs: Vec<Config>,
pub source_overrides: Option<FxHashMap<String, String>>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
Expand Down
Loading