-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.json
50 lines (48 loc) · 1.36 KB
/
.eslintrc.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import next from 'eslint-plugin-next';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
export default {
root: true,
extends: [
js.configs.recommended,
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:next/core-web-vitals',
],
parser: tsParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
env: {
browser: true,
es2021: true,
node: true,
},
plugins: ['react-hooks', '@typescript-eslint', 'next'],
rules: {
'react/react-in-jsx-scope': 'off', // Not required in Next.js
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'next/no-img-element': 'off', // Allow the use of <img> tags
},
settings: {
react: {
version: 'detect',
},
},
ignorePatterns: ['dist', '.next', 'node_modules'],
};