A few ideas based on some quick online research:
good-fencesis a dedicated tool to restrict imports in a TypeScript project. You’d have to add it to your build process as a separate step.- Compile your TypeScript code with
moduleset toes6(to a separate output directory if you need a differentmodulesetting to generate the code you actually run) and then run ESLint with theno-restricted-importsrule on the output. - Set up both your runtime environment and your
tsconfig.jsonso that you can use only non-relative imports, and then use theno-relative-importsrule fromtslint-microsoft-contrib. However, there was talk of deprecatingno-relative-imports. - Write your own TSLint-based reimplementation of ESLint’s
no-restricted-importsand contribute it to tslint-eslint-rules.