-
-
Notifications
You must be signed in to change notification settings - Fork 756
/
.eslintrc.cjs
127 lines (123 loc) · 3.09 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
116
117
118
119
120
121
122
123
124
125
126
127
const { filePatterns } = require('./config/eslint/constants/file-patterns.cjs');
const {
getDefaultIgnorePatterns,
} = require('./config/eslint/helpers/getDefaultIgnorePatterns.cjs');
/** @type {import('eslint').Linter.Config} */
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
node: true,
webextensions: false,
},
extends: [
'turbo',
'./config/eslint/bases/typescript.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/perfectionist.cjs',
'./config/eslint/bases/prettier.cjs',
],
ignorePatterns: [
...getDefaultIgnorePatterns(),
'.next',
'.out',
'**/*.mdx',
'**/__registry__',
'**/scripts/*.mts',
],
overrides: [
{
files: ['**/registry/default/**/*'],
rules: {
'jsx-a11y/iframe-has-title': 'off',
'jsx-a11y/media-has-caption': 'off',
'react/jsx-no-comment-textnodes': 'off',
},
},
{
files: ['*.ts', '*.tsx', '*.mts'],
parserOptions: {
project: true,
},
},
// {
// extends: ['plugin:@dword-design/import-alias/recommended'],
// files: ['apps/www/src/**/*'],
// rules: {
// '@dword-design/import-alias/prefer-alias': [
// 'warn',
// {
// alias: {
// '@/__registry__': './apps/www/src/__registry__',
// '@/app': './apps/www/src/app',
// '@/components': './apps/www/src/components',
// '@/hooks': './apps/www/src/hooks',
// '@/lib': './apps/www/src/lib',
// '@/plate': './apps/www/src/lib/plate',
// '@/registry': './apps/www/src/registry',
// '@/styles': './apps/www/src/styles',
// },
// },
// ],
// 'import/no-relative-packages': 'off',
// },
// },
{
files: filePatterns.test,
rules: {
'import/no-relative-packages': 'off',
'import/no-unresolved': 'off',
'react/jsx-key': 'off',
},
},
{
env: {
jest: true,
},
files: filePatterns.test,
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'no-restricted-imports': [
'error',
{
paths: [],
},
],
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: ['index.ts', '**/*.mdx'],
rules: {
'prettier/prettier': 'off',
},
},
],
parser: '@typescript-eslint/parser',
root: true,
rules: {},
settings: {
// 'import/parsers': {
// '@typescript-eslint/parser': ['.ts', '.tsx'],
// },
// 'import/resolver': {
// node: {
// moduleDirectory: ['node_modules'],
// typescript: {
// alwaysTryTypes: true,
// },
// },
// typescript: {},
// },
next: {
rootDir: ['apps/www'],
},
react: { version: 'detect' },
},
};