Closed nate-anderson closed 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!
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 .
@nate-anderson Please check if the issue is gone with 1.1.159+
The TypeScript definition file
ololog.d.ts
exports symbolnull
which VS Code's TypeScript auto import feature is eager to import any time the symbolnull
is autocompleted.For example, pressing the autocomplete key at the end of this line:
const rudeObj = { hello: "world", value: nul
will causenul
to be auto completed tonull
, 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' 😄