-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
73 lines (72 loc) · 2.04 KB
/
eslint.config.mjs
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import js from '@eslint/js';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import globals from 'globals';
import nextPlugin from '@next/eslint-plugin-next';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import importPlugin from 'eslint-plugin-import';
import jestPlugin from 'eslint-plugin-jest';
import eslintConfigPrettier from 'eslint-config-prettier';
export default tseslint.config(
{
extends: [
js.configs.recommended,
eslint.configs.recommended,
...tseslint.configs.recommended,
eslintConfigPrettier,
],
languageOptions: {
globals: {
...globals.es2020,
...globals.node,
...globals.browser,
...globals.jest,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: {
'@next/next': nextPlugin,
react: reactPlugin,
'react-hooks': reactHooksPlugin,
import: importPlugin,
jest: jestPlugin,
},
settings: {
react: {
version: 'detect',
},
},
linterOptions: {
reportUnusedDisableDirectives: 'off',
},
rules: {
...nextPlugin.configs.recommended.rules,
...reactHooksPlugin.configs.recommended.rules,
'no-undef': 'error',
curly: 'error',
'object-curly-spacing': ['error', 'always'],
'object-shorthand': ['warn', 'properties'],
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],
'react/react-in-jsx-scope': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'import/namespace': 'warn',
'import/order': [
'error',
{
groups: ['builtin', 'external', ['sibling', 'parent'], 'index'],
},
],
},
},
{
files: ['server/**', 'setupTests.ts'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
{ ignores: ['**/public/**', '**/.next/**', '**/coverage/**'] }
);