Source graph

Configuration

Understand entry files, project globs, test file patterns, ignores, aliases, and unresolved imports.

Config Discovery

Codescythe reads config from an explicit path, root config file, or package manifest. Explicit paths are best for CI because they remove ambiguity.

  • codescythe.json
  • codescythe.jsonc
  • package.json under the codescythe key
  • an explicit --config path

Entry Files

Entry files are the reachable roots of the source graph. A file or export reachable from an entry is treated as used.

"entry": [
  "src/index.ts",
  "src/cli.ts",
  "src/routes/**/*.tsx"
]

Model detached applications, CLI entrypoints, package exports, and end-to-end specs as entries when they should keep their imports alive.

Project Files

Project globs define the files Codescythe is allowed to report as unused. Keep generated output, vendored code, build artifacts, and intentionally detached examples outside the project set or under ignore rules.

"project": [
  "src/**/*.{js,jsx,ts,tsx}",
  "packages/*/src/**/*.{ts,tsx}"
]

Test File Patterns

Files matching test file patterns are treated as leaf files. They can be removed when they only test code that is being removed, but they do not make production imports look used.

"testFilePatterns": [
  "**/*.test.*"
]

Config Fields

entry
Reachability roots

Typestring or string[]

ValuesFile paths or glob patterns, relative to the analysis root.

Files and globs that keep imports and exports alive. Use one entry per application, CLI, package boundary, or detached spec root that should anchor reachability.

"entry": [
  "src/index.ts",
  "src/cli.ts",
  "src/routes/**/*.tsx"
]
project
Reportable source files

Typestring or string[]

ValuesFile paths or glob patterns for source files Codescythe may report.

Keep generated output, vendored files, build output, and intentional examples outside this set or covered by ignore rules.

"project": [
  "src/**/*.{js,jsx,ts,tsx}",
  "packages/*/src/**/*.{ts,tsx}"
]
testFilePatterns
Leaf test classification

Typestring or string[]

ValuesGlob patterns. Default: ["**/*.test.*"].

Matching files do not mark production imports as used. Configure .spec files explicitly if they should behave like test leaves.

"testFilePatterns": [
  "**/*.test.*",
  "**/*.spec.*"
]
ignore
Exclude files

Typestring or string[]

ValuesGlob patterns matched before analysis.

Use for generated, vendored, or otherwise intentionally detached files. Doctor warns when generated-looking ignore patterns also match checked source files.

"ignore": [
  "src/generated/**",
  "**/*.stories.tsx"
]
aliases
Import resolution

Typeobject mapping string keys to string or string[] targets

ValuesKeys may use wildcards such as "#app/*"; values are relative target patterns such as "src/*".

Explicit source alias mappings override or supplement package metadata when package.json imports are not enough.

"aliases": {
  "#app/*": "src/*",
  "#generated/*": ["src/generated/*"]
}
unresolvedImports
Resolver policy

Typeobject

Valuesmode: "report" | "ignore" | "error"; ignore: string or string[]. Default mode is "report".

Use report while tuning config, error in CI when unresolved source imports are unacceptable, and ignore only for reviewed non-source patterns.

"unresolvedImports": {
  "mode": "error",
  "ignore": ["*.svg?raw", "virtual:*"]
}
includeEntryExports
Entry export handling

Typeboolean

ValuesDefault: false.

Set true when entry files are also public export surfaces and their exports should be checked instead of automatically preserved.

"includeEntryExports": true
ignoreExportsUsedInFile
Local export usage

Typeboolean

ValuesDefault: false.

Suppresses exported symbols that are referenced inside their declaring file. Use sparingly for modules with deliberate local export patterns.

"ignoreExportsUsedInFile": true