You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
anyhow::anyhow!("Failed to get parent directory of config file: {config_file_path}")
262
+
})?;
263
+
264
+
let config_path = config_dir.join(temp_filename);
265
+
let content = format!(
266
+
"import {{ defineConfig }} from 'oxlint';\nimport viteConfig from './{config_basename}';\nexport default defineConfig(viteConfig.{field_name} as any);\n"
267
+
);
268
+
write(&config_path, content).await?;
269
+
270
+
self.temp_config_files.push(config_path.clone());
271
+
272
+
let config_path_str = config_path
273
+
.as_path()
274
+
.to_str()
275
+
.ok_or_else(|| anyhow::anyhow!("config path is not valid UTF-8"))?;
276
+
args.insert(0, config_path_str.to_string());
277
+
args.insert(0,"-c".to_string());
278
+
// Prevent oxlint from linting the temp config file itself
279
+
args.push("--ignore-pattern".to_string());
280
+
args.push(temp_filename.to_string());
281
+
Ok(())
282
+
}
283
+
284
+
/// Write a temporary JSON config file and prepend `-c <path>` to args.
235
285
/// The file will be tracked for cleanup after command execution.
236
286
/// The `config_file_path` must be an absolute path.
237
-
asyncfnwrite_temp_config_file(
287
+
asyncfnwrite_temp_json_config_file(
238
288
&mutself,
239
289
config:&serde_json::Value,
240
290
config_file_path:&str,
@@ -311,21 +361,22 @@ impl SubcommandResolver {
311
361
tracing::error!("Failed to parse vite config: {vite_config_json}");
0 commit comments