In my typescript project I use:
const program = require('commander');
const figlet = require('figlet');
const AWS = require('aws-sdk');
and I want to refactor those lines to work via import
instead in order to adhere to tslint's no-var-requires
rule. Yet the way it supposed to work eludes me.
For figlet, I tried both:
import figlet from 'figlet';
import * as figlet from 'figlet';
yet then I get:
bin/console.ts(1,20): error TS2307: Cannot find module 'figlet'.
How am I suppose to import these libraries?