I have the following TypeScript code:
import * as $MyJsonFile from './myJsonFile.json';
export const MyJsonFile = $MyJsonFile;
The prefer-export-from
rule wants me to change the line to
export * as MyJsonFile from './myJsonFile.json';
Unfortunately, this results in the TypeScript compilation error:
Module '"myJsonFile"' uses 'export =' and cannot be used with 'export *'.ts(2498)
Ideally, prefer-export-from
would be able to ignore export =
modules which are incompatible with the syntax. If that is not possible to infer, then it would be nice to be able to specify certain patterns to exclude from the rule, like:
"prefer-export-from": ["error", {
"ignorePatterns": ["*.json"]
}]
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too