microsoft / microsoft/fluentui
[Bug]: `import/no-extraneous-dependencies` lint rule doesn't work without building monorepo packages first
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 20.3k
- Forks
- 2.9k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 46
Description
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.
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 https://github.com/import-js/eslint-plugin-import/issues/2772
Until we will get some feedback from plugin authors we are left with following options:
- leave things as is. release pipelines will fail and report violations that need to be fixed by us
- add back build pre-requirement to be able to run lint ( will slow down PR pipeline )
- 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the v8 release pipeline logs and the react-monaco-editor package, then inspect where import/no-extraneous-dependencies is configured and how lint runs relative to package builds. Review the linked eslint-plugin-import issue before choosing an approach; done means lint no longer requires built package assets or release pipelines no longer report this violation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- eslint, react, typescript
- Domain
- build-system, ci-cd, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100