mozilla / eslint-plugin-no-unsanitized

Custom ESLint rule to disallows unsafe innerHTML, outerHTML, insertAdjacentHTML and alike
Mozilla Public License 2.0
223 stars 34 forks source link

[typescript] Unsupported Callee of type 'TSAsExpression' for CallExpression #126

Closed ffflorian closed 2 years ago

ffflorian commented 4 years ago

I was mapping functions and values from one object to the other when I got Error in no-unsanitized: Unexpected Callee.

The error happened in map[key] = (value as any)();

Minimal example:

Object.entries({}).reduce((map: any, [key, value]) => {
  map[key] = (value as any)();
  return map;
}, {});
mozfreddyb commented 4 years ago

Please see https://github.com/mozilla/eslint-plugin-no-unsanitized/issues/111#issuecomment-599557165 about TypeScript support.

mozfreddyb commented 2 years ago

We hope to support TS as per #113, closing this one.

ffflorian commented 2 years ago

Thanks, looking forward @mozfreddyb!