-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
77 lines (74 loc) · 2.04 KB
/
Copy patheslint.config.js
File metadata and controls
77 lines (74 loc) · 2.04 KB
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
import eslint from '@eslint/js';
import stylisticPlugin from '@stylistic/eslint-plugin';
import eslintConfigPrettier from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import-x';
import reactPlugin from '@eslint-react/eslint-plugin';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import vitestGlobals from 'eslint-config-vitest-globals/flat';
import tseslint from 'typescript-eslint';
const tsConfig = tseslint.config({
files: ['lib/**/*.{ts,tsx}', 'src/**/*.{ts,tsx}'],
ignores: ['dist', 'node_modules'],
extends: [
eslint.configs.recommended,
tseslint.configs.recommended,
importPlugin.flatConfigs.recommended,
eslintConfigPrettier,
],
settings: {
react: {
version: 'detect',
},
'import/resolver': {
typescript: true,
node: true,
},
},
plugins: {
'@stylistic': stylisticPlugin,
react: reactPlugin,
'react-hooks': reactHooksPlugin,
},
rules: {
'@stylistic/brace-style': [
'error',
'1tbs',
{
allowSingleLine: true,
},
],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/member-ordering': ['warn'],
'@typescript-eslint/no-require-imports': ['error'],
'react-hooks/exhaustive-deps': 'warn',
'array-bracket-spacing': ['warn', 'never'],
'import-x/order': [
'error',
{
groups: ['builtin', 'external', ['internal', 'parent'], ['sibling', 'index']],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'import-x/no-duplicates': 0,
'import-x/no-named-as-default-member': 0,
'import-x/no-unresolved': 0,
'max-len': [
'warn',
{
code: 120,
},
],
'no-console': 'warn',
'no-plusplus': 'error',
'object-curly-spacing': ['warn', 'always'],
},
});
const testConfig = tseslint.config({
files: ['**/*.test.{ts,tsx}', 'lib/__tests__/**/*.{ts,tsx}'],
extends: [vitestGlobals()],
});
export default [...tsConfig, ...testConfig];