-
Notifications
You must be signed in to change notification settings - Fork 1
/
knip.ts
64 lines (62 loc) · 1.77 KB
/
knip.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import type { KnipConfig } from 'knip';
const config: KnipConfig = {
// setup knip to warn by default so that ci doesn't fail if there are any issues
// but still allows us to see the issues and fix them
rules: {
binaries: 'warn',
classMembers: 'warn',
dependencies: 'warn',
devDependencies: 'warn',
duplicates: 'warn',
enumMembers: 'warn',
exports: 'warn',
files: 'warn',
nsExports: 'warn',
nsTypes: 'warn',
optionalPeerDependencies: 'warn',
types: 'warn',
unlisted: 'warn',
unresolved: 'warn',
},
// all possible entry points to everything in the project,
// e.g. gateway client, gateway server, cdk, storybook, webpack etc.
entry: [
'.storybook/**/*.{js,ts}',
'cdk/bin/cdk.ts',
'cdk/jest.setup.js',
'cypress/**/*.{js,ts}',
'scripts/**/*.{js,ts}',
'src/client/static/index.tsx',
'src/server/index.ts',
'webpack.{config|development}.js',
],
// all possible file types we want to check
project: ['**/*.{js,ts,tsx}'],
// ignore specific files that we want to keep
ignore: [
'src/client/components/ABTestDemo.tsx',
'src/shared/model/experiments/tests/example-test.ts',
'webpack.development.js',
'src/email/templates/renderedTemplates.ts',
],
// ignore specific binaries/commands that we want to keep
ignoreBinaries: ['only-allow'],
// ignore specific dependencies that we want to keep
// usually used by webpack, cdk, storybook etc. that knip can't resolve
ignoreDependencies: [
'@guardian/cdk',
'@storybook/addon-viewport',
'@swc/plugin-emotion',
'aws-cdk-lib',
'fork-ts-checker-notifier-webpack-plugin',
'fork-ts-checker-webpack-plugin',
'imagemin',
'jest-environment-jsdom',
'mjml-browser',
'preact-render-to-string',
'react-docgen-typescript-plugin',
'sharp',
'source-map-support',
],
};
export default config;