forked from udecode/plate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
115 lines (111 loc) · 2.71 KB
/
.eslintrc.cjs
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
const {
getDefaultIgnorePatterns,
} = require('./config/eslint/helpers/getDefaultIgnorePatterns.cjs');
/** @type {import("eslint").Linter.Config} */
module.exports = {
root: true,
extends: [
'turbo',
'./config/eslint/bases/javascript.cjs',
'./config/eslint/bases/typescript.cjs',
'./config/eslint/bases/regexp.cjs',
'./config/eslint/bases/jest.cjs',
'./config/eslint/bases/react.cjs',
'./config/eslint/bases/tailwind.cjs',
'./config/eslint/bases/rtl.cjs',
'./config/eslint/bases/next.cjs',
'./config/eslint/bases/unicorn.cjs',
'./config/eslint/bases/prettier.cjs',
],
ignorePatterns: [
...getDefaultIgnorePatterns(),
'.next',
'.out',
'**/__registry__',
],
env: {
browser: true,
es6: true,
jest: true,
node: true,
webextensions: false,
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
node: {
moduleDirectory: ['node_modules'],
typescript: {
alwaysTryTypes: true,
},
},
typescript: {},
},
react: { version: 'detect' },
tailwindcss: {
callees: ['cn', 'cva'],
config: 'tailwind.config.cjs',
},
next: {
rootDir: ['apps/www'],
},
},
rules: {},
overrides: [
{
files: ['apps/www/src/**/*'],
extends: ['plugin:@dword-design/import-alias/recommended'],
rules: {
'import/no-relative-packages': 'off',
'@dword-design/import-alias/prefer-alias': [
'warn',
{
alias: {
'@/app': './apps/www/src/app',
'@/plate': './apps/www/src/lib/plate',
'@/components': './apps/www/src/components',
'@/hooks': './apps/www/src/hooks',
'@/__registry__': './apps/www/src/__registry__',
'@/registry': './apps/www/src/registry',
'@/styles': './apps/www/src/styles',
'@/lib': './apps/www/src/lib',
},
},
],
},
},
{
files: ['**/*.spec.*'],
extends: ['./config/eslint/bases/prettier.cjs'],
rules: {
'react/jsx-key': 'off',
'import/no-relative-packages': 'off',
'import/no-unresolved': 'off',
},
},
{
files: ['**/*.test.*', '**/*.spec.*', '**/*.fixture.*'],
env: {
jest: true,
},
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'react-hooks/rules-of-hooks': 'off',
'no-restricted-imports': [
'error',
{
paths: [],
},
],
},
},
{
files: '**/*.mdx',
rules: {
'prettier/prettier': 'off',
},
},
],
};