-
Notifications
You must be signed in to change notification settings - Fork 87
Description
Describe the solution you'd like
Addition of ESLint (as static code analyser) and prettier (to enforce code styles via a configuration file) .
Additional information
Currently, the code base does not employ any methods for standardising code quality and consistency across multiple contributors. This can be achieved via the addition of ESLint and prettier respectively. This will completely remove changes that do not pertain to changes in logic across PRs. This issue was apparent because my existing prettier config in vscode was in conflict with the existing code practices in NodeCloud and even a minor change went ahead and formatted the entire file, this will reduce the readability for project maintainers in pull requests.
Impact
Adds a default coding style and removes unnecessary changes in code in multiple PRs across multiple contributors. For example, switching between single and double quotes across multiple PRs in the same code segment. Additionally, the formatter used currently is pretty-quick with no configuration file present, because of this #109 is required, although this is not feasible as the number of contributors in the project increases and should be automated before a commit. Additionally, best practices should be enforced via the use ESLint which can be updated as required via a config file.
Attaching instances of apparent inconsistencies
References
-
misconfiguration of the formatter
In each commit, thepretty-quickscript is run by husky, and this takes the default config of prettier set in the user's vscode, due to this an entire file gets formatted even when there is no major change in it, makes the process of reviewing changes difficult. -
Additional conflicting linting rules with respect to imports, implicit
anytypes and empty function definitions, all these are sources of potential bugs in future and can be avoided by using eslint and enforcing consistent practices.

