Problem/Motivation
Currently ESLint is reporting the following;
✖ 346 problems (303 errors, 43 warnings)
A couple of quite similar issues with eslint checks.
- no-var - "var" declaration should not be used - "let" or "const" should be used instead.
- prefer-const - If a variable never has its value reassigned, it should be declared with "const".
Steps to reproduce
Please see previous pipeline log: https://git.drupalcode.org/project/smart_date/-/jobs/1161523
Proposed resolution
Always use "const" for declarations that don't need to be updated.
Always use "let" for variables that get updated.
Remaining tasks
Check the correct for each declaration and update.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Issue fork smart_date-3437669
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
lostcarpark commentedComment #4
lostcarpark commentedFixing "var" statements, and changing "let" to "const" where not modified, reduces the number of errors considerably.
✖ 247 problems (204 errors, 43 warnings)Comment #5
lostcarpark commentedComment #8
mandclu commentedThanks for your work on this @lostcarpark.
While testing these changes I did also find a regression in the end date not hiding, which looks to go back to the move to strict comparisons in a previous issue. I incorporated that fix here as well.
Merged in.