Closed Neiz-Kap closed 3 weeks ago
My eslint complains on these 3 lines
https://github.com/Telegram-Mini-Apps/telegram-apps/blob/c57d93c474d2d0b2861d1bb3ab99f24957af15cd/playgrounds/react/src/init.ts#L37
Error message: Expected an assignment or function call and instead saw an expression.eslint[@typescript-eslint/no-unused-expressions](https://typescript-eslint.io/rules/no-unused-expressions)
Expected an assignment or function call and instead saw an expression.eslint[@typescript-eslint/no-unused-expressions](https://typescript-eslint.io/rules/no-unused-expressions)
Full code:
debug && import('eruda') .then((lib) => lib.default.init()) .catch(console.error);
Suggestion to do:
if (debug) { (async () => { try { const lib = await import('eruda'); lib.default.init(); } catch (error) { console.error(error); } })(); }
You can ignore these warnings as long as playgrounds are just for test purposes.
Also, I don't have this issue:
There are also no similar warnings running the command:
eslint playgrounds/react/src/**/*
My eslint complains on these 3 lines
https://github.com/Telegram-Mini-Apps/telegram-apps/blob/c57d93c474d2d0b2861d1bb3ab99f24957af15cd/playgrounds/react/src/init.ts#L37
Error message:
Expected an assignment or function call and instead saw an expression.eslint[@typescript-eslint/no-unused-expressions](https://typescript-eslint.io/rules/no-unused-expressions)
Full code:
Suggestion to do: