Skip to content

chore: update eslint configuration and dependencies#448

Open
Mahmoud-s-Khedr wants to merge 2 commits intocameri:mainfrom
Mahmoud-s-Khedr:security-audit-003
Open

chore: update eslint configuration and dependencies#448
Mahmoud-s-Khedr wants to merge 2 commits intocameri:mainfrom
Mahmoud-s-Khedr:security-audit-003

Conversation

@Mahmoud-s-Khedr
Copy link
Copy Markdown
Contributor

Description

This PR upgrades the project linting stack from ESLint v8 (legacy config) to ESLint v9 (flat config) while preserving current lint behavior.

Changes included:

  • Upgraded lint dependencies:
    • eslint to ^9.39.4
    • @typescript-eslint/eslint-plugin to ^8.58.1
    • @typescript-eslint/parser to ^8.58.1
    • Added @eslint/js and @eslint/eslintrc
  • Migrated ESLint config:
    • Removed legacy .eslintrc.js
    • Removed .eslintignore
    • Added eslint.config.js (flat config) with migrated ignore rules and TypeScript setup
  • Updated npm lint scripts to ESLint v9 style:
    • lint: eslint ./src ./test
    • lint:report: eslint -o .lint-reports/eslint.json -f json ./src ./test
  • Updated package-lock.json to reflect dependency changes

Related Issue

#443

Motivation and Context

ESLint v9 no longer supports .eslintrc.* as the default config path and expects flat config (eslint.config.js).
Without this migration, linting fails under ESLint v9 and blocks local hooks/CI lint steps.

This change modernizes the lint setup and keeps behavior aligned with the existing codebase.

How Has This Been Tested?

Executed locally on Node version from .nvmrc (v24.14.1):

  • npm install
  • npm run lint
  • npm run lint:report
  • npm run build:check

All commands completed successfully after migration.

Types of changes

  • Non-functional change (docs, style, minor refactor)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • All new and existing tests passed.

- Simplified linting commands in package.json
- Updated eslint and related packages to latest versions
- Changed @typescript-eslint packages to a more recent version
@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 10, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​typescript-eslint/​parser@​6.21.0 ⏵ 8.58.1100 +110071 +198100
Updated@​typescript-eslint/​eslint-plugin@​6.21.0 ⏵ 8.58.199 +110080 +198100
Updated@​eslint/​eslintrc@​2.1.4 ⏵ 3.3.599 +110010087100
Updatedeslint@​8.57.1 ⏵ 9.39.489 +1100100 +195 +45100
Updated@​eslint/​js@​8.57.1 ⏵ 9.39.4100100100 +1491100

View full report

Copy link
Copy Markdown

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

Upgrades the project’s lint tooling from ESLint v8 legacy config to ESLint v9 flat config, updating dependencies and npm scripts to keep linting working with ESLint v9’s configuration model.

Changes:

  • Bumped ESLint and TypeScript-ESLint dependencies and added @eslint/js + @eslint/eslintrc.
  • Replaced .eslintrc.js / .eslintignore with a new eslint.config.js flat config (including ignore rules).
  • Updated lint and lint:report scripts to the ESLint v9 invocation style.

Reviewed changes

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

Show a summary per file
File Description
package.json Updates lint scripts and bumps ESLint / TS-ESLint dependencies.
package-lock.json Locks upgraded lint dependency graph for ESLint v9 + TS-ESLint v8.
eslint.config.js Introduces flat config using FlatCompat, and migrates rules/ignores.
.eslintrc.js Removes legacy ESLint config.
.eslintignore Removes legacy ignore file in favor of flat-config ignores.

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

package.json Outdated
Comment on lines +31 to +32
"lint": "eslint ./src ./test",
"lint:report": "eslint -o .lint-reports/eslint.json -f json ./src ./test",
Comment on lines +9 to +20
module.exports = [
{
ignores: ['node_modules', 'dist', '.test-reports', '.coverage', '.nostr', 'tslint.json'],
},
...compat.config({
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
env: {
Comment on lines +24 to +52
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
caughtErrors: 'none',
}],
'@typescript-eslint/no-unused-expressions': 'off',
semi: ['error', 'never'],
quotes: ['error', 'single', { avoidEscape: true }],
'sort-imports': ['error', {
ignoreCase: true,
allowSeparatedGroups: true,
}],
curly: [2, 'multi-line'],
'max-len': [
'error',
{
code: 120,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore',
}],
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@Mahmoud-s-Khedr Can we ensure there's a 1:1 between previous and new?

@cameri
Copy link
Copy Markdown
Owner

cameri commented Apr 10, 2026

Please fix merge conflicts 🙏

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.

3 participants