Every time you make changes to a file for a ticket / bugfix, you clean up some of the basic technical debt:
- Dead / unused code
- Commented code
- Fix linting issues
- Remove
anyif using TypeScript and use types - Seperation of concerns (Vue only)
- Remove duplicate code
Code that isn't used anywhere and can be safely removed. This can exist in different forms:
- Functions or variables that aren't referenced anywhere
if (false)orv-if="false"orif (true)orv-if="true"- Unused CSS
- console.logs => if you want logging, you should use logstash or any other decent platform
Code that has been commented because it's not relevant anymore, this should be removed. The reason is because we are using version control (git) and we can always look it up in the history.
Interesting long read about the topic: https://kentcdodds.com/blog/please-dont-commit-commented-out-code
We have eslint in our codebases because this is added by default for every vue-cli project. We should fix the issues that it's mentioning because they can help us avoid bugs / unexpected behavior.
If we're using TypeScript then we should use it properly. The first way to use it properly is to avoid any and use types.
Avoid inline styles, for example <span style="font-weight: bold">. Either use vuetify classes(preferred) or write your own.
If you notice patterns, code being rewritten in multiple places, you can try to extract it and reference it in the places that you need.
If it's used cross project, you could put it in the @bluecorner/shared package.
https://bitbucket.org/bluecorner-development/shared/src/master/
An example is form validation which should be the same throughout the organisation.