I found a solution in the official deno documentation. The project needs node types to type check lists like string[] correctly.
I faced the same issue with types like Array<T>. However, declaring :
/// <reference types="npm:@types/node" />
At the head of the .mts file fixed everything.