eslint / rewrite

Monorepo for the new version of ESLint
Apache License 2.0
65 stars 4 forks source link

ci: build packages in Verify Files job #40

Closed mdjermanovic closed 3 weeks ago

mdjermanovic commented 3 weeks ago

Prerequisites checklist

What is the purpose of this pull request?

Fixes Verify Files job.

In two recent PRs (https://github.com/eslint/rewrite/pull/38 & https://github.com/eslint/rewrite/pull/39), running eslint fails with:

Oops! Something went wrong! :(

ESLint: 9.4.0

Error: Cannot find module '/home/runner/work/rewrite/rewrite/node_modules/@eslint/config-array/dist/cjs/index.cjs'

I believe what happens is the following:

  1. We recently released eslint v9.4.0, which is the first version that uses @eslint/config-array.
  2. npm install here now installs eslint v9.4.0.
  3. Since @eslint/config-array is in this monorepo, and the version satisfies semver range declared in eslint, npm install doesn't install @eslint/config-array from npm in node_modules/eslint/node_modules, but lets eslint use top level node_modules/@eslint/config-array. However, this is a symlink to packages/config-array, which therefore must be built before running eslint.

What changes did you make? (Give an overview)

Added npm run build in the Verify Files job.

Related Issues

Is there anything you'd like reviewers to focus on?