sendou.ink/knip.ts
Kalle 42b44614f2
Some checks are pending
E2E Tests / e2e (push) Waiting to run
Tests and checks on push / run-checks-and-tests (push) Waiting to run
Updates translation progress / update-translation-progress-issue (push) Waiting to run
better-sqlite3 -> node:sqlite, get rid of ley (#3289)
2026-08-03 21:35:13 +03:00

31 lines
889 B
TypeScript

const config = {
ignoreExportsUsedInFile: {
interface: true,
type: true,
},
tags: ["-lintignore"],
entry: [
"app/features/*/routes/**/*.{ts,tsx}",
"migrations/**/*.ts",
"scripts/**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}",
"public/sw-2.js",
],
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;