invalid & unused imports in Node.fs
See original GitHub issuets2fable@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:
- Created 6 years ago
- Comments:10 (10 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
#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.
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.