question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

invalid & unused imports in Node.fs

See original GitHub issue

ts2fable@0.5.1 The generated Node.fs files generate these invalid imports and it blows up at runtime even though they are to be used. Several issues. What can we do?

let [<Import("*","setTimeout")>] setTimeout: SetTimeout.IExports = jsNative
let [<Import("*","setImmediate")>] setImmediate: SetImmediate.IExports = jsNative
let [<Import("*","NodeJS")>] nodeJS: NodeJS.IExports = jsNative
let [<Import("*","_debugger")>] _debugger: _debugger.IExports = jsNative

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ctaggartcommented, Dec 6, 2017

#141 removed the first three. Updating the invalid TypeScript definition is the only way to fix the last one. I opened https://github.com/DefinitelyTyped/DefinitelyTyped/pull/21994 for that, but popular definitions seem to take a while to get merged.

1reaction
ctaggartcommented, Dec 5, 2017

For this particular case, the first 3 are taken of by https://github.com/fable-compiler/ts2fable/pull/141 once I get it working. And the last one, _debugger should be removed from the TypeScript definition. It was an undocumented API that was removed a couple of versions ago.

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - How can I remove unused imports/declarations ...
It's a good method of house keeping for future edits but won't help existing unused imports, unless you go to those files directly....
Read more >
eslint-plugin-unused-imports
Start using eslint-plugin-unused-imports in your project by running `npm i eslint-plugin-unused-imports`. There are 667 other projects in ...
Read more >
Version 2 does not work with Node.js v15 · Issue #40
I wanted to upgrade from eslint-plugin-unused-imports v1.1.5 to v2.0.0 but it fails in my CI environment using Node.js v15.14.0 with the ...
Read more >
Don't dynamically import code in a directory
Some developers are following a trend of importing code by directory in NodeJS using the fs module. Example file: src/models/index.js. Benefits ...
Read more >
no-unused-vars - ESLint - Pluggable JavaScript Linter
This rule is aimed at eliminating unused variables, functions, and function parameters. ... Examples of incorrect code for this rule: Open in Playground...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found