Forcing TypeScript to NOT use fenix-tools arrow functions when compiling

56 Views Asked by At

I have been developing plugins for RPG Maker MV, with the lowest version they support being 1.5.1. That means I need the output to be ES5-compatible, and despite having tsconfig set up like so:

{
    "compilerOptions": {
      "target": "es5",
      "module": "ES2015",
      "esModuleInterop": true,

      "sourceMap": false,
      "downlevelIteration": true,
    },
}

The compilation uses arrow functions thanks to a certain dependency a couple of my plugins use. I manage to make the output work by rewriting the arrow functions in it, but I'd rather not have to do that every time I compile.

What should I do to make it so the output's ES5-compatible while still letting me use ES6 features in the TS source? Oh, and here's the minimal reproducible example:

var someParams = { "TargetInStates": "[\"12\"]" };
console.log(convertParameters(someParams));
0

There are 0 best solutions below