Skip to content

[Bug]: import/no-extraneous-dependencies lint rule doesn't work without building monorepo packages first #27727

Description

@Hotell

Library

All

System Info

na

Are you reporting Accessibility issue?

None

Bug Description

Recently v8 release builds started to fail https://uifabric.visualstudio.com/UI%20Fabric/_build/results?buildId=300471&view=logs&j=8d802004-fbbb-5f17-b73e-f23de0c1dec8&t=fb65810a-a7a9-58a0-61f9-7163cb0bcc0b.

image

As you can see from the pipeline logs it is caused by import/no-extraneous-dependencies violation within react-monaco-editor package introduced by following PR https://github.com/microsoft/fluentui/pull/27539/files#diff-fe9af457a08692110b7ef7ab9ed97bd53b2496e4f2573f644dd1ec8fb921c6baR23.

Although on that PR there were no issues reported.

After deeper investigation the culprit is how import/no-extraneous-dependencies rule works. It needs packages to be build first as it traverses physically file system to obtain "real" package references. This goes against our DX and perf approach to linting which needs to work without any build first requirements.

Reported import-js/eslint-plugin-import#2772

Until we will get some feedback from plugin authors we are left with following options:

  1. leave things as is. release pipelines will fail and report violations that need to be fixed by us
  2. add back build pre-requirement to be able to run lint ( will slow down PR pipeline )
  3. run lint on PR in separate step after build/test/type-check ( will slow down PR pipeline )

Actual Behavior

import/no-extraneous-dependencies needs package assets be physically present on filesystem ( build first , then lint )

Expected Behavior

import/no-extraneous-dependencies should not rely on physical filesystem

Logs

No response

Requested priority

Blocking

Products/sites affected

No response

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions