Bring out yer dead!

omnoms

Marko V

Posted on February 27, 2020

Bring out yer dead!

This is the post about the necessary cleaning. The spring cleaning of your code. Removing dead code paths, removing unused files... our conversion/migration towards angular (typescript) from AngularJS is starting to make way. I removed sooo many files from the application (that really ought to have been done when they were made into components instead) but, as always, there's some aftermath/cleanup to do regardless.

I removed dead code paths in entire block of scripts, not touching the components that are in use because those will be covered when linting for "no-unused-var" for instance. I removed scripts that were bundled, but no longer in use since they were made into components...

"But I'm not dead!"

Similarly I found scripts that might have been in use at first glance, so I had to search and make sure that the code was not being in use anywhere (a custom event extension for IE11 for instance) as well as scripts that were not removed but also were not included in the MVC Script bundling so they could be safely removed.

I let eslint auto-fix files for whitespace/indent issues, missing semi-colons and dot-annotation conversions.

And lastly i added .eslintignore for webpack and vendor folders. Our errors went from 132k linting errors down to 621.

Drastic difference.

P.S.
Webpack doesnt do linting very well in it's output.
D.S.

💖 💪 🙅 🚩
omnoms
Marko V

Posted on February 27, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related