forked from growthbook/growthbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
176 lines (176 loc) · 5.43 KB
/
.eslintrc
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
{
"env": {
"node": true,
"browser": true,
"es6": true
},
"settings": {
"react": {
"version": "detect"
},
"import/parsers": {
"@typescript-eslint/parser": [
".ts",
".tsx"
]
},
"import/resolver": {
"node": true,
"typescript": {
"alwaysTryTypes": true,
"project": [
"packages/*/tsconfig.json"
]
}
}
},
"parser": "@typescript-eslint/parser",
"plugins": [
"react",
"@typescript-eslint",
"prettier",
"@next/eslint-plugin-next",
"no-async-foreach"
],
"extends": [
"eslint:recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:@next/eslint-plugin-next/recommended",
"plugin:react-hooks/recommended"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"rules": {
"no-unused-expressions": ["error", {
"allowShortCircuit": true,
"enforceForJSX": true,
"allowTernary": true
}],
"no-async-foreach/no-async-foreach": 2,
"@next/next/no-html-link-for-pages": [
"warn",
"./packages/front-end/pages"
],
"@next/next/no-img-element": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": 1,
"@typescript-eslint/no-inferrable-types": [
"warn",
{
"ignoreParameters": true
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
"no-console": [
"warn"
],
"no-restricted-imports": "off",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal", "parent", "sibling", "index", "unknown"]
}
],
"@typescript-eslint/prefer-ts-expect-error": "error"
},
"overrides": [
{
"files": [
"./packages/sdk-js/rollup.config.js",
"./packages/sdk-react/rollup.config.js"
],
"rules": {
"import/no-named-as-default": "off"
}
},
{
"files": [
"./packages/front-end/**/*.ts*"
],
"rules": {
"no-restricted-imports": ["error", {"patterns": ["..*"]}]
}
},
{
"files": [
"./packages/docs/pages/_app.tsx",
"./packages/front-end/components/Auth/InAppHelp.tsx",
"./packages/front-end/components/Dimensions/DimensionChooser.tsx",
"./packages/front-end/components/Experiment/ImportExperimentModal.tsx",
"./packages/front-end/components/Experiment/ManualSnapshotForm.tsx",
"./packages/front-end/components/Experiment/NewExperimentForm.tsx",
"./packages/front-end/components/Experiment/VisualEditorScriptMissing.tsx",
"./packages/front-end/components/Features/CodeSnippetModal.tsx",
"./packages/front-end/components/Features/DraftModal.tsx",
"./packages/front-end/components/Features/RuleList.tsx",
"./packages/front-end/components/Forms/SelectField.tsx",
"./packages/front-end/components/HomePage/NorthStar.tsx",
"./packages/front-end/components/Markdown/MarkdownInput.tsx",
"./packages/front-end/components/Metrics/MetricForm.tsx",
"./packages/front-end/components/ProtectedPage.tsx",
"./packages/front-end/components/Queries/RunQueriesButton.tsx",
"./packages/front-end/components/Segments/PickSegmentModal.tsx",
"./packages/front-end/components/Settings/UpgradeModal.tsx",
"./packages/front-end/components/Share/ShareModal.tsx",
"./packages/front-end/components/Tabs/ControlledTabs.tsx",
"./packages/front-end/components/TempMessage.tsx",
"./packages/front-end/hooks/useStripeSubscription.ts",
"./packages/front-end/pages/experiments/index.tsx",
"./packages/front-end/pages/idea/*iid*.tsx",
"./packages/front-end/pages/index.tsx",
"./packages/front-end/pages/integrations/vercel/index.tsx",
"./packages/front-end/pages/invitation.tsx",
"./packages/front-end/pages/metric/*mid*.tsx",
"./packages/front-end/pages/oauth/callback.tsx",
"./packages/front-end/pages/report/*rid*.tsx",
"./packages/front-end/pages/reports.tsx",
"./packages/front-end/pages/settings/index.tsx",
"./packages/front-end/pages/settings/team.tsx",
"./packages/front-end/services/DefinitionsContext.tsx",
"./packages/front-end/services/features.ts",
"./packages/front-end/services/search.tsx",
"./packages/front-end/services/useGlobalMenu.ts",
"./packages/front-end/services/useSwitchOrg.ts"
],
"rules": {
"react-hooks/exhaustive-deps": "off"
}
},
{
"rules": {
"no-console": "off"
},
"files": [
"./packages/sdk-js/**/*",
"./packages/front-end/**/*",
"./packages/back-end/test/**/*",
"./packages/back-end/src/scripts/**/*",
"./packages/back-end/**/*.test.{ts,tsx,js,jsx}"
]
}
]
}