style: apply unicorn/recommended rules#127
Conversation
|
♻️ PR Preview 2455a9b has been successfully destroyed since this PR has been closed. 🤖 By surge-preview |
|
|
||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| overlaysVisibilityButton.addEventListener('click', _ev => { | ||
| overlaysVisibilityButton.addEventListener('click', _event => { |
There was a problem hiding this comment.
suggestion:
| overlaysVisibilityButton.addEventListener('click', _event => { | |
| overlaysVisibilityButton.addEventListener('click', event => { |
There was a problem hiding this comment.
thought: This remark applies to all suggestions done on this topic.
Prefixing by _ is the convention used in TypeScript for unused parameters. We have done this in bpmn-visualization to fix SonarCloud code smells in the past.
I use the prefix here because we enforce noUnusedParameters (demo) or strict (addons, include all noXXX options).
Implementing the suggestion then generates a tsc error: TS6133: event is declared but its value is never read.
| }); | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| htmlElement.onmouseenter = _ev => { | ||
| htmlElement.addEventListener('mouseenter', _event => { |
There was a problem hiding this comment.
suggestion:
| htmlElement.addEventListener('mouseenter', _event => { | |
| htmlElement.addEventListener('mouseenter', event => { |
| const setupControlEventHandlers = (): void => { | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| document.querySelector('#btn-compute-path')?.addEventListener('click', _ev => { | ||
| document.querySelector('#btn-compute-path')?.addEventListener('click', _event => { |
There was a problem hiding this comment.
suggestion:
| document.querySelector('#btn-compute-path')?.addEventListener('click', _event => { | |
| document.querySelector('#btn-compute-path')?.addEventListener('click', event => { |
| }); | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| document.querySelector('#bt-clear')?.addEventListener('click', _ev => { | ||
| document.querySelector('#bt-clear')?.addEventListener('click', _event => { |
There was a problem hiding this comment.
suggestion:
| document.querySelector('#bt-clear')?.addEventListener('click', _event => { | |
| document.querySelector('#bt-clear')?.addEventListener('click', event => { |
|
Kudos, SonarCloud Quality Gate passed!
|









Notes
Apply these rules as they are already applied in the bonita-day-2023 demo and will be soon apply in bpmn-visualization