-
Notifications
You must be signed in to change notification settings - Fork 41
/
knip.ts
60 lines (58 loc) · 1.96 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
import type { KnipConfig } from 'knip';
const config: KnipConfig = {
entry: [
// knip's GitHub actions plugin doesn't know how to recognize custom actions
// yet.
'.github/actions/parse-release/index.js',
// Utility script used by update docs pages.
'docs/update/update.js',
// A utility we used to generate all the icon variations once that might yet
// be useful again some day.
'scripts/generate-icons.ts',
// This file is conditionally included in some configurations in a way knip
// can't be expected to follow. Hopefully we'll eventually remove this
// quirk and use the same tab manager everywhere.
'src/background/active-tab-manager.ts',
// React Cosmos decorators
'src/**/cosmos.decorator.tsx',
// Included by popups.html until we set up a better way of doing component
// tests.
'tests/html-tests.js',
// This is referenced in xcode13/Shared (App)/Base.lproj/Main.html but knip
// doesn't know how to parse that.
'xcode13/Shared \\(App\\)/Resources/Script.js',
],
ignore: [
// Ignore React Cosmos fixtures
'src/**/*.fixture.tsx',
],
ignoreDependencies: [
// Used by our browser test and automatically detected by playwright-test.
'mocha',
'@types/mocha',
// Knip doesn't know how to parse React Cosmos plugins (yet).
'react-cosmos-plugin-webpack',
// Since Husky 9, knip fails to find husky dependencies
'lint-staged',
],
ignoreExportsUsedInFile: {
interface: true,
type: true,
},
playwright: {
// Knip doesn't recognize the globs in package.json scripts
entry: 'tests/**/*.test.{js,ts}',
},
postcss: {
// Knip doesn't look for .cjs files by default.
config: ['postcss.config.cjs'],
},
tailwind: {
config: ['**/tailwind.config.js'],
},
webpack: {
// Knip won't know to look for the special (cosmos-webpack.config.js) file.
config: ['cosmos-webpack.config.js', 'webpack.config.js'],
},
};
export default config;