mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
chore: add lint to disallow prints to stdout (#2404)
This commit is contained in:
parent
2b4f5e0f58
commit
7928f61401
3 changed files with 12 additions and 1 deletions
|
@ -8,4 +8,13 @@ args = ["fmt", "--", "--check", "--config-path", "${LEPTOS_PROJECT_DIRECTORY}"]
|
|||
[tasks.clippy-each-feature]
|
||||
dependencies = ["install-clippy"]
|
||||
command = "cargo"
|
||||
args = ["hack", "clippy", "--all", "--each-feature", "--no-dev-deps"]
|
||||
args = [
|
||||
"hack",
|
||||
"clippy",
|
||||
"--all",
|
||||
"--each-feature",
|
||||
"--no-dev-deps",
|
||||
"--",
|
||||
"-D",
|
||||
"clippy::print_stdout"
|
||||
]
|
||||
|
|
|
@ -44,6 +44,7 @@ macro_rules! debug_warn {
|
|||
/// Log a string to the console (in the browser)
|
||||
/// or via `println!()` (if not in the browser).
|
||||
pub fn console_log(s: &str) {
|
||||
#[allow(clippy::print_stdout)]
|
||||
if is_server() {
|
||||
println!("{s}");
|
||||
} else {
|
||||
|
|
|
@ -270,6 +270,7 @@ where
|
|||
if let Some(data) = static_data.get(path.path()) {
|
||||
path.add_params(data);
|
||||
}
|
||||
#[allow(clippy::print_stdout)]
|
||||
for path in path.into_paths() {
|
||||
println!("building static route: {}", path);
|
||||
path.write(options, app_fn.clone(), additional_context.clone())
|
||||
|
|
Loading…
Reference in a new issue