Skip to content

[Linting Rule] Overwritten File

github-actions[bot] edited this page Oct 27, 2026 · 1 revision

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

Overwritten File [overview]

bug reproducibility

This rule is a best-effort rule.

Finds files the script writes more than once, so the later write replaces what the earlier one wrote, as two figures saved under the same name.
This linting rule is implemented in src/linter/rules/overwritten-file.ts.

Configuration

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

Examples

write.csv(cars, "out.csv")
write.csv(iris, "out.csv")

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

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

Results (prettified and summarized):

Query: linter (2 ms)
   ╰ Overwritten File (overwritten-file):
       ╰ certain:
           ╰ out.csv is written again, replacing what line 1 wrote to it

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

Clone this wiki locally