mozilla / eslint-plugin-no-unsanitized

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

unexpected AssignmentExpression in normalizeMethodCall #207

Closed nikicat closed 1 year ago

nikicat commented 1 year ago

Hello, I get this warning when submitting my extension to AMO. It's triggered by this Svelte.js code

...
function handle_promise(promise, info) {
    const token = info.token = {};
    function update(type, index, key, value) {
        if (info.token !== token)
            return;
        info.resolved = value;
        let child_ctx = info.ctx;
        if (key !== undefined) {
            child_ctx = child_ctx.slice();
            child_ctx[key] = value;
        }
        const block = type && (info.current = type)(child_ctx);
...

I suppose it's generated from this line

mozfreddyb commented 1 year ago

Hey @nikicat, thanks for the report. I think this is a simple case. I'll take a look.

mozfreddyb commented 1 year ago

Latest main branch should have this issue fixed. I'd really appreciate if you can confirm that this work for you before we cut another release. Please tell me if you can't test, in which case we'll defer making a release.

nikicat commented 1 year ago

I confirm, the error was gone.