Skip to content

load-object-before-read false positive on complex load path #985

Description

Expected behavior

No linting error

Current behavior

An explicit load call on 'selection' for property 'parentContentControlOrNullObject' needs to be made before the property can be read office-addins/load-object-before-read

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. If I write this JS code :
  const selection = context.document.getSelection();
  selection.load('parentContentControlOrNullObject/cannotEdit');
  await context.sync();

  const parentContentControl = selection.parentContentControlOrNullObject;
  1. I get a linting error that parentContentControlOrNullObject need to be loaded

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Operating System: MacOS 26.2
  • Node version: 24
  • Office version: latest
  • eslint-plugin-office-addins: 4.0.7

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions