build(ui): harden knip config, support @knipignore jsdoc tag

This commit is contained in:
psychedelicious 2024-03-28 10:51:33 +11:00
parent 6e5b4b595a
commit 77038a8ef6
2 changed files with 3 additions and 15 deletions

View File

@ -6,22 +6,10 @@ const config: KnipConfig = {
'src/app/store/middleware/debugLoggerMiddleware.ts', 'src/app/store/middleware/debugLoggerMiddleware.ts',
// Autogenerated types - shouldn't ever touch these // Autogenerated types - shouldn't ever touch these
'src/services/api/schema.ts', 'src/services/api/schema.ts',
'src/features/nodes/types/v1/**',
'src/features/nodes/types/v2/**',
], ],
ignoreBinaries: ['only-allow'], ignoreBinaries: ['only-allow'],
rules: {
files: 'warn',
dependencies: 'warn',
unlisted: 'warn',
binaries: 'warn',
unresolved: 'warn',
exports: 'warn',
types: 'warn',
nsExports: 'warn',
nsTypes: 'warn',
enumMembers: 'warn',
classMembers: 'warn',
duplicates: 'warn',
},
}; };
export default config; export default config;

View File

@ -24,7 +24,7 @@
"build": "pnpm run lint && vite build", "build": "pnpm run lint && vite build",
"typegen": "node scripts/typegen.js", "typegen": "node scripts/typegen.js",
"preview": "vite preview", "preview": "vite preview",
"lint:knip": "knip", "lint:knip": "knip --tags=-@knipignore",
"lint:dpdm": "dpdm --no-warning --no-tree --transform --exit-code circular:1 src/main.tsx", "lint:dpdm": "dpdm --no-warning --no-tree --transform --exit-code circular:1 src/main.tsx",
"lint:eslint": "eslint --max-warnings=0 .", "lint:eslint": "eslint --max-warnings=0 .",
"lint:prettier": "prettier --check .", "lint:prettier": "prettier --check .",