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

Command icon 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

lostcarpark created an issue. See original summary.

lostcarpark’s picture

Issue summary: View changes

lostcarpark’s picture

Fixing "var" statements, and changing "let" to "const" where not modified, reduces the number of errors considerably.

✖ 247 problems (204 errors, 43 warnings)

lostcarpark’s picture

Status: Active » Needs review

mandclu made their first commit to this issue’s fork.

  • mandclu committed 10963d1f on 4.1.x authored by lostcarpark
    Issue #3437669 by lostcarpark, mandclu: GitLab CI - ESLint - no-var and...
mandclu’s picture

Status: Needs review » Fixed

Thanks 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.