-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix some es lint issues with npx eslint@8 --ext .js --resolve-plugins… #215
base: 2.x
Are you sure you want to change the base?
Conversation
…-relative-to=./web/core --fix web/modules/contrib/localgov_paragraphs/
…e/.stylelintignore --config web/core/.stylelintrc.json --fix web/modules/contrib/localgov_paragraphs/**/*.css
I'm not sure how to deal with this one:
Any ideas @millnut / @ekes / @markconroy ? Then, the localgov-tabs.js files says it should not be edited directly, so I think we want to remove that file and rename the .es6 file to the .js file. |
} | ||
} | ||
}); | ||
button.addEventListener('click', (e) => doSomething(e)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need the anonymous function here, as it's just passing the event through itself to doSomething. So this can be:
button.addEventListener('click', doSomething);
@@ -121,6 +121,44 @@ | |||
return -1; | |||
} | |||
|
|||
function doSomething(e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest showHideButtonClickHandler is a better name than doSomething.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha - yeah, naming things!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the (renamed) showHideButtonClickHandler(e) need the "e" passing in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it still needs the event as an argument.
Just updated the latest commit on the dev branch of office_hours as they addressed the previous phpunit failure. But now we get this:
From this commit: https://git.drupalcode.org/project/office_hours/-/commit/3e4c1b2bde8e2c463bca8bbc9c1972c8c75392af#c0851fec5de699ae4b1b81b00b8f30af27fe04a6_176_134 |
Hey @finnlewis the reason 8.1 and 8.2 fail is because office hours is using typed constants which were only introduced in PHP 8.3 and later e.g. public const string UPDATE = 'office_hours.update'; for < PHP 8.3 this would work public const UPDATE = 'office_hours.update'; I've commented on the ticket that introduced this upstream https://www.drupal.org/project/office_hours/issues/3503165 |
@@ -16,7 +16,7 @@ | |||
"drupal/fontawesome": "^3.0", | |||
"drupal/geolocation": "^3.1", | |||
"drupal/layout_paragraphs": "^2.0", | |||
"drupal/office_hours": "^1.8", | |||
"drupal/office_hours": "1.x-dev#27be616c", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should pin to a dev version, if we can hold this PR for now that would be preferred.
I've been speaking with the maintainer and they've reverted the changes and will be creating a new release soon. Then introducing a follow up release and specifying PHP version requirement as 8.3+ in the composer.json so it won't be pulled down by composer if the requirements do not match.
See #214
Attempting to fix eslint issues with the automated tooling.