Skip to content

🐞 tslint-microsoft-contrib missing in dependency chain causing tsline build error when using PNPM (extra work req. for PNPM usage) #2916

@andrewconnell

Description

@andrewconnell

Category

  • Question
  • Typo
  • Bug
  • Additional article idea

Expected or Desired Behavior

Running pnpm install should get all dependencies so when building the project, it builds with no errors.

Observed Behavior

When you run pnpm install, you don't get the tslint-microsoft-contrib package. To get it, you must run pnpm install --shamefully-flatten. This causes a linting error when building:

> gulp build
...
[12:18:50] Error - [tslint] Failed to load /../tslint.json: Could not find custom rule directory: tslint-microsoft-contrib

Ref: https://pnpm.js.org/docs/en/faq.html#pnpm-does-not-work-with-your-project-here

Steps to Reproduce

  • create a new project with the SPFx Yeoman generator: yo @microsoft/genereator --skip-install

  • run pnpm install

  • run gulp build

  • observe linting error listed above

  • use solution 2 from the PNPM FAQ: run pnpm install --shamefully-flatten

    add --force to rebuild the node_modules folder without having to delete it

  • run gulp build

  • observe no tslinting errors

Confirmed in SPFx v1.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:generatorCategory: SharePoint Framework Yeoman generatorarea:spfxCategory: SharePoint Framework (not extensions related)status:trackedCurrently tracked with Microsoft’s internal issue tracking system. DO NOT ADD/REMOVE (MSFT managed)type:bug-confirmedConfirmed bug, not working as designed / expected.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions