Skip to content

Comments

Feature/lint#52

Open
interim17 wants to merge 7 commits intomainfrom
feature/lint
Open

Feature/lint#52
interim17 wants to merge 7 commits intomainfrom
feature/lint

Conversation

@interim17
Copy link
Contributor

@interim17 interim17 commented Feb 20, 2026

Added eslint config, based on cell-catalog.

Ran it.

Advances #51

@interim17 interim17 requested a review from Copilot February 20, 2026 21:25
@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for project-idea-board ready!

Name Link
🔨 Latest commit e9c54ef
🔍 Latest deploy log https://app.netlify.com/projects/project-idea-board/deploys/699cc89f6458c30008cd131d
😎 Deploy Preview https://deploy-preview-52--project-idea-board.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

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 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-keys plugin
  • Alphabetically sorted destructured parameters across all components and templates
  • Removed unused imports and simplified type annotations
  • Added a ChildImageSharp type 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.

frontmatter: {
title: string;
image: any; // Replace `any` with a more specific type if possible
// @eslint-disable-next-line @typescript-eslint/no-explicit-any
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
}

interface IndexPageTemplateProps {
// @eslint-disable-next-line @typescript-eslint/no-explicit-any
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment on lines +5 to +7
import { defineConfig } from "eslint/config";

export default defineConfig([
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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[].

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong

Comment on lines 56 to 73
"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"
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs say thats not necessary for eslint 9+

Copy link
Contributor

@jessicasyu jessicasyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like mostly reordering or dropping unused parameters?

@interim17
Copy link
Contributor Author

Looks like mostly reordering or dropping unused parameters?

Yep :)

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