-
Notifications
You must be signed in to change notification settings - Fork 40
Add ESlint and lint action #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
pearmini
commented
Jul 31, 2025
- 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.
There was a problem hiding this 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";
Just slightly curious what the difference is in terms of feature-set between prettier and ESlint? (Do we need both?) |
Sorry, I overlooked the issue, which largely answers my question. (Could we switch to ESlint entirely?) |
@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. |
So you're saying: both tools do something the other lacks, and we're best advised to use them both in tandem - correct? |
Yes, we use Prettier for formatting the code (whitespace management ) and use ESlint to lint the code (comments specifically here). |
Thanks for your explanation, @pearmini! This makes sense to me then. |