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

Function parseRuleId

packages/plugin-eslint/src/lib/meta/parse.ts:10–21  ·  view source on GitHub ↗
(ruleId: string)

Source from the content-addressed store, hash-verified

8};
9
10export function parseRuleId(ruleId: string): { plugin?: string; name: string } {
11 const i = ruleId.startsWith('@')
12 ? ruleId.lastIndexOf('/')
13 : ruleId.indexOf('/');
14 if (i === -1) {
15 return { name: ruleId };
16 }
17 return {
18 plugin: ruleId.slice(0, i),
19 name: ruleId.slice(i + 1),
20 };
21}
22
23export function isRuleOff(entry: Linter.RuleEntry<unknown[]>): boolean {
24 const level = Array.isArray(entry) ? entry[0] : entry;

Callers 3

parse.unit.test.tsFile · 0.85
groupsFromRuleCategoriesFunction · 0.85
findRuleMetaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected