'Hide deprecated module from typescript compiler

I have typescript project with absolute paths set with baseUrl property in tsconfig file to src directory. The problem is that I want to have constants.ts file in the root of the src directory, and when I want to import something from that file, compiler tries to import code from deprecated constants NodeJS module, and I see message below in the IDE:

module "constants"
@deprecated — since v6.3.0 - use constants property exposed by the relevant module instead.

How can I hide this module or create an alias, so that src/constants.ts file would be read first?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source