mgechev / javascript-algorithms

💻 JavaScript implementations of computer science algorithms
https://mgechev.github.io/javascript-algorithms/
MIT License
7.83k stars 1.28k forks source link

Begin moving to ES6 syntax via linting changes. #196

Closed JRIngram closed 4 months ago

JRIngram commented 1 year ago

This PR begin the process of moving to ES6 syntax (which has been discussed in #194 ).

This PR achieves 3 things as part of fix:

1. Adds an explicit eslint script command to the package file.

The rationale behind this was so that the eslint rules could be tweaked to favour ES6 syntax. With an explicit linting script in place we can more easily identify where changes need to occur.

2. Change lint rule to use let / const

As raised in #194, let / const sytanx should be favoured. The linting rules have been changed to flag vars, and the issues have been fixed.

3. Fix previous linting errors

This repository was breaking its own linting rules, such as no-plus-plus. These have been resolved.

Note: I do not believe that this totally resolves #194 and that should remain open; this PR does, however, begin that journey should make the journey easier.