I was careful to keep my side work to stuff that did not interfere, or compete, with my corporate employer, so there was never a problem.
As a JavaScript developer everybody wants to tell me how it’s done, what the right way is, and so forth. It’s not worth arguing over because the most incompetent developers tend to be the most vocal ones.
I have been writing JavaScript full time for almost 15 years and most corporate JavaScript I see is complete garbage. How do you know what excellent code is? Numbers. Code size, execution time, maintenance time, defect resolution time, test automation capabilities, new feature delivery time, and so forth. For example if your app takes 4 seconds to load and mine takes 50ms I will just assume I am less wrong, but you can’t advocate for that because will cry about code style and frameworks and other bullshit. So silently I write my personal project.
The only problem here is an employer claiming ownership of a personal project, assuming the personal project isn’t interfering with employee product delivery and isn’t violating employer security policies.
My solution to this is dual employment. My secondary employer has trouble differentiating work time from personal time so they end up with the most liberal IP assignment policies I have ever seen. Everybody, corporate IP attorneys, know this.
So, unless it’s making money or an employer wants to lay down a provision patent they won’t fight you on it. They are fully aware the alternatives are moving to another company or to stop innovating. As a result most employers with silently bless the personal projects even on company time. They won’t bless these efforts directly because personal projects on company time or property are ethical violations that legally compel the employer to take ownership and shut it down. That is the last thing anybody wants.