Skip to content

Add ESLint configuration and upgrade development tools#3

Merged
electerious merged 3 commits intomainfrom
copilot/fix-e6210b04-f93c-42c0-968e-ec5937c80eb7
Sep 5, 2025
Merged

Add ESLint configuration and upgrade development tools#3
electerious merged 3 commits intomainfrom
copilot/fix-e6210b04-f93c-42c0-968e-ec5937c80eb7

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 5, 2025

This PR modernizes the development tooling by adding ESLint configuration and upgrading the existing prettier setup, along with implementing comprehensive npm scripts for code quality checks.

Changes Made

New Dependencies

  • Added @electerious/eslint-config@^5.2.0 - Provides consistent ESLint rules
  • Added eslint@^9.34.0 - Core ESLint functionality
  • Upgraded @electerious/prettier-config from ^3.0.0 to ^4.0.0

Configuration Files

  • Created eslint.config.js - Exports the Electerious ESLint configuration

Updated npm Scripts

Replaced and added scripts for comprehensive code quality workflow:

{
  "eslint": "eslint \"**/*.js\"",
  "format": "npm run eslint -- --fix && npm run prettier -- --write", 
  "lint": "npm run eslint && npm run prettier -- --check",
  "prettier": "prettier --ignore-path .gitignore \"**/*.{js,json,md,yml}\"",
  "test": "npm run lint && node --test"
}

The start script was preserved as requested.

Code Quality Improvements

Applied ESLint auto-fixes and manual corrections to resolve:

  • Prefer Node.js built-in modules (node:http, node:crypto, etc.)
  • Use Number.isNaN() over global isNaN()
  • Fix regex escaping issues
  • Add missing switch statement default cases
  • Remove unused variables and functions
  • Improve variable destructuring patterns
  • Replace process.exit() with proper error throwing

Compatibility Fixes

  • Replaced Promise.withResolvers() with manual Promise construction for Node.js v20 compatibility
  • Fixed variable declaration patterns to follow ESLint rules

Workflow Impact

The new scripts provide a complete development workflow:

  • npm run lint - Checks code style and quality without making changes
  • npm run format - Automatically fixes all auto-fixable issues
  • npm test - Runs linting + prettier checks + Node.js tests
  • npm run eslint - Runs only ESLint checks
  • npm run prettier - Runs only Prettier checks

All scripts now pass successfully, ensuring consistent code quality across the project.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits September 5, 2025 14:00
Co-authored-by: electerious <499088+electerious@users.noreply.github.com>
Co-authored-by: electerious <499088+electerious@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ESLint and Prettier configuration with updated scripts Add ESLint configuration and upgrade development tools Sep 5, 2025
Copilot AI requested a review from electerious September 5, 2025 14:08
@electerious electerious marked this pull request as ready for review September 5, 2025 14:10
@electerious electerious merged commit 444a3ec into main Sep 5, 2025
21 checks passed
@electerious electerious deleted the copilot/fix-e6210b04-f93c-42c0-968e-ec5937c80eb7 branch September 5, 2025 14:11
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.

2 participants