Dylint lints for apps created with the Leptos framework.
Install Dylint with
cargo install cargo-dylint dylint-link
Put the next configuration in the Cargo.toml of your workspace.
[workspace.metadata.dylint]
libraries = [{ git = "https://github.com/leptos-rs/leptos-lints", tag = "v0.1.0" }]
Run the lints with
cargo dylint --all
See cargo dylint --help
for more information.
[workspace.metadata.dylint]
libraries = [{ git = "https://github.com/leptos-rs/leptos-lints", tag = "v0.1.0" }]
Use the RUSTFLAGS
environment variable to set custom lint levels for each lint.
For example, to set leptos_print_stdout
lint to deny
, run the next command.
RUSTFLAGS="-Dleptos_print_stdout" cargo dylint --all
Or in the file .cargo/config.toml to avoid repeating the command.
[target.'cfg(all())']
rustflags = ["-Dleptos_print_stdout"]
The downside of this approach is that the project will be compiled from scratch
every time you edit the RUSTFLAGS
variable.
Use [lints.rust]
table in Cargo.toml to set custom lint levels for each lint.
For example, to set leptos_print_stdout
lint to deny
in a workspace,
add the next lines to the Cargo.toml file.
[workspace.lints.rust]
unknown_lints = "allow"
leptos_print_stdout = "deny"
The downside of this approach is that unknown lints will be allowed by default.
Rule | Description |
---|---|
leptos_print_stdout |
Check for calls to leptos::logging::log! . |