pnp / pnp/cli-microsoft365

spfx project doctor - add checks for React and React DOM

Open
#4,661 11 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs design
Dominant language
TypeScript
Stars
1.5k
Forks
413
Avg merge
5d 6h
Merged PRs (30d)
21

Description

In many cases developers forget to add dependencies to React and ReactDOM while creating React component.
Most often this situation could be noticed for SPFx command sets and application customizers as those libraries are not added there by default.
The proposal is to add extra check to spfx project doctor that will:

  • check if there are tsx files
  • check if there are imports from react or react-dom

If at least one of two checks is positive - propose to install correct dependencies for react, react-dom and dev dependencies for @types/react and @types/react-dom.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the spfx project doctor entry point and trace its existing project checks and dependency suggestions. Confirm the TSX and React/ReactDOM import detection cases and that the proposed runtime and type dependencies match the issue; the command should identify React usage and offer the requested packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.