Skip to content

Fix ESLint flat config flag, tsconfig moduleResolution, scripts dependency drift, and CI lint workflow#72

Open
Copilot wants to merge 4 commits intomainfrom
copilot/fix-eslint-flat-config-issues
Open

Fix ESLint flat config flag, tsconfig moduleResolution, scripts dependency drift, and CI lint workflow#72
Copilot wants to merge 4 commits intomainfrom
copilot/fix-eslint-flat-config-issues

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

Four config correctness issues: ESLint --ext flag breaks under flat config (ESLint 9+), moduleResolution is mismatched for an ESM+bundler project, scripts/package.json has stale dependency versions, and the CI lint workflow was still invoking ESLint with the incompatible --ext flag directly.

Changes

  • package.json — Remove --ext .js,.ts,.jsx,.tsx from lint and lint:fix scripts; flag is unsupported in flat config mode and redundant since eslint.config.js already scopes via files
  • tsconfig.jsonmoduleResolution: nodebundler; correct resolver for ESM projects using esbuild
  • scripts/package.json — Align openai (^6.17.0^6.18.0) and @types/node (^25.1.0^25.2.1) to match root package.json
  • .github/workflows/lint.yml — Replace npx eslint . --ext .js,.ts,.jsx,.tsx --max-warnings 0 with npm run lint -- --max-warnings 0 so the CI job delegates to the fixed npm script and remains compatible with ESLint 9 flat config
  • scripts/package-lock.json — Regenerated to reflect updated openai (^6.18.0) and @types/node (^25.2.1) ranges, keeping npm ci in scripts/ deterministic and consistent
Original prompt

Summary

This PR addresses critical and high-priority issues found during a repository audit.

Issues to Fix

1. 🔴 ESLint --ext flag incompatible with flat config (Critical)

The lint and lint:fix scripts in the root package.json use the --ext flag, which is not supported in ESLint's flat config mode (ESLint 9+). The repo already uses flat config format in eslint.config.js, so these scripts will fail.

In package.json, change:

"lint": "eslint . --ext .js,.ts,.jsx,.tsx",
"lint:fix": "eslint . --ext .js,.ts,.jsx,.tsx --fix"

To:

"lint": "eslint .",
"lint:fix": "eslint . --fix"

The flat config in eslint.config.js already specifies files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], so the --ext flag is redundant and breaking.

2. 🟡 tsconfig.json – Modernize moduleResolution

The project uses "type": "module" (ESM) but tsconfig.json has "moduleResolution": "node" which is the legacy resolver.

In tsconfig.json, change:

"moduleResolution": "node"

To:

"moduleResolution": "bundler"

This is the recommended setting for modern ESM projects that use bundlers (esbuild, etc.).

3. 🟡 scripts/package.json – Version drift from root

The scripts/package.json has older dependency versions compared to root package.json:

  • openai: ^6.17.0 → should be ^6.18.0 (matching root)
  • @types/node: ^25.1.0 → should be ^25.2.1 (matching root)

In scripts/package.json, update:

"dependencies": {
    "openai": "^6.18.0"
},
"devDependencies": {
    "@types/node": "^25.2.1",
    "ts-node": "^10.9.2",
    "typescript": "^5.7.0",
    "tsx": "^4.21.0"
}

Files to Modify

  1. package.json – Fix lint and lint:fix scripts (remove --ext flag)
  2. tsconfig.json – Change moduleResolution from "node" to "bundler"
  3. scripts/package.json – Align openai to ^6.18.0 and @types/node to ^25.2.1

Important Notes

  • Do NOT change any other fields in these files
  • Preserve all existing formatting (2-space indentation, trailing newlines)
  • These are minimal, targeted fixes — no new dependencies or structural changes

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix ESLint scripts for flat configuration compatibility Fix ESLint flat config flag, tsconfig moduleResolution, and scripts dependency drift Feb 23, 2026
Copilot AI requested a review from SolanaRemix February 23, 2026 06:13
@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
npm/@types/node 25.3.3 🟢 6.6
Details
CheckScoreReason
Packaging⚠️ -1packaging workflow not detected
Code-Review🟢 9Found 27/30 approved changesets -- score normalized to 9
Maintained🟢 1030 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Security-Policy🟢 10security policy file detected
License🟢 9license file detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Binary-Artifacts🟢 10no binaries found in the repo
Fuzzing⚠️ 0project is not fuzzed
npm/openai 6.25.0 UnknownUnknown
npm/undici-types 7.18.2 🟢 8.3
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 18 issue activity found in the last 90 days -- score normalized to 10
Code-Review🟢 10all changesets reviewed
Security-Policy🟢 9security policy file detected
Dependency-Update-Tool🟢 10update tool detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Binary-Artifacts🟢 8binaries present in source code
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies🟢 4dependency not pinned by hash detected -- score normalized to 4
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Signed-Releases⚠️ -1no releases found
Vulnerabilities🟢 100 existing vulnerabilities detected
Packaging🟢 10packaging workflow detected
License🟢 10license file detected
SAST🟢 9SAST tool detected but not run on all commits
Fuzzing🟢 10project is fuzzed
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
CI-Tests🟢 1030 out of 30 merged PRs checked by a CI test -- score normalized to 10
Contributors🟢 10project has 80 contributing companies or organizations

