-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy patheslint.config.ts
More file actions
79 lines (75 loc) · 2.42 KB
/
Copy patheslint.config.ts
File metadata and controls
79 lines (75 loc) · 2.42 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
78
79
import { FlatCompat } from '@eslint/eslintrc';
import { globalIgnores } from 'eslint/config';
const compat: FlatCompat = new FlatCompat({
baseDirectory: import.meta.dirname,
});
const eslintConfig = [
{
ignores: ['.next/**', 'node_modules/**'],
},
globalIgnores(['tailwind.config.ts']),
{
files: ['**/*.{ts,tsx}'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'radix-ui',
message:
'Please import components from @/src/components/ui instead of radix-ui.',
},
],
patterns: ['@radix-ui/*'],
},
],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
pathGroups: [
{
pattern: '@/**',
group: 'internal',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
},
{
files: ['src/components/ui/**/*.{ts,tsx}'],
rules: {
'no-restricted-imports': 'off',
},
},
...compat.config({
extends: [
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'next/core-web-vitals',
'next/typescript',
],
rules: {
'react/display-name': 'error',
'react/no-unescaped-entities': 'error',
'import/no-anonymous-default-export': 'error',
'@next/next/no-page-custom-font': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'react-hooks/exhaustive-deps': 'error',
'prefer-const': 'error',
},
}),
];
export default eslintConfig;