Use getBinding instead of getBindingAssert
MODIFY
packages/@romejs/js-compiler/transforms/lint/noImportAssign.ts
packages/@romejs/js-compiler/transforms/lint/noImportAssign.ts
@@ -27,11 +27,12 @@ export default {
const {node, scope} = path;
if (
- ((node.type === 'AssignmentIdentifier' && isAssignment(path)) ||
+ (node.type === 'AssignmentIdentifier' && isAssignment(path)) ||
(node.type === 'ReferenceIdentifier' &&
- path.parentPath.node.type === 'UpdateExpression')) &&
- scope.getBindingAssert(node.name).kind === 'import'
+ path.parentPath.node.type === 'UpdateExpression')
) {
+ let binding = scope.getBinding(node.name);
+ if (binding !== undefined && binding.kind === 'import')
path.context.addNodeDiagnostic(node, {
category: 'lint/noImportAssign',
message: markup`<emphasis>${node.name}</emphasis> is read-only`,

Use getBinding instead of getBindingAssert