MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / detect

Function detect

src/resolution/frameworks/react.ts:30–37  ·  view source on GitHub ↗
(context: ResolutionContext)

Source from the content-addressed store, hash-verified

28 languages: ['javascript', 'typescript', 'tsx', 'jsx'],
29
30 detect(context: ResolutionContext): boolean {
31 // React in a package.json — the root's, or a workspace's (`frontend/`, `apps/web/`).
32 if (dependsOn(context, 'react', 'next', 'react-native')) return true;
33
34 // Check for .jsx/.tsx files
35 const allFiles = context.getAllFiles();
36 return allFiles.some((f) => f.endsWith('.jsx') || f.endsWith('.tsx'));
37 },
38
39 // A data-router `lazy: () => import('./routes/x')` route names a module, not
40 // a symbol, and `import:./x#Page` the export its loader picks; a route's

Callers

nothing calls this directly

Calls 2

dependsOnFunction · 0.90
getAllFilesMethod · 0.65

Tested by

no test coverage detected