| 1 | import { getAntipattern } from './registry/antipatterns.mjs'; |
| 2 | |
| 3 | function getAP(id) { |
| 4 | return getAntipattern(id); |
| 5 | } |
| 6 | |
| 7 | function finding(id, filePath, snippet, line = 0) { |
| 8 | const ap = getAP(id); |
| 9 | return { antipattern: id, name: ap.name, description: ap.description, severity: ap.severity || 'warning', file: filePath, line, snippet }; |
| 10 | } |
| 11 | |
| 12 | export { getAP, finding }; |
| 13 |