-
Notifications
You must be signed in to change notification settings - Fork 116
/
.eslintrc
136 lines (136 loc) · 5.93 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
{
"extends": [
"plugin:@18f/eslint-plugin-identity/recommended",
// These two react lint plugins are mostly off, see overrides below
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:react/jsx-runtime"
],
"plugins": ["@18f/eslint-plugin-identity", "testing-library"],
"env": {
"browser": true,
"commonjs": true
},
"globals": {
"globalThis": true
},
"rules": {
// `no-unresolved` doesn't support package.json exports
// See: https://github.com/import-js/eslint-plugin-import/issues/1810
"import/no-unresolved": ["error", { "ignore": ["intl-tel-input"] }],
"no-restricted-syntax": [
"error",
{
"selector": "AssignmentExpression[left.property.name='href'][right.type=/(Template)?Literal/],NewExpression[callee.name=URL][arguments.0.type=/(Template)?Literal/]",
"message": "Avoid hard-coded string URLs, since they will not include the current locale"
}
],
"react-hooks/exhaustive-deps": "error"
},
"settings": {
"import/internal-regex": "^@18f/identity-"
},
"overrides": [
{
"files": ["*.spec.*", "*-spec.*", "*_spec.*", "spec/**"],
"globals": {
"expect": true
},
"rules": {
"react/jsx-props-no-spreading": "off",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true,
"packageDir": "."
}
],
"no-restricted-syntax": "off",
"testing-library/await-async-events": "error",
"testing-library/await-async-queries": "error",
"testing-library/await-async-utils": "error",
"testing-library/no-await-sync-events": "error",
"testing-library/no-await-sync-queries": "error",
"testing-library/no-debugging-utils": "error"
}
},
{
"files": [
"app/javascript/packages/address-search/components/address-input.tsx",
"app/javascript/packages/address-search/components/full-address-search-input.tsx",
"app/javascript/packages/components/hooks/use-focus-trap.ts",
"app/javascript/packages/components/hooks/use-toggle-body-class-by-presence.ts",
"app/javascript/packages/document-capture/components/acuant-camera.tsx",
"app/javascript/packages/document-capture/components/acuant-capture-canvas.jsx",
"app/javascript/packages/document-capture/components/acuant-capture.tsx",
"app/javascript/packages/document-capture/components/acuant-selfie-camera.tsx",
"app/javascript/packages/document-capture/components/callback-on-mount.jsx",
"app/javascript/packages/document-capture/components/document-capture-warning.tsx",
"app/javascript/packages/document-capture/components/document-capture.tsx",
"app/javascript/packages/document-capture/components/file-image.jsx",
"app/javascript/packages/document-capture/components/file-input.tsx",
"app/javascript/packages/document-capture/components/in-person-location-full-address-entry-post-office-search-step.tsx",
"app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx",
"app/javascript/packages/document-capture/components/in-person-switch-back-step.tsx",
"app/javascript/packages/document-capture/components/review-issues-step.tsx",
"app/javascript/packages/document-capture/components/submission-interstitial.jsx",
"app/javascript/packages/document-capture/context/acuant.tsx",
"app/javascript/packages/document-capture/hooks/use-cookie.js",
"app/javascript/packages/form-steps/form-steps.spec.tsx",
"app/javascript/packages/form-steps/form-steps.tsx",
"app/javascript/packages/form-steps/use-history-param.ts",
"app/javascript/packages/react-hooks/use-did-update-effect.ts",
"app/javascript/packages/react-hooks/use-immutable-callback.ts",
"app/javascript/packages/react-hooks/use-object-memo.ts"
],
"rules": {
"react-hooks/exhaustive-deps": "off"
}
},
{
"files": [
"app/javascript/packages/address-search/components/in-person-locations.spec.tsx",
"app/javascript/packages/components/spinner-dots.jsx",
"app/javascript/packages/document-capture/components/acuant-capture.tsx",
"app/javascript/packages/document-capture/components/acuant-selfie-capture-canvas.jsx",
"app/javascript/packages/document-capture/components/document-side-acuant-capture.jsx",
"app/javascript/packages/document-capture/components/file-image.jsx",
"app/javascript/packages/document-capture/components/file-input.tsx",
"app/javascript/packages/document-capture/components/in-person-location-full-address-entry-post-office-search-step.tsx",
"app/javascript/packages/document-capture/components/in-person-location-post-office-search-step.tsx",
"app/javascript/packages/document-capture/components/in-person-prepare-step.tsx",
"app/javascript/packages/document-capture/components/submission-interstitial.jsx",
"app/javascript/packages/document-capture/components/submission.jsx",
"spec/javascript/packages/document-capture/context/failed-capture-attempts-spec.jsx",
"spec/javascript/packages/document-capture/hooks/use-async-spec.jsx"
],
"rules": {
"react/prop-types": "off"
}
},
{
"files": [
"app/javascript/packages/components/status-page.spec.tsx",
"app/javascript/packages/document-capture/components/warning.tsx"
],
"rules": {
"react/jsx-key": "off"
}
},
{
"files": ["app/javascript/packages/document-capture/higher-order/with-props.jsx"],
"rules": {
"react/display-name": "off"
}
},
{
"files": [
"app/javascript/packages/form-steps/form-steps.spec.tsx",
"spec/javascript/spec_helper.js"
],
"rules": {
"react-hooks/rules-of-hooks": "off"
}
}
]
}