feat: add oxlint with correctness defaults (#22682)
This commit is contained in:
parent
a554fad232
commit
3d6f90cb53
57 changed files with 165 additions and 122 deletions
|
|
@ -1,14 +1,14 @@
|
|||
export function getFilename(path: string | undefined) {
|
||||
if (!path) return ""
|
||||
const trimmed = path.replace(/[\/\\]+$/, "")
|
||||
const parts = trimmed.split(/[\/\\]/)
|
||||
const trimmed = path.replace(/[/\\]+$/, "")
|
||||
const parts = trimmed.split(/[/\\]/)
|
||||
return parts[parts.length - 1] ?? ""
|
||||
}
|
||||
|
||||
export function getDirectory(path: string | undefined) {
|
||||
if (!path) return ""
|
||||
const trimmed = path.replace(/[\/\\]+$/, "")
|
||||
const parts = trimmed.split(/[\/\\]/)
|
||||
const trimmed = path.replace(/[/\\]+$/, "")
|
||||
const parts = trimmed.split(/[/\\]/)
|
||||
return parts.slice(0, parts.length - 1).join("/") + "/"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue