Using sonarlint, can easily maintain and remove cognitive complexity of functions and unused items.
We should also focus on optimization of code, some time for getting desired result we use so much loops and conditions.
Before using any npm package check weekly downloads and last update.
Check build size as well before selecting any npm packages.
Always validate the request you get.
Always do a null check.
Proper logs should be there for dubugging
Code should be maintained easily.Future maintanence and feature addition can be done easily.
Do file indexing inside folders that reduce multiple imports and keep everything in single import.
Name convention (eg. Function name should be in camel case).
Write unit test cases for each and every scenario.
Could use lint-staged and husky hooks on commit to avoid conflicts of code format keeping code consistent across the team.
CI/CD should be implemented to avoid build errors on daily basis.
Create proper ReadMe file for better future use.
Use .env / avoid hardcoding.
We can use some predefined functions as per requirements instead of some algorithms, loops and logics, it can reduce our script time.
Also we can use proper variable name, form field name, array name and function name as per our functionality so that one can understand which functionality comes under the function.
We can follow the same name form field name and variable name and database column name which can be easy to remember while we are coding.