From the course: Refactoring with GitHub Copilot
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Dealing with legacy code - Github Copilot Tutorial
From the course: Refactoring with GitHub Copilot
Dealing with legacy code
Legacy code. What is it? I've been on teams that define legacy code as anything not built here, and I've worked on codebases that are 15 years old but continually refactored that don't feel like legacy. One of the first indicators to me is the language features in use. I'm going to start by asking Copilot what has changed in JavaScript in the last 12 years? Knowing what features were introduced and when can help indicate the age of a project, but that doesn't necessarily make them legacy. Have you worked in JavaScript codebases without arrow functions? Or how about async await? One area that often seems to be in a state of decay is dependency management. This is a package.json file used for handling dependencies. When I try to install it, it tells me I have an issue. I can just paste this into Copilot and it tells me how to fix it. Now, this case was somewhat obvious, I had a mismatched dependency on React and ReactDOM, mismatched versions. So what I'm going to do is I'm going to…