Skip to content

antoninbouchal/dts-generator-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Examples of dts-bundle-generator issue

Package URL: https://www.npmjs.com/package/dts-bundle-generator

Required behavior

  • Using 'fs' module (or other node.js core packages) in TypeScript
  • TypeScript compilation is success
  • DTS bundle generator build valid declaration file
  • TS Lint check is success

Problem descriptions

When my code import fs package, DTS bundle generator generate invalid declaration file.

Examples

example-not-working

My original code.

Importing fs package as usual normal way

import * as fs from 'fs'

Using Stats object via namespace fs.Stats

Declaration file import only {Stats} and throw error Cannot find namespace 'fs'.

I think that this is right usage and this one should work

example-lint-error

Using two imports from one package works fine, but it is not valid according TS lint

import * as fs from 'fs'
import {Stats} from 'fs'

example-working

Working solution that we import only Stats and fs package is required.

It's working solution, but really ugly.

import {Stats} from 'fs';
const fs = require('fs');

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published