chore: fix linting errors and ts bugs.

This commit is contained in:
syntaxbullet
2026-06-17 17:41:21 +02:00
parent 3e04a3c7e3
commit 51494e25a8
41 changed files with 285 additions and 251 deletions

View File

@@ -1,17 +1,27 @@
import { dirname } from 'path'
import { fileURLToPath } from 'url'
import { FlatCompat } from '@eslint/eslintrc'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
})
import nextVitals from 'eslint-config-next/core-web-vitals'
import tseslint from 'typescript-eslint'
const eslintConfig = [
...compat.extends('next/core-web-vitals', 'next/typescript'),
...nextVitals,
{
files: ['**/*.{js,jsx,ts,tsx}'],
plugins: {
react: nextVitals[0].plugins.react,
'react-hooks': nextVitals[0].plugins['react-hooks'],
},
rules: {
'react/no-unescaped-entities': 'warn',
'react-hooks/immutability': 'warn',
'react-hooks/refs': 'warn',
'react-hooks/set-state-in-effect': 'warn',
'react-hooks/static-components': 'warn',
},
},
{
files: ['**/*.{ts,tsx,mts,cts}'],
plugins: {
'@typescript-eslint': tseslint.plugin,
},
rules: {
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-empty-object-type': 'warn',