diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 32aaedb702..c87d3b566a 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -44,6 +44,7 @@ module.exports = { 'unicorn/prefer-query-selector': 'error', 'unicorn/prefer-add-event-listener': 'error', 'unicorn/no-array-for-each': 'error', + 'unicorn/prefer-dom-node-text-content': 'error', 'import/newline-after-import': ['error', { count: 1 }], 'import/first': 'error', 'import/order': [ diff --git a/dev/ts/pages/bpmn-rendering.ts b/dev/ts/pages/bpmn-rendering.ts index 69913d83ca..75a557cfb1 100644 --- a/dev/ts/pages/bpmn-rendering.ts +++ b/dev/ts/pages/bpmn-rendering.ts @@ -18,8 +18,8 @@ import { documentReady, log, logError, startBpmnVisualization } from '../develop function statusFetchKO(errorMessage: string): void { logError(errorMessage); - const statusElt = document.querySelector('#status-zone') as HTMLDivElement; - statusElt.innerText = errorMessage; + const statusElt = document.querySelector('#status-zone'); + statusElt.textContent = errorMessage; statusElt.className = 'status-ko'; log('Status zone set with error:', errorMessage); } diff --git a/dev/ts/pages/index.ts b/dev/ts/pages/index.ts index b3feb66a16..b03f8cd418 100644 --- a/dev/ts/pages/index.ts +++ b/dev/ts/pages/index.ts @@ -110,8 +110,8 @@ function configureDisplayedFooterContent(): void { const version = getVersion(); const versionAsString = `bpmn-visualization@${version.lib}`; const dependenciesAsString = [...version.dependencies].map(([name, version]) => `${name}@${version}`).join('/'); - const versionElt = document.querySelector('#footer-content') as HTMLDivElement; - versionElt.innerText = `${versionAsString} with ${dependenciesAsString}`; + const versionElt = document.querySelector('#footer-content'); + versionElt.textContent = `${versionAsString} with ${dependenciesAsString}`; } // The following function `preventZoomingPage` serves to block the page content zoom.