Skip to content

CC-78: Migrate Game Systems to Shared ESLint Config#8

Merged
ianpaschal merged 3 commits into
mainfrom
ian/cc-78-migrate-game-systems-to-shared-eslint-config
Jun 5, 2026
Merged

CC-78: Migrate Game Systems to Shared ESLint Config#8
ianpaschal merged 3 commits into
mainfrom
ian/cc-78-migrate-game-systems-to-shared-eslint-config

Conversation

@ianpaschal

@ianpaschal ianpaschal commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Resolves CC-78

Summary by CodeRabbit

  • Chores

    • Migrated ESLint configuration to the latest flat config format
    • Updated ESLint tooling and dependencies to newer versions
    • Reformatted import statements across the codebase for consistency
    • Enhanced CI/CD workflow to include Node.js setup and dependency installation
    • Adjusted code formatting and whitespace throughout the project
  • Tests

    • Removed unnecessary ESLint suppressions in test files

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9266c7c0-ec01-48ac-8a55-fcb029b2e303

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

This PR migrates the repository's ESLint configuration from the legacy CommonJS format (.eslintrc.cjs) to the modern flat config format (eslint.config.mjs). ESLint is upgraded to v9.0.0 with updated dependencies from @ianpaschal/eslint-config. The lint script and package dependencies are updated accordingly. Code across the repository is reformatted with multi-line import statements and strategic whitespace adjustments to comply with the new configuration rules. GitHub Actions CI workflows are enhanced to explicitly set up Node.js v20 and inject the NPM_TOKEN secret during dependency installation across lint, test, and build jobs.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: migrating the project from a local ESLint configuration to a shared ESLint config package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ian/cc-78-migrate-game-systems-to-shared-eslint-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 21-24: Replace the npm install invocations in the CI job steps for
the lint, test, and build jobs with npm ci to ensure deterministic installs;
locate the steps labeled "Install dependencies" in the lint, test and build jobs
and change the run command from "npm install" to "npm ci" while preserving the
existing NPM_TOKEN: ${{ secrets.NPM_TOKEN }} env block.
- Around line 17-19: Update each job that uses actions/setup-node@v4 to pin the
action to the specific commit SHA (replace uses: actions/setup-node@v4 with
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020) in the lint,
test and build jobs, and replace any npm install invocations with npm ci to
ensure deterministic installs; verify node-version: '20' remains unchanged and
run a quick workflow lint to validate the YAML.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c1ec7391-44e1-4fc2-b332-ebf5b1196cc8

📥 Commits

Reviewing files that changed from the base of the PR and between cb91845 and dc12cc9.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (18)
  • .eslintrc.cjs
  • .github/workflows/ci.yml
  • eslint.config.mjs
  • package.json
  • src/battlefront/_shared/helpers/calculateMatchResultDetails.test.ts
  • src/battlefront/_shared/schema/listData.test.ts
  • src/battlefront/_shared/schema/listData.validators.ts
  • src/battlefront/flamesOfWarV4/schema/gameSystemConfig.ts
  • src/battlefront/flamesOfWarV4/schema/registrationDetails.ts
  • src/battlefront/flamesOfWarV4/static/lessonsFromTheFrontVersions.ts
  • src/battlefront/flamesOfWarV4/static/missionPackUtils.ts
  • src/battlefront/greatWarV4/schema/gameSystemConfig.ts
  • src/battlefront/greatWarV4/static/missionPackUtils.ts
  • src/battlefront/teamYankeeV2/schema/gameSystemConfig.ts
  • src/battlefront/teamYankeeV2/schema/registrationDetails.ts
  • src/battlefront/teamYankeeV2/static/fieldManual101Versions.ts
  • src/battlefront/teamYankeeV2/static/missionPackUtils.ts
  • src/common/static/tournamentPairingMethods.ts
💤 Files with no reviewable changes (1)
  • .eslintrc.cjs

Comment thread .github/workflows/ci.yml
Comment on lines 17 to 19
uses: actions/setup-node@v4
with:
node-version: '20'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read-only verification: resolve the current commit behind setup-node v4 tag
gh api repos/actions/setup-node/git/ref/tags/v4 --jq '.object.sha'

Repository: ianpaschal/combat-command-game-systems

Length of output: 123


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show the relevant workflow portions around the referenced lines
nl -ba .github/workflows/ci.yml | sed -n '1,140p'

