Skip to content

Inputs ​

Finds the compiled JSON files to lint, and reads the Questionnaires out of them. The linter never reads FSH to find forms: it lints what SUSHI compiled.

The run lints exactly one list of paths, picked in this order:

  1. The paths given on the command line: a targeted run.
  2. Otherwise, the config's files: a full run.
  3. Otherwise, fsh-generated/resources: a full run.

This is an order of precedence, not a fallback: if a path in the chosen list matches nothing, the run fails rather than moving on to the next list.

A path can be a file, a directory or a quoted glob. A directory means every .json file below it. The search skips .git, node_modules and symlinked directories. A file selected twice, for example through a symlink, is read once. A Questionnaire is one form, and a Bundle gives one form for each Questionnaire in it. The Bundle's other resources stay available to rules as targets of local references. Any other JSON file is skipped and counted in the summary.

Failure codeWhen
INPUT_NOT_FOUNDA path given does not exist
INPUT_PATTERN_UNMATCHEDA glob or directory selects no files
INPUT_UNREADABLEA selected file or directory cannot be read
INPUT_INVALID_JSONA selected file is not valid JSON
NO_QUESTIONNAIRESThe files hold no Questionnaire. The help suggests running SUSHI when the default directory is missing.

Each stops the run with exit code 2. Input selection is the full contract.

Schema ​

Code ​

In packages/core/src/inputs/:

  • load-inputs.ts: loadInputs runs the steps below, and fails with NO_QUESTIONNAIRES when no form is found.
  • select.ts: selectInputEntries picks the one list of paths and says whether the run is targeted or full.
  • expand.ts: expandEntries turns directories and globs into files.
  • paths.ts: canonicalizeInputFiles resolves symlinks so each file is read once. displayPath gives the path relative to the working directory, as reports show it.
  • read.ts: readInputs parses each file and collects its Questionnaires, standalone or from a Bundle.

Two more lookups run at this point. Neither ever fails the run: