You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ yarn tsc --noEmit
src/components/core.ts:182:54 - error TS2352: Conversion of type '{ p: true; b: true; a: true; test: (element: any) => boolean; }' to type 'SanitizerConfig' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Property 'test' is incompatible with index signature.
Type '(element: any) => boolean' is not comparable to type 'boolean | { [attr: string]: string | boolean; } | (() => any)'.
Type '(element: any) => boolean' is not comparable to type '() => any'.
182 this.config.sanitizer = this.config.sanitizer || {
~
183 p: true,
~~~~~~~~~~~~~~
...
186 test: (element: any) => true,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
187 } as SanitizerConfig;
Expected behavior:
Prevent TypeScript error even use callback in sanitizer config.
Editor.js version: 2.19.1
The text was updated successfully, but these errors were encountered:
Describe a bug.
html-janitor supports callback pattern in order to customize the sanitizing behavior.
https://github.com/guardian/html-janitor#using-logic
But, it isn't supported as TypeScript definition.
Steps to reproduce:
Example: line 182, src/components/core.ts
Expected behavior:
Prevent TypeScript error even use callback in sanitizer config.
Editor.js version: 2.19.1
The text was updated successfully, but these errors were encountered: