Created
May 2, 2026 20:36
-
-
Save flyingduck92/05377381e10981f55a42d896962277b3 to your computer and use it in GitHub Desktop.
customised rules in nextjs for eslint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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