Maintain clean and consistent code by removing unnecessary elements and following standard practices:
// Bad
import { computed, watch } from 'vue'; // watch is never used
// Good
import { computed } from 'vue';
// Bad
// const { getReportingURL } = useBugReporting();
// <LogoText v-if="showLogoText" :class="$style.logoText" />
// Good
// Import only what's needed, remove completely when no longer used
/* Bad */
.container {
justify-content: right; /* Invalid value */
}
<style v-if="content.css" type="text/css" scoped> /* Non-standard usage */
/* Good */
.container {
justify-content: flex-end; /* Standard value */
}
/* Bad - selector with no matching elements */
.titleInput input {
/* styles that will never be applied */
}
// Bad
// eslint-disable-next-line @typescript-eslint/return-await
return await somePromise();
// Good
return somePromise(); // Fix the underlying issue instead
Following these practices improves code readability, reduces maintenance overhead, and prevents subtle bugs from entering your codebase.
Enter the URL of a public GitHub repository