1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-01 16:51:13 -05:00
denoland-deno/ext/node/clippy.toml
Bartek Iwańczuk 913e2875c1
refactor(ext/node): add NodeEnv::Fs associated type (#18484)
This commit adds associated type to "NodeEnv" trait, called "Fs".

The "Fs" type has a trait bound on "NodeFs", which specifies APIs
required for all ops and resolution APIs to function.

A "RealFs" implementation of "NodeFs" is exported from the "deno_node"
crate, that provides a default implementation for the trait.

All code in "deno_node" extension was changed to use the "NodeFs" trait
to handle file system operations, instead of relying on APIs from the
standard library.
2023-03-30 03:20:31 +02:00

21 lines
2 KiB
TOML

disallowed-methods = [
{ path = "std::env::current_dir", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::path::Path::exists", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::canonicalize", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::copy", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::create_dir", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::create_dir_all", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::hard_link", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::metadata", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::read", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::read_dir", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::read_link", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::read_to_string", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::remove_dir", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::remove_dir_all", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::remove_file", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::rename", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::set_permissions", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::symlink_metadata", reason = "File system operations should be done using NodeFs trait" },
{ path = "std::fs::write", reason = "File system operations should be done using NodeFs trait" },
]