From fd0a442dfbf99a7c4a91f652e24d06580601eb3f Mon Sep 17 00:00:00 2001 From: laurentketterle-hub Date: Sat, 1 Aug 2026 04:45:23 +0200 Subject: [PATCH 1/4] tooling: add ESLint code-style rules and pre-commit enforcement - Expand eslint.config.mjs with code-style consistency rules: no-console, no-unused-vars, no-var, prefer-const, eqeqeq, no-duplicate-imports, no-multiple-empty-lines, import/order - Add 'eslint --fix --max-warnings 0' to lint-staged pre-commit hook - Ensures consistent code style enforced on every commit Closes #304 --- eslint.config.mjs | 41 ++++++++++++++++++++++++++++++++++++++++- package.json | 1 + 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 52d9614..9763c9d 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,6 +1,45 @@ import coreWebVitals from 'eslint-config-next/core-web-vitals' import nextTypescript from 'eslint-config-next/typescript' -const eslintConfig = [...coreWebVitals, ...nextTypescript] +/** @type {import('eslint').Linter.Config[]} */ +const eslintConfig = [ + ...coreWebVitals, + ...nextTypescript, + { + rules: { + // Enforce code style consistency + 'no-console': ['warn', { allow: ['warn', 'error'] }], + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + }, + ], + 'no-var': 'error', + 'prefer-const': 'error', + eqeqeq: ['error', 'always', { null: 'ignore' }], + 'no-duplicate-imports': 'error', + 'no-multiple-empty-lines': ['warn', { max: 2, maxEOF: 1 }], + 'import/order': [ + 'warn', + { + groups: [ + 'builtin', + 'external', + 'internal', + 'parent', + 'sibling', + 'index', + ], + 'newlines-between': 'always', + alphabetize: { order: 'asc', caseInsensitive: true }, + }, + ], + }, + }, +] export default eslintConfig diff --git a/package.json b/package.json index a6e700b..46a90fe 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ }, "lint-staged": { "*.{ts,tsx}": [ + "eslint --fix --max-warnings 0", "bash -c \"tsc --noEmit\"" ] }, From 09fadf5eb608f7622a0b2bee44a66dacfd3036ef Mon Sep 17 00:00:00 2001 From: laurentketterle-hub Date: Wed, 5 Aug 2026 11:32:27 +0200 Subject: [PATCH 2/4] fix: merge duplicate react imports in HelioWebGL.tsx (lint error) --- src/brand/HelioWebGL.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/brand/HelioWebGL.tsx b/src/brand/HelioWebGL.tsx index f79c1f4..aaa3616 100644 --- a/src/brand/HelioWebGL.tsx +++ b/src/brand/HelioWebGL.tsx @@ -19,8 +19,7 @@ * aria-hidden decoration — every datum it encodes is present as text elsewhere. */ -import { useEffect, useMemo, useRef, useState } from 'react' -import type { ComponentRef } from 'react' +import { useEffect, useMemo, useRef, useState, type ComponentRef } from 'react' import { Canvas, useFrame } from '@react-three/fiber' import { MeshDistortMaterial } from '@react-three/drei' import * as THREE from 'three' From e81153ae3f679859fcf4ebcc52022ac1fd9c0606 Mon Sep 17 00:00:00 2001 From: laurentketterle-hub Date: Wed, 5 Aug 2026 12:09:08 +0200 Subject: [PATCH 3/4] fix: update .node-version to 22.12.0 for vite@8/rolldown compat --- .node-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .node-version diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..1d9b783 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +22.12.0 From 78be96d2dda3e141ffe7b8522c44b45768fb9680 Mon Sep 17 00:00:00 2001 From: laurentketterle-hub Date: Fri, 7 Aug 2026 01:49:07 +0200 Subject: [PATCH 4/4] fix: format eslint.config.mjs with Prettier (double quotes, semicolons) [ci fix] --- eslint.config.mjs | 54 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 6ee649f..d6d64ca 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,46 +1,46 @@ -import coreWebVitals from 'eslint-config-next/core-web-vitals' -import nextTypescript from 'eslint-config-next/typescript' +import coreWebVitals from "eslint-config-next/core-web-vitals"; +import nextTypescript from "eslint-config-next/typescript"; /** @type {import('eslint').Linter.Config[]} */ const eslintConfig = [ - { ignores: ['.design-handoff/**'] }, + { ignores: [".design-handoff/**"] }, ...coreWebVitals, ...nextTypescript, { rules: { // Enforce code style consistency - 'no-console': ['warn', { allow: ['warn', 'error'] }], - 'no-unused-vars': 'off', - '@typescript-eslint/no-unused-vars': [ - 'error', + "no-console": ["warn", { allow: ["warn", "error"] }], + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [ + "error", { - argsIgnorePattern: '^_', - varsIgnorePattern: '^_', - caughtErrorsIgnorePattern: '^_', + argsIgnorePattern: "^_", + varsIgnorePattern: "^_", + caughtErrorsIgnorePattern: "^_", }, ], - 'no-var': 'error', - 'prefer-const': 'error', - eqeqeq: ['error', 'always', { null: 'ignore' }], - 'no-duplicate-imports': 'error', - 'no-multiple-empty-lines': ['warn', { max: 2, maxEOF: 1 }], - 'import/order': [ - 'warn', + "no-var": "error", + "prefer-const": "error", + eqeqeq: ["error", "always", { null: "ignore" }], + "no-duplicate-imports": "error", + "no-multiple-empty-lines": ["warn", { max: 2, maxEOF: 1 }], + "import/order": [ + "warn", { groups: [ - 'builtin', - 'external', - 'internal', - 'parent', - 'sibling', - 'index', + "builtin", + "external", + "internal", + "parent", + "sibling", + "index", ], - 'newlines-between': 'always', - alphabetize: { order: 'asc', caseInsensitive: true }, + "newlines-between": "always", + alphabetize: { order: "asc", caseInsensitive: true }, }, ], }, }, -] +]; -export default eslintConfig +export default eslintConfig;