-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.mjs
86 lines (84 loc) · 2.06 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
74
75
76
77
78
79
80
81
82
83
84
85
86
import eslint from '@eslint/js';
import stylisticTsPlugin from '@stylistic/eslint-plugin-ts';
import eslintConfigPrettier from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import jestPlugin from 'eslint-plugin-jest';
import tseslint from 'typescript-eslint';
const tsConfig = tseslint.config({
files: ['src/**/*.{ts,tsx}'],
ignores: ['.next'],
extends: [
eslint.configs.recommended,
tseslint.configs.recommended,
importPlugin.flatConfigs.recommended,
eslintConfigPrettier,
],
settings: {
react: {
version: 'detect',
},
'import/resolver': {
typescript: true,
node: true,
},
},
plugins: {
'@stylistic/ts': stylisticTsPlugin,
react: reactPlugin,
'react-hooks': reactHooksPlugin,
jest: jestPlugin
},
languageOptions: {
globals: jestPlugin.environments.globals.globals
},
rules: {
'@stylistic/ts/brace-style': [
'error',
'1tbs',
{
allowSingleLine: true,
},
],
'@typescript-eslint/explicit-function-return-type': 'off',
'@stylistic/ts/func-call-spacing': ['error'],
'@typescript-eslint/member-ordering': ['warn'],
'@typescript-eslint/no-require-imports': ['error'],
'react/no-unused-prop-types': [
'warn',
{
skipShapeProps: true,
},
],
'react-hooks/exhaustive-deps': 'warn',
'array-bracket-spacing': ['warn', 'never'],
'import/order': [
'error',
{
groups: [
'builtin',
'external',
['internal', 'parent'],
['sibling', 'index'],
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'import/no-duplicates': 0,
'max-len': [
'warn',
{
code: 120,
},
],
'no-console': 'warn',
'no-plusplus': 'error',
'object-curly-spacing': ['warn', 'always'],
},
});
export default tsConfig;