-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
153 lines (153 loc) · 4.6 KB
/
.eslintrc.js
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/**
* @type {import("eslint").Linter.Config}
*/
module.exports = {
root: true,
extends: [
"prettier",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/strict",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:vitest/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:tailwindcss/recommended",
"plugin:@next/next/recommended",
],
plugins: ["deprecation", "import", "eslint-plugin-tailwindcss"],
env: {
browser: true,
es2021: true,
},
settings: {
react: {
version: "^18.2.0",
},
settings: {
next: {
rootDir: "packages/docs-bundle/",
},
},
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: "module",
project: ["./tsconfig.eslint.json", "./packages/**/tsconfig.json"],
allowAutomaticSingleRunInference: true,
tsconfigRootDir: __dirname,
},
ignorePatterns: ["*.js", "*.jsx"],
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"@typescript-eslint/no-namespace": [
"error",
{
allowDeclarations: true,
},
],
"@typescript-eslint/explicit-module-boundary-types": ["off"],
"@typescript-eslint/no-floating-promises": ["error"],
"@typescript-eslint/no-empty-function": [
"error",
{
allow: ["private-constructors", "protected-constructors", "decoratedFunctions"],
},
],
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/no-base-to-string": "error",
"@typescript-eslint/no-extraneous-class": "off",
"@typescript-eslint/no-invalid-void-type": "off",
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"linebreak-style": ["error", "unix"],
"no-console": "error",
"no-empty": [
"error",
{
allowEmptyCatch: true,
},
],
"no-unused-vars": "off",
"tailwindcss/classnames-order": "off",
quotes: [
"error",
"double",
{
avoidEscape: true,
},
],
semi: ["error", "always"],
indent: "off",
"object-shorthand": ["error"],
"deprecation/deprecation": "warn",
// "import/no-internal-modules": ["error"],
eqeqeq: [
"error",
"always",
{
null: "never",
},
],
curly: "error",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"tailwindcss/no-custom-classname": "off",
"@next/next/no-html-link-for-pages": "off",
"@next/next/no-img-element": "off",
"react-hooks/exhaustive-deps": [
"warn",
{
additionalHooks: "(useMemoOne|useCallbackOne)",
},
],
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ["*.ts", "*.mts", "*.cts", "*.tsx"],
rules: {
"@typescript-eslint/explicit-module-boundary-types": [
"error",
{
allowHigherOrderFunctions: false,
},
],
},
},
{
files: ["packages/fdr-sdk/**/*", "servers/fdr-deploy/**/*", "servers/fdr/**/*"],
rules: {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-base-to-string": "off",
},
},
{
files: ["servers/fdr/**/*", "servers/fern-bot/**/*"],
rules: {
eqeqeq: "off",
"no-console": "off",
},
},
{
files: ["packages/ui/**/*"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
},
},
],
};