Skip to content

[Linting Rule] Absolute File Paths

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

Generated from 'wiki-linter.ts' on 2026-10-27, 10:46:55 UTC (v2.16.6), do not edit directly.

Absolute Paths [overview]

smell quickfix reproducibility robustness

This rule is a best-effort rule.

Finds absolute file paths.
This linting rule is implemented in src/linter/rules/absolute-path.ts.

Configuration

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

  • absolutePathRegex
    Extend the built-in absolute path recognition with additional regexes
  • additionalPathFunctions
    The set of functions that should additionally be considered as using a file path. Entries in this array use the FunctionInfo format from the dependencies query.
  • ignoreUrls
    Automatically ignore URLs (http/https/ftp) so they are not reported as absolute paths.
  • include
    Include paths that are built by functions, e.g., file.path()
  • useAsWd
    Which path the relative-path quick fix is built against: @project (project root, falling back to the script when there is no root), @script, @home, or a literal directory.

Examples

read.csv("/home/me/project/data/survey.csv")

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

[ { "type": "linter",   "rules": [ { "name": "absolute-file-paths",     "config": { "useAsWd": "/home/me/project" } } ] } ]

Results (prettified and summarized):

Query: linter (2 ms)
   ╰ Absolute Paths (absolute-file-paths):
       ╰ certain:
           ╰ Path /home/me/project/data/survey.csv at 1.1-44 (1 quick fix(es) available)

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

Clone this wiki locally

⌂ 换网址