(cwd: string, input: DeleteRuleInput)
| 108 | } |
| 109 | |
| 110 | export async function deleteRule(cwd: string, input: DeleteRuleInput): Promise<void> { |
| 111 | const filePath = await resolveRuleFile(cwd, input) |
| 112 | if (!filePath) { |
| 113 | throw new Error("Rule file not found") |
| 114 | } |
| 115 | |
| 116 | await fs.rm(filePath, { force: true }) |
| 117 | } |
| 118 | |
| 119 | export async function resolveRuleFile(cwd: string, input: RuleLookupInput): Promise<string | undefined> { |
| 120 | const directoryPath = getTargetRuleDirectory(cwd, input) |
no test coverage detected