feat: initial dev-configs monorepo
Shared configs for TypeScript projects: ESLint, Prettier, TypeScript, Vite, Jest, Playwright, Knip. Published as @vigdorov/* npm packages to Gitea registry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
19
packages/knip/package.json
Normal file
19
packages/knip/package.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "@vigdorov/knip-config",
|
||||
"version": "1.0.0",
|
||||
"description": "Shared Knip configuration",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"files": ["dist"],
|
||||
"scripts": {
|
||||
"build": "tsc"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"knip": ">=5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"knip": "^5.51.0",
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
22
packages/knip/src/index.ts
Normal file
22
packages/knip/src/index.ts
Normal file
@ -0,0 +1,22 @@
|
||||
export interface KnipConfigOptions {
|
||||
entry?: string[];
|
||||
project?: string[];
|
||||
ignore?: string[];
|
||||
ignoreDependencies?: string[];
|
||||
}
|
||||
|
||||
export function knipConfig(options: KnipConfigOptions = {}) {
|
||||
const {
|
||||
entry = ['src/index.ts'],
|
||||
project = ['src/**/*.{ts,tsx,js,jsx}'],
|
||||
ignore = [],
|
||||
ignoreDependencies = [],
|
||||
} = options;
|
||||
|
||||
return {
|
||||
entry,
|
||||
project,
|
||||
ignore: ['**/*.test.*', '**/*.spec.*', 'e2e/**', '**/*.d.ts', ...ignore],
|
||||
ignoreDependencies,
|
||||
};
|
||||
}
|
||||
8
packages/knip/tsconfig.json
Normal file
8
packages/knip/tsconfig.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
Reference in New Issue
Block a user