Skip to content

Commit 8db5346

Browse files
committed
Format
1 parent f21a587 commit 8db5346

6 files changed

Lines changed: 12 additions & 16 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"workspaces": [
1818
"packages/*"
1919
],
20-
"type": "module",
20+
"type": "module",
2121
"scripts": {
2222
"docs": "pnpm run --dir packages/docs dev",
2323
"test": "pnpm run --dir packages/knip test",

packages/knip/src/DependencyDeputy.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,7 @@ export class DependencyDeputy {
9595
const devDependencies = Object.keys(manifest.devDependencies ?? {});
9696
const allDependencies = [...dependencies, ...devDependencies, ...peerDependencies, ...optionalDependencies];
9797

98-
const packageNames = [
99-
...dependencies,
100-
...peerDependencies,
101-
...(this.isProduction ? [] : devDependencies),
102-
];
98+
const packageNames = [...dependencies, ...peerDependencies, ...(this.isProduction ? [] : devDependencies)];
10399

104100
if (this.isReportDependencies) {
105101
const { hostDependencies, installedBinaries, hasTypesIncluded } = getDependencyMetaData({

packages/knip/src/graph/build.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ export async function build({
119119
const baseConfig = chief.getConfigForWorkspace(name);
120120

121121
const tsConfigFilePath = join(dir, options.tsConfigFile ?? 'tsconfig.json');
122-
const { isFile, compilerOptions, fileNames, include, exclude, sourceMapPairs } = await loadTSConfig(tsConfigFilePath);
122+
const { isFile, compilerOptions, fileNames, include, exclude, sourceMapPairs } =
123+
await loadTSConfig(tsConfigFilePath);
123124
const [definitionPaths, tscSourcePaths] = partition(fileNames, filePath => IS_DTS.test(filePath));
124125

125126
const worker = new WorkspaceWorker({
@@ -323,8 +324,7 @@ export async function build({
323324
}
324325
}
325326
if (extensions.length > 0) {
326-
const extPart =
327-
extensions.length === 1 ? extensions[0] : `.{${extensions.map(ext => ext.slice(1)).join(',')}}`;
327+
const extPart = extensions.length === 1 ? extensions[0] : `.{${extensions.map(ext => ext.slice(1)).join(',')}}`;
328328
const bases = include ? new Set(include.map(p => picomatch.scan(p).base || dir)) : new Set([dir]);
329329
const patterns = [
330330
...Array.from(bases, base => `${base}/**/*${extPart}`),

packages/knip/src/plugins/jest/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ const entry = ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)',
2323

2424
const rootDirRe = /<rootDir>/;
2525

26-
const resolveDependencies = async (config: JestInitialOptions, rootDir: string, options: PluginOptions): Promise<Input[]> => {
26+
const resolveDependencies = async (
27+
config: JestInitialOptions,
28+
rootDir: string,
29+
options: PluginOptions
30+
): Promise<Input[]> => {
2731
const { configFileDir } = options;
2832

2933
if (config?.preset) {

packages/knip/src/plugins/nx/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ const resolveConfig: ResolveConfig<NxProjectConfiguration | NxConfigRoot> = asyn
5656
.map(executor => executor?.split(':')[0]);
5757

5858
const expand = (value: string) =>
59-
value
60-
.replaceAll('{projectRoot}', options.configFileDir)
61-
.replaceAll('{workspaceRoot}', options.rootCwd);
59+
value.replaceAll('{projectRoot}', options.configFileDir).replaceAll('{workspaceRoot}', options.rootCwd);
6260

6361
const resolveTargetCwd = (targetCwd: string | undefined) => {
6462
if (!targetCwd) return options.cwd;

packages/knip/src/util/glob.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ const defaultGlob = async ({ cwd, dir = cwd, patterns, gitignore = true, label }
6666
const syncGlob = ({ cwd, patterns }: { cwd: string; patterns: string | string[] }) => {
6767
const cacheEnabled = isGlobCacheEnabled();
6868
const patternList = Array.isArray(patterns) ? patterns : [patterns];
69-
const cacheKey = cacheEnabled
70-
? computeGlobCacheKey({ patterns: patternList, cwd, dir: cwd, gitignore: false })
71-
: '';
69+
const cacheKey = cacheEnabled ? computeGlobCacheKey({ patterns: patternList, cwd, dir: cwd, gitignore: false }) : '';
7270
if (cacheEnabled) {
7371
const cached = getCachedGlob(cacheKey);
7472
if (cached) return cached;

0 commit comments

Comments
 (0)