forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
85 lines (83 loc) · 1.8 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
// @ts-check
const config = {
extends: '@sourcegraph/eslint-config',
env: {
browser: true,
node: true,
es6: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
project: __dirname + '/tsconfig.json',
},
settings: {
react: {
version: 'detect',
},
linkComponents: [
{
name: 'LinkOrSpan',
linkAttribute: 'to',
},
{
name: 'Link',
linkAttribute: 'to',
},
],
},
rules: {
// Rules that are specific to this repo
// All other rules should go into https://github.com/sourcegraph/eslint-config
'no-restricted-imports': [
'error',
{
paths: [
'highlight.js',
'marked',
'rxjs/ajax',
{
name: 'rxjs',
importNames: ['animationFrameScheduler'],
message: 'Code using animationFrameScheduler breaks in Firefox when using Sentry.',
},
{
name: 'rxjs/fetch',
message:
'rxjs fromFetch is broken. Until https://github.com/ReactiveX/rxjs/pull/5306 is merged, please use shared/src/graphql/fromFetch.ts',
},
],
},
],
'react/forbid-elements': [
'error',
{
forbid: [
{
element: 'form',
message:
'Use the Form component in src/components/Form.tsx instead of the native HTML form element to get proper form validation feedback',
},
],
},
],
},
overrides: [
{
files: ['*.d.ts'],
rules: {
'no-restricted-imports': 'off',
},
},
{
files: '*.story.tsx',
rules: {
'react/forbid-dom-props': 'off',
},
},
],
}
module.exports = config