I've been searching for a solution to this issue, but haven't found a definitive answer yet.
My current challenge involves using the suncalc
module with TypeScript. Since it doesn't come with its own typing file, I created one and saved it in my typings directory under suncalc/suncalc.d.ts
At the beginning of my file, I've included the following lines:
/// <reference path="../typings/suncalc/suncalc.d.ts" />
"use strict";
import * as moment from "moment";
import {SunTimes} from "suncalc";
import SunCalc = require("suncalc");
The code is functioning correctly and wallaby is able to identify everything without any issues. However, TSLint (or the TypeScript Compiler) in WebStorm keeps indicating that it can't locate the 'suncalc' module.
I've experimented with changing my tslint.json
, typings.json
, and tsd.json
, but I'm unable to resolve the error.
In addition, when I run gulp, it notifies me that it can't find modules like chai
, it
, or describe
, even though WebStorm and TSLint don't flag them as issues.
I'm eager to eliminate the little red underline beneath the word 'suncalc' in my project.