Scanned Files

  • scripts/package-lock.json

@github-actions
Copy link
Contributor

🤖 Auto-Test Results

Check Status
Linting ✅ Passed
Build ✅ Passed
Tests ✅ Passed
Config Sync ✅ Validated
Environment ✅ Healthy

Automated checks completed at 2026-02-23T09:56:40.763Z

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes three configuration correctness issues related to ESLint flat config compatibility, TypeScript module resolution, and dependency version drift. The changes ensure the project's tooling configuration is consistent and uses modern best practices for an ESM-based project with bundler tooling.

Changes:

  • Remove deprecated --ext flag from ESLint commands (incompatible with ESLint 9+ flat config)
  • Update TypeScript moduleResolution from node to bundler (correct for ESM + bundler projects)
  • Sync scripts/package.json dependency versions with root package.json

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
package.json Remove --ext .js,.ts,.jsx,.tsx flag from lint scripts (unsupported in ESLint 9+ flat config)
tsconfig.json Change moduleResolution from node to bundler (correct for ESM projects using esbuild)
scripts/package.json Update openai to ^6.18.0 and @types/node to ^25.2.1 to match root package.json versions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

package.json Outdated
Comment on lines +20 to +21
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

The CI workflow still invokes ESLint with --ext (see .github/workflows/lint.yml), so even though npm run lint is fixed here, PR builds will continue to fail under ESLint flat config. Update the workflow to drop --ext (or switch it to npm run lint plus --max-warnings 0).

Copilot uses AI. Check for mistakes.
Copy link
Owner

Choose a reason for hiding this comment

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

@copilot apply changes based on feedback

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in b3ff9a5. Changed the ESLint step in .github/workflows/lint.yml from npx eslint . --ext .js,.ts,.jsx,.tsx --max-warnings 0 to npm run lint -- --max-warnings 0, delegating to the npm script (which already drops --ext) while preserving the CI zero-warnings enforcement.

Comment on lines 3 to +7
"dependencies": {
"openai": "^6.17.0"
"openai": "^6.18.0"
},
"devDependencies": {
"@types/node": "^25.1.0",
"@types/node": "^25.2.1",
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

scripts/package.json dependency versions were updated, but scripts/package-lock.json still pins the previous openai and @types/node ranges. Please regenerate/update the scripts lockfile so npm ci in scripts/ stays deterministic and consistent with this change.

Copilot uses AI. Check for mistakes.
Copy link
Owner

Choose a reason for hiding this comment

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

@copilot apply changes based on feedback

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in b3ff9a5. Ran npm install in the scripts/ directory to regenerate scripts/package-lock.json. The lockfile now reflects openai: ^6.18.0 (resolved to 6.25.0) and @types/node: ^25.2.1 (resolved to 25.3.3), consistent with the updated scripts/package.json.

Copilot AI changed the title Fix ESLint flat config flag, tsconfig moduleResolution, and scripts dependency drift Fix ESLint flat config flag, tsconfig moduleResolution, scripts dependency drift, and CI lint workflow Mar 2, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • scripts/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4 to 8
"openai": "^6.18.0"
},
"devDependencies": {
"@types/node": "^25.1.0",
"@types/node": "^25.2.1",
"ts-node": "^10.9.2",
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

This dependency bump changes scripts/package.json, but scripts/package-lock.json still pins openai and @types/node to the previous ranges/versions. Please regenerate/update the scripts lockfile so npm ci in scripts/ remains deterministic and consistent with the updated manifest.

Copilot uses AI. Check for mistakes.
Copy link
Owner

Choose a reason for hiding this comment

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

@copilot apply changes based on feedback

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already addressed in b3ff9a5. scripts/package-lock.json was regenerated via npm install in the scripts/ directory and now reflects openai: ^6.18.0 and @types/node: ^25.2.1.

Co-authored-by: Copilot <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

🤖 Auto-Test Results

Check Status
Linting ✅ Passed
Build ✅ Passed
Tests ✅ Passed
Config Sync ✅ Validated
Environment ✅ Healthy

Automated checks completed at 2026-03-02T09:15:35.779Z

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

🤖 Auto-Test Results

Check Status
Linting ✅ Passed
Build ✅ Passed
Tests ✅ Passed
Config Sync ✅ Validated
Environment ✅ Healthy

Automated checks completed at 2026-03-02T09:16:06.881Z

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • scripts/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +20 to +21
"lint": "eslint . --max-warnings 0",
"lint:fix": "eslint . --fix",
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The PR description says lint should become eslint . (and CI would pass --max-warnings 0 when needed), but this change hard-codes --max-warnings 0 into the lint script. Decide where warnings should be enforced (script vs CI) and keep it consistent; otherwise this is a behavior change for all local runs and other workflows that call npm run lint (e.g. CI/advanced-build).

Copilot uses AI. Check for mistakes.

- name: Run ESLint
run: npx eslint . --ext .js,.ts,.jsx,.tsx --max-warnings 0
run: npm run lint -- --max-warnings 0
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

This now runs npm run lint while also passing --max-warnings 0, but the lint script itself already includes --max-warnings 0. Dropping the extra CLI args (or removing it from the script instead) avoids duplicating flags and reduces the risk of ESLint rejecting/overriding repeated options.

Suggested change
run: npm run lint -- --max-warnings 0
run: npm run lint

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants