sendou.ink/knip.ts
dependabot[bot] 71ba0d6aca
Some checks failed
E2E Tests / e2e (push) Has been cancelled
Tests and checks on push / run-checks-and-tests (push) Has been cancelled
Updates translation progress / update-translation-progress-issue (push) Has been cancelled
build(deps): bump the minor-and-patch group across 1 directory with 6 updates (#3230)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kalle <38327916+Sendouc@users.noreply.github.com>
2026-07-16 21:28:15 +03:00

36 lines
1.1 KiB
TypeScript

const config = {
ignoreExportsUsedInFile: {
interface: true,
type: true,
},
tags: ["-lintignore"],
ignoreBinaries: ["lsof"],
// cwd relative path inside an execSync command, which knip resolves relative to the file instead
ignoreUnresolved: ["scripts/seed-single-variation.ts"],
entry: [
"app/features/*/routes/**/*.{ts,tsx}",
"migrations/**/*.js",
"scripts/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}",
"public/sw-2.js",
"ley.config.cjs",
"ley-driver.cjs",
],
compilers: {
css: (text: string, path: string) => {
if (!path.endsWith(".module.css")) {
return "";
}
// Match classes that start a selector (not compound classes like .foo.bar)
// Negative lookbehind ensures . is not preceded by word chars or ]
const classNames = [
...text.matchAll(/(?<![a-zA-Z\d_\]])\.([a-zA-Z_][\w]*)(?=\s*[,{:])/g),
];
const uniqueClasses = [...new Set(classNames.map((match) => match[1]))];
const enumMembers = uniqueClasses.map((name) => ` ${name} = '',`);
return `enum styles {\n${enumMembers.join("\n")}\n}\nexport default styles;`;
},
},
};
export default config;