Files
test-repo/knip.config.js
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
1.8 KiB
JavaScript
Raw Normal View History

2025-10-09 14:25:24 +08:00
import { isCI } from "ci-info";
/** @import {KnipConfig} from "knip" */
/** @type {KnipConfig} */
const config = {
2024-09-18 16:40:10 +08:00
workspaces: {
".": {
2025-02-19 00:37:58 +08:00
entry: [
2025-12-24 22:57:02 +08:00
// Production plugin entries
2025-02-19 00:37:58 +08:00
"src/plugins/*",
2025-12-24 22:57:02 +08:00
"packages/plugin-oxc/index.js",
"packages/plugin-hermes/index.js",
2025-02-19 00:37:58 +08:00
"scripts/**",
2025-12-24 22:57:02 +08:00
2025-02-19 00:37:58 +08:00
// 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",
2025-05-06 10:34:05 +08:00
"src/experimental-cli/index.js",
2025-12-24 22:57:02 +08:00
// Tests
"tests/config/browser-prettier/**",
2025-02-19 00:37:58 +08:00
],
2025-11-18 00:44:33 +08:00
project: ["src/**", "scripts/**"],
2024-09-18 16:40:10 +08:00
ignore: [
2025-12-05 04:53:15 +08:00
"scripts/build/packages/*",
"scripts/build/builders/javascript-module.js",
2024-09-18 16:40:10 +08:00
"scripts/tools/**",
2025-05-06 10:34:05 +08:00
"src/experimental-cli/**",
"src/universal/*.browser.js",
],
2026-06-25 06:48:12 +08:00
ignoreDependencies: [
"ts-expect",
"buffer",
"base64-arraybuffer-es6",
"flow-estree",
2026-07-15 01:53:00 +08:00
"@yuku-parser/wasm",
2026-06-25 06:48:12 +08:00
],
2026-07-15 01:53:00 +08:00
ignoreBinaries: [],
2024-09-18 16:40:10 +08:00
},
website: {
2025-10-09 14:25:24 +08:00
entry: [
"playground/**/*.{js,jsx}",
"src/pages/**/*.{js,jsx}",
"static/**/*.{js,mjs}",
],
2026-03-22 09:23:14 +08:00
ignoreDependencies: ["@docusaurus/plugin-content-docs"],
2024-09-18 16:40:10 +08:00
},
"scripts/tools/bundle-test": {},
"scripts/tools/eslint-plugin-prettier-internal-rules": {},
"scripts/release": {
entry: ["release.js"],
},
},
};
2025-10-09 14:25:24 +08:00
// 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;