Skip to content

Conversation

pearmini
Copy link
Member

#266

  • Add ESlint to support lint comments with these two rules: spaced-comment, capitalized-comments
  • Set up a GitHub Action to run on every pull request to automatically check formatting and linting.

@pearmini pearmini requested a review from Copilot July 31, 2025 11:55
Copy link

@Copilot 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 adds ESLint configuration and CI automation to enforce code linting standards. The changes introduce two specific ESLint rules for comment formatting (spaced-comment and capitalized-comments) and establish automated checking through GitHub Actions.

  • Configures ESLint with comment formatting rules and Prettier integration
  • Sets up automated linting checks via GitHub Actions on every pull request
  • Updates package.json scripts to support linting and auto-fixing

Reviewed Changes

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

File Description
package.json Adds ESLint dependencies and updates npm scripts for linting
eslint.config.mjs Creates ESLint configuration with comment rules and Prettier integration
.prettierrc Establishes Prettier formatting configuration
.github/workflows/ci.yml Sets up GitHub Actions workflow for automated linting on PRs
Comments suppressed due to low confidence (1)

eslint.config.mjs:2

  • The import path "eslint/config" does not exist in ESLint. The defineConfig function is not available from this path. You can remove this import as it's not needed for the flat config format.
import { defineConfig } from "eslint/config";

@shiffman
Copy link
Member

This looks great to me! The question is when we should merge? Should we before finishing #248 and #257 so that it can be applied to those PRs or wait until after?

@gohai
Copy link
Member

gohai commented Jul 31, 2025

Just slightly curious what the difference is in terms of feature-set between prettier and ESlint? (Do we need both?)

@gohai
Copy link
Member

gohai commented Jul 31, 2025

Sorry, I overlooked the issue, which largely answers my question. (Could we switch to ESlint entirely?)

@pearmini
Copy link
Member Author

pearmini commented Aug 7, 2025

@gohai We can fully switch to ESLint, but this requires additional configuration. Starting from ESLint v9, the ESLint team deprecated formatting and stylistic rules from the core due to high maintenance costs. Although a set of formatting rules is still maintained by the community, it’s generally easier to use Prettier as an out-of-the-box formatter.

@gohai
Copy link
Member

gohai commented Aug 8, 2025

So you're saying: both tools do something the other lacks, and we're best advised to use them both in tandem - correct?

@pearmini
Copy link
Member Author

pearmini commented Aug 8, 2025

Yes, we use Prettier for formatting the code (whitespace management ) and use ESlint to lint the code (comments specifically here).

@gohai
Copy link
Member

gohai commented Aug 8, 2025

Thanks for your explanation, @pearmini! This makes sense to me then.

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