Skip to content

Instantly share code, notes, and snippets.

@flyingduck92
Created May 2, 2026 20:36
Show Gist options
  • Select an option

  • Save flyingduck92/05377381e10981f55a42d896962277b3 to your computer and use it in GitHub Desktop.

Select an option

Save flyingduck92/05377381e10981f55a42d896962277b3 to your computer and use it in GitHub Desktop.
customised rules in nextjs for eslint
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,
})
const eslintConfig = [
...compat.extends('next/core-web-vitals', 'next/typescript'),
]
/* customised rules */
eslintConfig.push({
rules: {
'react-hooks/exhaustive-deps': 'off',
'react/jsx-key': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
})
export default eslintConfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment