Repository navigation
docs(path): Fix doc lints in @std/path to prepare for stabilization - #4839
nathanwhit wants to merge 4 commits into
Conversation
@std/path to prepare for stabilization@std/path to prepare for stabilization
| * import { isAbsolute } from "@std/path/is-absolute"; | ||
| * | ||
| * // posix | ||
| * isAbsolute("/home/foo"); // true |
There was a problem hiding this comment.
Ideally we could use assertions in these examples, but I couldn't figure out a nice way to make it work due to the os-dependent behavior.
I suppose we could do something like
if (Deno.build.os === "windows") {
// windows specific examples
} else {
// posix
}but I'm not sure if it's worth the clutter
There was a problem hiding this comment.
I think the readability matters more here. I'd suggest adding no-eval directive when it's difficult to make it work in cross-platform way
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4839 +/- ##
==========================================
- Coverage 91.97% 91.96% -0.01%
==========================================
Files 486 487 +1
Lines 41461 41550 +89
Branches 5360 5365 +5
==========================================
+ Hits 38133 38213 +80
- Misses 3270 3279 +9
Partials 58 58 ☔ View full report in Codecov by Sentry. |
| } from "./windows/glob_to_regexp.ts"; | ||
|
|
||
| export type { GlobOptions }; | ||
| export type { GlobOptions, OSType }; |
There was a problem hiding this comment.
Needed to resolve the lint that OsType is private despite appearing in a public type (GlobToRegExpOptions).
Alternatively we could inline the definition of OSType instead of exporting it, but that sort of defeats the purpose of the type.
There was a problem hiding this comment.
Exporting the type makes sense to me, but I think it should be renamed to OsType. The Deno style guide has the below section:
When the names are in camelCase or PascalCase, always follow the rules of them even when the parts of them are acronyms.
Note: Web APIs use uppercase acronyms (JSON, URL, URL.createObjectURL() etc.). Deno Standard Library does not follow this convention.
|
I'll continue this work in #4900. Thanks @nathanwhit for the contribution! |
No description provided.