Repository: ianpaschal/combat-command-game-systems

Length of output: 125


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/ci.yml"

echo "=== file head ==="
cat -n "$FILE" | head -n 120

echo "=== grep setup-node usages ==="
rg -n "uses:\s*actions/setup-node@v4" "$FILE" || true

echo "=== grep npm install ==="
rg -n "npm\s+install" "$FILE" || true

echo "=== grep NPM_TOKEN env usage ==="
rg -n "NPM_TOKEN" "$FILE" || true

Repository: ianpaschal/combat-command-game-systems

Length of output: 2344


🏁 Script executed:

#!/bin/bash
set -euo pipefail

ls -la
test -f package-lock.json && echo "FOUND package-lock.json" || echo "NO package-lock.json"
test -f npm-shrinkwrap.json && echo "FOUND npm-shrinkwrap.json" || echo "NO npm-shrinkwrap.json"

Repository: ianpaschal/combat-command-game-systems

Length of output: 1352


🏁 Script executed:

#!/bin/bash
set -euo pipefail

ls -la .npmrc || echo "NO .npmrc"
rg -n "NPM_TOKEN" .npmrc ./* 2>/dev/null || true

Repository: ianpaschal/combat-command-game-systems

Length of output: 267


Pin actions/setup-node to a full commit SHA.

actions/setup-node@v4 resolves to 49933ea5288caeca8642d1e84afbd3f7d6820020; pin this SHA to prevent tag-movement supply-chain risk. Update all three jobs (lint, test, build) where uses: actions/setup-node@v4 appears.

Also switch npm installnpm ci for deterministic installs (a package-lock.json is present).

🧰 Tools
🪛 zizmor (1.25.2)

[error] 17-17: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 17 - 19, Update each job that uses
actions/setup-node@v4 to pin the action to the specific commit SHA (replace
uses: actions/setup-node@v4 with uses:
actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020) in the lint, test
and build jobs, and replace any npm install invocations with npm ci to ensure
deterministic installs; verify node-version: '20' remains unchanged and run a
quick workflow lint to validate the YAML.

Comment thread .github/workflows/ci.yml
Comment on lines 21 to +24
- name: Install dependencies
run: npm install

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/ci.yml"
echo "== File = $FILE =="
ls -la "$FILE" || true
echo

# Show the referenced region with line numbers
nl -ba "$FILE" | sed -n '1,120p'

# Specifically extract any npm install commands
echo
echo "== Any npm install usages in $FILE =="
rg -n --context 2 "npm (install|ci)\b" "$FILE" || true

# Also check if package-lock.json exists (npm ci requires it)
echo
echo "== Check for package-lock.json =="
ls -ლა package-lock.json 2>/dev/null || true
ls -la . | head

Repository: ianpaschal/combat-command-game-systems

Length of output: 257


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE=".github/workflows/ci.yml"
echo "== File = $FILE =="
ls -la "$FILE" || true
echo

# Show the beginning portion with line numbers (no `nl` available)
echo "== $FILE (lines 1-120) =="
cat -n "$FILE" | sed -n '1,120p'

echo
echo "== Any npm (install|ci) usages in $FILE =="
rg -n --context 2 "npm (install|ci)\b" "$FILE" || true

echo
echo "== Check for package-lock.json (required for npm ci) =="
ls -la package-lock.json 2>/dev/null || echo "package-lock.json not found"
ls -la . | head -n 20

Repository: ianpaschal/combat-command-game-systems

Length of output: 3864


Use npm ci instead of npm install in CI jobs

Replace npm install with npm ci in the lint, test, and build jobs.

Suggested change
-      run: npm install
+      run: npm ci

Update the same run: line at Lines 21, 40, and 64 (keep the existing NPM_TOKEN env block).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 21 - 24, Replace the npm install
invocations in the CI job steps for the lint, test, and build jobs with npm ci
to ensure deterministic installs; locate the steps labeled "Install
dependencies" in the lint, test and build jobs and change the run command from
"npm install" to "npm ci" while preserving the existing NPM_TOKEN: ${{
secrets.NPM_TOKEN }} env block.

@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ianpaschal
ianpaschal merged commit d779f11 into main Jun 5, 2026
8 checks passed
@ianpaschal
ianpaschal deleted the ian/cc-78-migrate-game-systems-to-shared-eslint-config branch June 5, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant