Recursively read a directory and return an array of all file paths
90
{
"context": "This criteria evaluates how well the engineer uses fs-readdir-recursive to leverage its relative path construction capability. The focus is on whether they understand that the package returns paths relative to the root directory by default, and whether they use this feature appropriately rather than manually constructing or manipulating paths.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses read function",
"description": "Correctly imports and calls the `read()` function from fs-readdir-recursive to scan the directory tree. The function should be called with the projectRoot as the first argument.",
"max_score": 30
},
{
"name": "Leverages relative paths",
"description": "Uses the relative paths returned by `read()` directly without unnecessarily converting them to absolute paths or manually manipulating path strings. The solution should recognize that fs-readdir-recursive returns paths relative to the provided root directory by default.",
"max_score": 35
},
{
"name": "Relies on default filtering",
"description": "Takes advantage of fs-readdir-recursive's default filter behavior that excludes hidden files (files starting with '.') without implementing a custom filter function, or correctly omits the second parameter to use the default filter.",
"max_score": 20
},
{
"name": "Handles empty results",
"description": "Properly handles the case when the directory doesn't exist by relying on fs-readdir-recursive's behavior of returning an empty array, and transforms this into the required return format without unnecessary error handling.",
"max_score": 15
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-fs-readdir-recursive