'Risk building third party code in a non isolated environment

Let's say I have an application that clones a Git repository and executes the following commands on it :

tsc
eslint .

Are there any risks in doing it directly from a given machine ? By this, I mean not from an "isolated" environment (VM, containers, etc.). If so, which are they ?

Of course, the code will never be executed, only checking its style and if it compiles/transpiles correctly.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source