Closed gijsk closed 3 years ago
liberal parser support can bite us here. I've found various way this is parsed, by going through eslint, babel-eslint, @babel/parser on https://astexplorer.net/:
ImportExpression
CallExpression
with "type": "Import"
CallExpression
with a callee
that is not an Identifier
node, but rather a node of type Import
We don't care about flow, but can we make sure that we catch the others with tests per-parser?
Bedankt! :)
As noted in https://github.com/mozilla/eslint-plugin-no-unsanitized/issues/135#issuecomment-701463062 , in modern parsers this should be OK as the "real" dynamic import cannot be renamed or called as a method.