Quick Tip - Specific Local Module Declarations
Published ....
Last modified ....
Share this post on BlueskySee discussion on Bluesky
I've been working in a codebase lately that uses a shared module across a few different files - in my case the module is a JSON file that I'm importing and I wanted to enforce consistent types for the value when it was imported across the codebase.
As far as I can tell the recommended solution looked something like this:
import jsonObject from "./some/path/to/the/file.json";
import type { MyDesiredJSONType } from "./some-types";
let