Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 7, 2025

This PR adds ESLint to the project with a modern flat configuration setup and integrates it into the GitHub Actions workflow.

Changes Made

ESLint Setup

  • Added ESLint packages as dev dependencies:
    • eslint - Core linting functionality
    • @typescript-eslint/parser - TypeScript parser for ESLint
    • @typescript-eslint/eslint-plugin - TypeScript-specific linting rules
    • eslint-config-prettier - Ensures compatibility with existing Prettier setup

Configuration Files

  • eslint.config.js - Modern flat config file with:
    • TypeScript-specific configuration for src/**/*.ts files
    • Special handling for test files with Jest globals
    • Prettier compatibility to avoid rule conflicts
    • Sensible defaults that allow console.log (since this is a CLI tool)
  • tsconfig.eslint.json - Extended TypeScript config for ESLint that includes test files

Scripts

Added new npm scripts:

  • lint - Run ESLint on the codebase
  • lint:fix - Run ESLint with automatic fixes

CI Integration

Updated .github/workflows/main.yml to include a linting step that runs after formatting checks and before building.

Code Cleanup

Fixed minor linting issues:

  • Removed unused imports in test files (fs and path in EntityParser.test.ts and MethodParser.test.ts)

Testing

  • All existing tests continue to pass
  • ESLint runs without errors on the entire codebase
  • Full CI workflow (format:check → lint → build → generate → validate → test) completes successfully
  • Both npm run lint and npm run lint:fix work as expected

The ESLint configuration is designed to complement the existing TypeScript strict mode and Prettier setup, providing additional code quality checks without interfering with the current development workflow.

Fixes #17.


💡 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 changed the title [WIP] Add eslint Add ESLint configuration with flat config and integrate into CI workflow Jun 7, 2025
Copilot AI requested a review from abraham June 7, 2025 01:20
Copilot finished work on behalf of abraham June 7, 2025 01:20
@abraham abraham marked this pull request as ready for review June 7, 2025 01:32
@abraham abraham merged commit 97c8e5b into main Jun 7, 2025
1 check passed
@abraham abraham deleted the copilot/fix-17 branch June 7, 2025 01:32
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.

Add eslint

2 participants