mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-27 11:31:45 -04:00
Add n/prefer-node-protocol rule and autofix all bare builtin imports to use the node: prefix. Simplify the simple-import-sort builtins pattern to just ^node: since all imports now use the prefix.
9 lines
259 B
TypeScript
9 lines
259 B
TypeScript
import fs from 'node:fs'
|
|
import path from 'node:path'
|
|
|
|
export function existsInDir (entityName: string, dir: string): string | undefined {
|
|
const entityPath = path.join(dir, entityName)
|
|
if (fs.existsSync(entityPath)) return entityPath
|
|
return undefined
|
|
}
|