-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
77 lines (75 loc) · 1.84 KB
/
.eslintrc.js
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
74
75
76
77
const { resolve } = require('node:path')
const project = resolve(process.cwd(), 'tsconfig.json')
const prettierConfig = require('./.prettierrc.js')
module.exports = {
root: true,
env: {
node: true,
browser: true,
es2021: true
},
extends: [
'next',
'prettier',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project,
ecmaVersion: 'latest',
sourceType: 'module'
},
globals: {
React: true,
JSX: true,
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
typescript: {
project,
},
},
},
plugins: [
'@typescript-eslint',
'react',
'react-hooks',
'prettier',
'simple-import-sort',
'import'
],
rules: {
'prettier/prettier': ['error', prettierConfig],
'@next/next/no-html-link-for-pages': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-var-requires': 'off',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-default-export': 'off',
'no-console': ['error', { allow: ['info', 'warn', 'error'] }],
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error',
'react/button-has-type': 'warn',
'react/display-name': 'off',
'react/jsx-sort-props': 'warn',
'react/prop-types': 'off',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
},
ignorePatterns: [
'node_modules/',
'.eslintrc.js',
'.prettierrc.js',
'next.config.js',
'postcss.config.js',
],
}