-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Expand file tree
/
Copy pathknip.config.js
More file actions
62 lines (55 loc) · 1.71 KB
/
knip.config.js
File metadata and controls
62 lines (55 loc) · 1.71 KB
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
import { isCI } from "ci-info";
/** @import {KnipConfig} from "knip" */
/** @type {KnipConfig} */
const config = {
workspaces: {
".": {
entry: [
// Production plugin entries
"src/plugins/*",
"packages/plugin-oxc/index.js",
"packages/plugin-hermes/index.js",
"scripts/**",
// We use `new Function()` to create `import()` in our `bin` file (bin/prettier.cjs)
// so there is no actual use of the CLI files
"src/cli/index.js",
"src/experimental-cli/index.js",
// Tests
"tests/config/browser-prettier/**",
],
project: ["src/**", "scripts/**"],
ignore: [
"scripts/build/packages/*",
"scripts/build/builders/javascript-module.js",
"scripts/tools/**",
"src/experimental-cli/**",
"src/universal/*.browser.js",
],
ignoreDependencies: ["ts-expect", "buffer", "base64-arraybuffer-es6"],
ignoreBinaries: ["test-coverage"],
},
website: {
entry: [
"playground/**/*.{js,jsx}",
"src/pages/**/*.{js,jsx}",
"static/**/*.{js,mjs}",
],
ignoreDependencies: ["@docusaurus/plugin-content-docs"],
},
"scripts/tools/bundle-test": {},
"scripts/tools/eslint-plugin-prettier-internal-rules": {},
"scripts/release": {
entry: ["release.js"],
},
},
};
// Only check workspaces on CI, since they require extra install steps, see https://github.com/prettier/prettier/issues/16913
if (!isCI) {
config.workspaces = Object.fromEntries(
Object.entries(config.workspaces).map(([workspace, settings]) => [
workspace,
workspace === "." ? settings : { ignore: ["**/*"] },
]),
);
}
export default config;