Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (13 sloc) 553 Bytes
import maxUsageRule from './meta-rules/max-usage';
import { resolve } from 'path';
export class Rule extends maxUsageRule({
ruleName: 'use-sparingly',
callCount: 4,
matchesImportSignature: (path: string, exportedName: string) => {
let trackedPath = resolve(__dirname, '../src', 'useSparingly');
let trackedExportName = 'default';
// path is including double-quotes from symbol so
// we wrap out trackedPath with double-quotes for comparison
return `"${trackedPath}"` === path && trackedExportName === exportedName;
}
}) {}
You can’t perform that action at this time.