mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-15 18:53:06 +00:00
The flat config spread eslint-config-next's subpath imports as if they were flat-config arrays, but that package ships legacy eslintrc configs, so lint crashed before checking any file. Wrap them with FlatCompat (add @eslint/eslintrc) and fix the two pre-existing react/no-unescaped-entities errors so lint passes.
27 lines
817 B
JavaScript
27 lines
817 B
JavaScript
import { dirname } from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
import { FlatCompat } from '@eslint/eslintrc'
|
|
import { globalIgnores } from 'eslint/config'
|
|
import prettier from 'eslint-config-prettier/flat'
|
|
|
|
const __filename = fileURLToPath(import.meta.url)
|
|
const __dirname = dirname(__filename)
|
|
|
|
// eslint-config-next ships legacy (eslintrc) configs, so wrap them with
|
|
// FlatCompat to use them from this flat config with ESLint 9.
|
|
const compat = new FlatCompat({ baseDirectory: __dirname })
|
|
|
|
const eslintConfig = [
|
|
...compat.extends('next/core-web-vitals', 'next/typescript'),
|
|
prettier,
|
|
// Override default ignores of eslint-config-next.
|
|
globalIgnores([
|
|
// Default ignores of eslint-config-next:
|
|
'.next/**',
|
|
'out/**',
|
|
'build/**',
|
|
'next-env.d.ts',
|
|
]),
|
|
]
|
|
|
|
export default eslintConfig
|