Skip to content

[Linting Rule] File Path Validity

github-actions[bot] edited this page Nov 8, 2026 · 1 revision

Generated from 'wiki-linter.ts' on 2026-11-08, 14:25:27 UTC (v2.17.4), do not edit directly.

File Path Validity [overview]

bug quickfix reproducibility robustness

This rule is a best-effort rule.

Finds file paths used in read and write operations that are invalid or do not point to existing files.
This linting rule is implemented in src/linter/rules/file-path-validity.ts.

Configuration

Linting rules can be configured by passing a configuration object to the linter query as shown in the example below. The file-path-validity rule accepts the following configuration options:

  • additionalReadFunctions
    The set of functions that should additionally be considered as reading a file path. Entries in this array use the FunctionInfo format from the dependencies query.
  • additionalWriteFunctions
    The set of functions that should additionally be considered as writing to a file path. Entries in this array use the FunctionInfo format from the dependencies query.
  • checkUrls
    Whether URLs should be validated by checking the endpoint exists. When false (default), URLs are silently ignored. When true, an HTTP HEAD request is made and the URL is reported if unreachable.
  • includeUnknown
    Whether unknown file paths should be included as linting results.

Examples

A project with the code R/code.R:

survey <- read.csv("data/Survey.csv")

and the files

R/survey.csv:

id,value
1,2

The linting query can be used to run this rule on the above example:

[ { "type": "linter",   "rules": [ { "name": "file-path-validity",     "config": {} } ] } ]

Results (prettified and summarized):

Query: linter (10 ms)
   ╰ File Path Validity (file-path-validity):
       ╰ certain:
           ╰ Path data/Survey.csv at /pkg/R/code.R:1.11-37 (1 quick fix(es) available)

More examples are the test cases in test/functionality/linter/lint-file-path-validity.test.ts.

Clone this wiki locally

⌂ 换网址