antler
Version:
Directory structure linter
18 lines (14 loc) • 353 B
text/typescript
import path from 'path';
import { RegexRule } from '../regex-rule';
import { Node } from '../types';
export class DirectoryName extends RegexRule {
protected getName() {
return 'DirectoryName';
}
protected shouldRun(node: Node) {
return node.isDirectory;
}
protected getPart(node: Node) {
return path.basename(node.path);
}
}