OfficeDev / OfficeDev/Office-Addin-Scripts

office-addin-lint fails with "TypeError: expand is not a function" when repository uses brace-expansion resolution override

Open
#1,013 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs triage
Dominant language
TypeScript
Stars
194
Forks
117
Avg merge
1d 32m
Merged PRs (30d)
2

Description

Prerequisites

  • I am running the latest version of Node and the tools
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Expected behavior

office-addin-lint should run successfully (or fail with normal lint violations) when project dependencies are pinned for security remediation via Yarn resolutions.

Specifically, adding a brace-expansion override to address vulnerabilities should not cause runtime crashes in lint commands.

Current behavior

When a brace-expansion override is added in package.json resolutions, office-addin-lint crashes during lint:fix with:

TypeError: expand is not a function

This blocks local lint and pre-commit flows.

Steps to Reproduce

  1. In a project using office-addin-lint, add this to package.json:
    {
      "resolutions": {
        "brace-expansion": "^5.0.8"
      }
    }
    
    
  2. Run
        yarn install
        yarn lint:fix
    
  3. Observe runtime error from minimatch / brace-expansion: TypeError: expand is not a function

Context

Operating System: Linux
Tool version:
office-addin-lint: ^2.2.3 (also observed while testing newer ^3.0.10)
Yarn: 1.22.x

Failure Logs

$ node_modules/.bin/office-addin-lint fix --files integrations///*.{ts,tsx,js,jsx}

Oops! Something went wrong! :(

ESLint: 9.39.5

TypeError: expand is not a function
at Minimatch.braceExpand (.../node_modules/minimatch/minimatch.js:271:10)
at Minimatch.make (.../node_modules/minimatch/minimatch.js:180:33)
at new Minimatch (.../node_modules/minimatch/minimatch.js:156:8)
at .../node_modules/office-addin-lint/node_modules/eslint/lib/eslint/eslint-helpers.js:288:10
at Array.map ()
at globSearch (.../eslint-helpers.js:283:28)
at .../eslint-helpers.js:457:4
at Array.map ()
at globMultiSearch (.../eslint-helpers.js:456:22)
at findFiles (.../eslint-helpers.js:629:3)

error Command failed with exit code 2.

Contributor guide

No contributing guide indexed for this repository

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

Reproduce the failure with office-addin-lint fix --files integrations///*.{ts,tsx,js,jsx} after applying the package.json Yarn resolutions override. Start with the minimatch and brace-expansion versions in the installed office-addin-lint dependency tree, then verify that yarn lint:fix completes without a runtime crash and still reports normal lint violations.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.