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 diff --git a/eslint.config.mjs b/eslint.config.mjs index d358a53..d6d64ca 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,6 +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"; -const eslintConfig = [{ ignores: ['.design-handoff/**'] }, ...coreWebVitals, ...nextTypescript] +/** @type {import('eslint').Linter.Config[]} */ +const eslintConfig = [ + { 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", + { + 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 +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\"" ] }, 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'