Skip to content

Commit d239101

Browse files
authored
New Registration Form and many tech debt updates (#1847)
1 parent 67b81b5 commit d239101

File tree

236 files changed

+6458
-7548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+6458
-7548
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
cypress: cypress-io/cypress@1.29.0
4+
cypress: cypress-io/cypress@2.2.0
55

66
executors:
77
default:

.eslintrc.js

+141-102
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
*/
44
module.exports = {
55
extends: [
6+
'plugin:@typescript-eslint/eslint-recommended',
67
'airbnb',
78
'plugin:jsx-a11y/recommended',
8-
'prettier',
99
'plugin:cypress/recommended',
1010
'plugin:storybook/recommended',
11-
'plugin:@typescript-eslint/eslint-recommended',
11+
'plugin:prettier/recommended',
12+
'prettier',
1213
],
1314
env: {
1415
browser: true,
@@ -19,7 +20,6 @@ module.exports = {
1920
},
2021
parser: '@babel/eslint-parser',
2122
plugins: [
22-
'prettier',
2323
'unicorn',
2424
'cypress',
2525
'@operation_code/custom-rules',
@@ -31,107 +31,19 @@ module.exports = {
3131
cy: true,
3232
Cypress: true,
3333
},
34-
overrides: [
35-
{
36-
files: ['./**/*.test.js', './**/*.test.jsx', './**/*.test.ts', './**/*.test.tsx'],
37-
plugins: ['vitest'],
38-
extends: ['plugin:vitest-globals/recommended', 'plugin:vitest/recommended'],
39-
env: {
40-
'vitest-globals/env': true,
41-
},
42-
rules: {
43-
'vitest/consistent-test-it': ['error', { fn: 'it', withinDescribe: 'it' }],
44-
'vitest/expect-expect': [
45-
'error',
46-
{ assertFunctionNames: ['expect', 'createShallowSnapshotTest', 'createSnapshotTest'] },
47-
],
48-
'vitest/prefer-lowercase-title': ['error', { ignore: ['describe'] }],
49-
'vitest/no-test-prefixes': 'error',
50-
'vitest/no-test-return-statement': 'error',
51-
'vitest/prefer-strict-equal': 'error',
52-
'vitest/valid-describe-callback': 'error',
53-
},
54-
},
55-
{
56-
files: ['./**/*.ts', './**/*.tsx'],
57-
parser: '@typescript-eslint/parser',
58-
parserOptions: {
59-
project: true,
60-
},
61-
extends: ['plugin:@typescript-eslint/strict', 'plugin:@typescript-eslint/stylistic'],
62-
rules: {
63-
'react/no-array-index-key': 'off',
64-
'react/require-default-props': 'off',
65-
66-
// Typescript Rules
67-
// custom rules for typescript-eslint: https://github.com/OperationCode/front-end/pull/1792#pullrequestreview-1874516174
68-
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'no-type-imports' }],
69-
'@typescript-eslint/explicit-module-boundary-types': 'off',
70-
'@typescript-eslint/naming-convention': [
71-
'error',
72-
{
73-
selector: 'variable',
74-
types: ['boolean'],
75-
format: ['PascalCase', 'UPPER_CASE'],
76-
prefix: [
77-
'is',
78-
'was',
79-
'should',
80-
'has',
81-
'can',
82-
'did',
83-
'will',
84-
'IS_',
85-
'WAS_',
86-
'SHOULD_',
87-
'HAS_',
88-
'CAN_',
89-
'DID_',
90-
'WILL_',
91-
],
92-
},
93-
],
94-
'@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }],
95-
'@typescript-eslint/no-explicit-any': 'error',
96-
'@typescript-eslint/no-unused-vars': ['error', { vars: 'all', varsIgnorePattern: '_' }],
97-
'@typescript-eslint/unbound-method': 'off', // gives false negatives in arrow funcs
98-
},
99-
},
100-
{
101-
files: ['cypress/**/*.js'],
102-
rules: {
103-
'func-names': 'off',
104-
'vitest/expect-expect': 'off',
105-
'vitest/valid-expect': 'off',
106-
'no-unused-expressions': ['off'],
107-
},
108-
},
109-
{
110-
files: [
111-
'pages/**.js',
112-
'components/head.js',
113-
'components/nav.js',
114-
'components/Timeline/historyData.js',
115-
],
116-
rules: {
117-
'react/react-in-jsx-scope': 'off',
118-
},
119-
},
120-
{
121-
files: ['components/nav.js', 'components/Footer/Footer.js'],
122-
rules: { 'jsx-a11y/anchor-is-valid': 'off' },
123-
},
124-
{
125-
files: ['components/UpdateProfileForm/**/*.js'],
126-
rules: { 'react/sort-comp': 'off' },
127-
},
128-
],
12934
rules: {
13035
// Import Rules
13136
'import/extensions': [
13237
'error',
13338
'never',
134-
{ css: 'always', jpg: 'always', json: 'always', png: 'always', svg: 'always' },
39+
{
40+
css: 'always',
41+
jpg: 'always',
42+
json: 'always',
43+
png: 'always',
44+
svg: 'always',
45+
stories: 'always',
46+
},
13547
],
13648
'import/no-unresolved': 'off',
13749
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
@@ -165,9 +77,6 @@ module.exports = {
16577
// Lodash Plugin Rules
16678
'lodash/import-scope': ['error', 'method'],
16779

168-
// Prettier Plugin Rules
169-
'prettier/prettier': 'error',
170-
17180
// React Plugin Rules
17281
'react/function-component-definition': [
17382
'error',
@@ -247,5 +156,135 @@ module.exports = {
247156
],
248157
'no-use-before-define': 'off',
249158
},
159+
overrides: [
160+
{
161+
files: ['./**/*.test.js', './**/*.test.jsx', './**/*.test.ts', './**/*.test.tsx'],
162+
plugins: ['vitest'],
163+
extends: ['plugin:vitest-globals/recommended', 'plugin:vitest/recommended'],
164+
env: {
165+
'vitest-globals/env': true,
166+
},
167+
rules: {
168+
'vitest/consistent-test-it': ['error', { fn: 'it', withinDescribe: 'it' }],
169+
'vitest/expect-expect': [
170+
'error',
171+
{ assertFunctionNames: ['expect', 'createShallowSnapshotTest', 'createSnapshotTest'] },
172+
],
173+
'vitest/prefer-lowercase-title': ['error', { ignore: ['describe'] }],
174+
'vitest/no-test-prefixes': 'error',
175+
'vitest/no-test-return-statement': 'error',
176+
'vitest/prefer-strict-equal': 'error',
177+
'vitest/valid-describe-callback': 'error',
178+
},
179+
},
180+
{
181+
files: ['./**/*.ts', './**/*.tsx'],
182+
parser: '@typescript-eslint/parser',
183+
parserOptions: {
184+
project: true,
185+
},
186+
extends: ['plugin:@typescript-eslint/strict', 'plugin:@typescript-eslint/stylistic'],
187+
rules: {
188+
// Deactivate rules not meant for TS
189+
'no-restricted-imports': 'off',
190+
191+
// React Plugin Rules
192+
'react/prop-types': 'off', // https://github.com/jsx-eslint/eslint-plugin-react/issues/3651
193+
'react/no-array-index-key': 'off',
194+
'react/require-default-props': 'off',
195+
196+
// Typescript Rules
197+
'@typescript-eslint/consistent-type-imports': ['error'],
198+
'@typescript-eslint/explicit-module-boundary-types': 'off',
199+
'@typescript-eslint/naming-convention': [
200+
'error',
201+
{
202+
selector: 'variable',
203+
types: ['boolean'],
204+
format: ['PascalCase', 'UPPER_CASE'],
205+
prefix: [
206+
'is',
207+
'are',
208+
'was',
209+
'should',
210+
'has',
211+
'can',
212+
'did',
213+
'will',
214+
'IS_',
215+
'ARE_',
216+
'WAS_',
217+
'SHOULD_',
218+
'HAS_',
219+
'CAN_',
220+
'DID_',
221+
'WILL_',
222+
],
223+
},
224+
],
225+
'@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }],
226+
'@typescript-eslint/no-explicit-any': 'error',
227+
'@typescript-eslint/no-restricted-imports': [
228+
'error',
229+
{
230+
paths: [
231+
{
232+
name: 'react-select',
233+
message: 'Please use `components/Form/Select/ThemedReactSelect` instead.',
234+
},
235+
{
236+
name: 'formik',
237+
importNames: ['Form'],
238+
message: `Please use our Form component to have good defaults defined.\n "import Form from 'components/Form/Form';"`,
239+
},
240+
{
241+
name: 'react',
242+
importNames: ['default'],
243+
message: 'React is globally availble for all page files.',
244+
},
245+
],
246+
},
247+
],
248+
'@typescript-eslint/no-unused-vars': ['error', { vars: 'all', varsIgnorePattern: '_' }],
249+
'@typescript-eslint/unbound-method': 'off', // gives false negatives in arrow funcs
250+
},
251+
},
252+
{
253+
files: ['./**/*.test.ts', './**/*.test.tsx'],
254+
rules: {
255+
'@typescript-eslint/no-non-null-assertion': 'off',
256+
},
257+
},
258+
{
259+
files: ['./pages/api/**/*.ts'],
260+
rules: {
261+
'no-console': 'off',
262+
},
263+
},
264+
{
265+
files: ['cypress/**/*.js'],
266+
rules: {
267+
'func-names': 'off',
268+
'vitest/expect-expect': 'off',
269+
'vitest/valid-expect': 'off',
270+
'no-unused-expressions': ['off'],
271+
},
272+
},
273+
{
274+
files: [
275+
'pages/**.js',
276+
'components/head.js',
277+
'components/nav.js',
278+
'components/Timeline/historyData.js',
279+
],
280+
rules: {
281+
'react/react-in-jsx-scope': 'off',
282+
},
283+
},
284+
{
285+
files: ['components/nav.js', 'components/Footer/Footer.js'],
286+
rules: { 'jsx-a11y/anchor-is-valid': 'off' },
287+
},
288+
],
250289
root: true,
251290
};

.github/workflows/chromatic.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: echo "::set-output name=dir::$(yarn cache dir)"
3434

3535
- name: Use cached node_modules
36-
uses: actions/cache@v2
36+
uses: actions/cache@v4
3737
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
3838
with:
3939
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}

.lintstagedrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"*.js": ["prettier --write", "eslint --fix"],
2+
"*.{js,jsx,ts,tsx}": ["prettier --write", "eslint --fix"],
33
"*.css": ["prettier --write", "stylelint --fix"]
44
}

.prettierrc

-10
This file was deleted.

.stylelintrc

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,16 @@
1111
"rules": {
1212
"prettier/prettier": true,
1313
"alpha-value-notation": null,
14-
"color-hex-case": "lower",
1514
"color-hex-length": "long",
1615
"custom-property-pattern": null,
1716
"hue-degree-notation": null,
18-
"indentation": 2,
1917
"keyframes-name-pattern": null,
2018
"color-function-notation": "legacy",
2119
"no-duplicate-selectors": true,
2220
"property-no-unknown": [true, { "ignoreProperties": ["composes", "composes-with"] }],
2321
"selector-id-pattern": null,
2422
"selector-class-pattern": null,
2523
"selector-pseudo-class-no-unknown": [true, { "ignorePseudoClasses": ["global"] }],
26-
"shorthand-property-no-redundant-values": null,
27-
"string-quotes": "double"
24+
"shorthand-property-no-redundant-values": null
2825
}
2926
}

common/config/environment.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file should only contain environment variables that are non-secret.
33
*/
4-
const isProduction = process.env.NODE_ENV === 'production';
4+
const isProduction = process.env.PRODUCTION_DEPLOYMENT === 'true';
55

66
// These are all exposed by the client, so there's no way to protect them anyways.
77
export const clientTokens = isProduction
@@ -36,3 +36,8 @@ export const resourcesAPIURL = isProduction
3636

3737
export const slackMembersAPIUrl = 'https://slack.com/api/conversations.members';
3838
export const slackGeneralChannelId = 'C03GSNF6X';
39+
40+
export const AIR_TABLE_BASE_ID = 'app9tYjofmFWMxRl8';
41+
export const AIR_TABLE_TABLE_NAME = isProduction
42+
? 'Onboarding Request PRODUCTION'
43+
: 'Onboarding Request STAGING';

0 commit comments

Comments
 (0)