stylelint-itcss
Version:
A stylelint plugin to help with itcss architecture
12 lines (11 loc) • 373 B
text/typescript
import * as path from "path";
export function isIgnoredLayer(ignoredLayer: string[] = [], filePath: string = "") {
const file: path.ParsedPath = path.parse(filePath);
return ignoredLayer.some(layer => {
let test = file.dir.split(path.sep).indexOf(layer) !== -1;
if (test === false) {
test = file.name.match(layer) !== null;
}
return test;
});
}