MCPcopy Index your code
hub / github.com/code-pushup/cli / findProjectFile

Function findProjectFile

packages/plugin-eslint/src/lib/nx/utils.ts:87–105  ·  view source on GitHub ↗
(
  project: ProjectConfiguration,
  file: {
    names: string[];
    extensions: string[];
  },
)

Source from the content-addressed store, hash-verified

85}
86
87async function findProjectFile(
88 project: ProjectConfiguration,
89 file: {
90 names: string[];
91 extensions: string[];
92 },
93): Promise<string | undefined> {
94 // eslint-disable-next-line functional/no-loop-statements
95 for (const name of file.names) {
96 // eslint-disable-next-line functional/no-loop-statements
97 for (const ext of file.extensions) {
98 const filename = `./${project.root}/${name}.${ext}`;
99 if (await fileExists(path.join(process.cwd(), filename))) {
100 return filename;
101 }
102 }
103 }
104 return undefined;
105}

Callers 2

findEslintConfigFunction · 0.85

Calls 1

fileExistsFunction · 0.90

Tested by

no test coverage detected