`flow-remove-types` throws a syntax error on ES `import` attributes
Author: sangafabriceCreated Dec 27, 2025Updated Jun 29, 2026
Labelsbugneeds triage
flow-remove-types version: 2.295.0 Flow version: 0.295.0
Actual behavior
The Flow parser successfully parses the following script without any errors:
/** @flow @file index.js */
import ruleset from "./htmlhint.json" with { type: "json" };However, running flow-remove-types on the same file results in a syntax error:
$ npx flow-remove-types --out-file .\index.out.js .\index.js
.\index.js
↳ Syntax Error: ';' expected (2:38)
import ruleset from "./htmlhint.json" with { type: "json" };
^
1: import ruleset from "./htmlhint.json" with { type: "json" };Expected behavior
The command should complete successfully and generate the output file without throwing an error:
$ npx flow-remove-types --out-file .\index.out.js .\index.js
.\index.js
↳ .\index.out.js- Link to Try-Flow or Github repo: N/A (The issue is specific to
flow-remove-typesand does not require Flow server execution or.flowconfigsettings.)
Source: facebook/flow