Conversation
✅ Deploy Preview for project-idea-board ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR adds ESLint configuration to the project based on the cell-catalog repository and applies automatic linting fixes throughout the codebase. The changes enforce consistent code style, particularly around destructured parameter ordering.
Changes:
- Added ESLint 9.x configuration with TypeScript support and the
sort-destructure-keysplugin - Alphabetically sorted destructured parameters across all components and templates
- Removed unused imports and simplified type annotations
- Added a
ChildImageSharptype to improve type safety
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
eslint.config.mts |
New ESLint flat config with TypeScript rules and destructure-keys sorting |
eslint-plugin-sort-destructure-keys.d.ts |
Type declaration for the sort-destructure-keys plugin |
package.json |
Added ESLint dependencies and lint script |
yarn.lock |
Updated with new ESLint-related packages |
src/types/index.ts |
Added ChildImageSharp interface for better type safety |
src/templates/*.tsx |
Alphabetically sorted destructured parameters and removed unused ones |
src/components/*.tsx |
Alphabetically sorted destructured parameters, removed unused imports, improved types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/templates/index-page.tsx
Outdated
| frontmatter: { | ||
| title: string; | ||
| image: any; // Replace `any` with a more specific type if possible | ||
| // @eslint-disable-next-line @typescript-eslint/no-explicit-any |
There was a problem hiding this comment.
The ESLint disable comment has incorrect syntax. The correct syntax is // eslint-disable-next-line (without the @ prefix). The @ symbol is only used in the rule name itself (e.g., @typescript-eslint/no-explicit-any).
src/templates/index-page.tsx
Outdated
| } | ||
|
|
||
| interface IndexPageTemplateProps { | ||
| // @eslint-disable-next-line @typescript-eslint/no-explicit-any |
There was a problem hiding this comment.
The ESLint disable comment has incorrect syntax. The correct syntax is // eslint-disable-next-line (without the @ prefix). The @ symbol is only used in the rule name itself (e.g., @typescript-eslint/no-explicit-any).
| import { defineConfig } from "eslint/config"; | ||
|
|
||
| export default defineConfig([ |
There was a problem hiding this comment.
The import defineConfig from "eslint/config" is not a valid ESLint export. ESLint 9.x uses a flat config format that doesn't require a defineConfig helper. You can either remove this import and export the array directly, or if you need type safety, use import type { Linter } from 'eslint' and type the config as Linter.Config[].
| "devDependencies": { | ||
| "@eslint/js": "^10.0.1", | ||
| "@types/antd": "^1.0.0", | ||
| "@types/node": "^20.11.20", | ||
| "@types/react": "^18.2.59", | ||
| "@types/react-dom": "^18.2.19", | ||
| "@types/react-helmet": "^6.1.11", | ||
| "concurrently": "^9.2.1", | ||
| "eslint": "^9.38.0", | ||
| "eslint-plugin-sort-destructure-keys": "^3.0.0", | ||
| "gatsby-plugin-postcss": "^6.13.1", | ||
| "jiti": "^2.6.1", | ||
| "netlify-cli": "^17.15.7", | ||
| "postcss": "^8.4.35", | ||
| "prettier": "^2.0.5", | ||
| "typescript": "^5.3.3", | ||
| "typescript-eslint": "^8.56.0", | ||
| "typescript-plugin-css-modules": "^5.1.0" |
There was a problem hiding this comment.
The globals package is imported in eslint.config.mts but is not listed in the devDependencies of package.json. While it may be available as a transitive dependency through @eslint/eslintrc, it's better to explicitly declare it as a direct dependency since you're importing it directly. Add "globals": "^14.0.0" to the devDependencies.
There was a problem hiding this comment.
docs say thats not necessary for eslint 9+
jessicasyu
left a comment
There was a problem hiding this comment.
Looks like mostly reordering or dropping unused parameters?
Yep :) |
Added eslint config, based on cell-catalog.
Ran it.
Advances #51