xpl / ololog

A better console.log for the log-driven debugging junkies
https://www.npmjs.com/package/ololog
The Unlicense
215 stars 8 forks source link

TypeScript declaration files export 'null' symbol #18

Closed nate-anderson closed 4 years ago

nate-anderson commented 4 years ago

The TypeScript definition file ololog.d.ts exports symbol null which VS Code's TypeScript auto import feature is eager to import any time the symbol null is autocompleted.

For example, pressing the autocomplete key at the end of this line:

const rudeObj = { hello: "world", value: nul will cause nul to be auto completed to null, and the null symbol to be automatically imported from ololog.

import ololog, { null } from 'ololog';

The result is invalid code, because null cannot be assigned to for obvious reasons.

It strikes me that it is not good practice to export a symbol that is a language keyword. It is possible that this is simply bad behavior on VS Code's part, but note that this is not the behavior of an extension.

https://github.com/xpl/ololog/blob/fe1d34adf999c3da3b19dc409c41bc02f61aa7e6/ololog.d.ts#L130

Before you ask, yes, I am too lazy to type the word 'null' 😄

xpl commented 4 years ago

I think it's a bad behavior of VSCode, as JS itself can perfectly differentiate between a keyword and a property in an object in that case.

Anyway, I'm going to rename it to noop, thanks for pointing that out!

nate-anderson commented 4 years ago

Thanks Vit, I appreciate you making that change to alleviate my mild inconvenience. Cheers!

On Sat, Jul 25, 2020, 11:34 AM Vit Gordon notifications@github.com wrote:

I think it's a bad behavior of VSCode, as JS itself can perfectly differentiate between a keyword and a property in an object in that case.

Anyway, I'm going to rename it to noop, thanks for pointing that out!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xpl/ololog/issues/18#issuecomment-663886798, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH5LKGM7PTA7P2TIKZJPCZDR5MQSBANCNFSM4PHHBZUQ .

xpl commented 4 years ago

@nate-anderson Please check if the issue is gone with 1.1.159+