Skip to content

[Linting Rule] Syntactically Valid

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.

Syntactically Valid [overview]

bug quickfix robustness

This rule ports the following steps of R CMD check (see the conformance table for the legend):

# Step Coverage Note
35 R files for syntax errors (book) 🟩⭐ ⭐ also quick fixes repairing the syntax error

This rule is a best-effort rule.

Finds syntax errors with the configured (error-tolerant) parser. Offers extensible quick fixes to repair them.
This linting rule is implemented in src/linter/rules/syntactically-valid.ts.

Configuration

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

  • disabledFixes
    Names of auto-fix patterns to disable (default none).
    R CMD check #35
  • preferFix
    Preferred FixDirection ; each error gets a single fix, favouring a candidate of this direction.
    R CMD check #35

Examples

x <- c(1, 2

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

[ { "type": "linter",   "rules": [ { "name": "syntactically-valid",     "config": {} } ] } ]

Results (prettified and summarized):

Query: linter (2 ms)
   ╰ Syntactically Valid (syntactically-valid):
       ╰ certain:
           ╰ Missing ) at 1.12-11 (1 quick fix(es) available)

More examples are the test cases in test/functionality/linter/lint-syntactically-valid.test.ts.

Clone this wiki locally

⌂ 换网址