Skip to content

Disallow access to all global objects for @fluentui/react-components #29964

@spmonahan

Description

@spmonahan

Library

React Components / v9 (@fluentui/react-components)

Describe the feature that you would like added

Follow up to #28145 for @fluentui/react-components. We want to further restrict access to globals via a lint rule, disallowing direct access to things like ResizeObserver. After this change the pattern will be something like:

const { targetDocument } = useFluent();
const win = targetDocument.defaultView;

const ro = new win.ResizeObserver(...);

Have you discussed this feature with our team

@spmonahan

Additional context

This lint rule will better ensure objects created from globals are scoped to the correct window/document.

Validations

  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Priority

Normal

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions