MCPcopy Create free account
hub / github.com/code-pushup/cli / ruleIdToSlug

Function ruleIdToSlug

packages/plugin-eslint/src/lib/meta/hash.ts:9–18  ·  view source on GitHub ↗
(
  ruleId: string,
  options: unknown[] | undefined,
)

Source from the content-addressed store, hash-verified

7}
8
9export function ruleIdToSlug(
10 ruleId: string,
11 options: unknown[] | undefined,
12): string {
13 const slug = slugify(ruleId);
14 if (!options?.length) {
15 return slug;
16 }
17 return `${slug}-${jsonHash(options)}`;
18}
19
20export function jsonHash(data: unknown, bytes = 8): string {
21 return createHash('shake256', { outputLength: bytes })

Callers 3

lintResultsToAuditsFunction · 0.85
ruleToSlugFunction · 0.85
hash.unit.test.tsFile · 0.85

Calls 2

slugifyFunction · 0.90
jsonHashFunction · 0.85

Tested by

no test coverage detected