Skip to content

Commit 21fd325

Browse files
authored
chore(build) enable typecheck (#1006)
1 parent 36978ba commit 21fd325

5 files changed

Lines changed: 10 additions & 13 deletions

File tree

next.config.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,12 @@
22
* @type {import('next').NextConfig}
33
*/
44
const nextConfig = {
5+
productionBrowserSourceMaps: true,
56
typescript: {
6-
// !! WARN !!
7-
// Dangerously allow production builds to successfully complete even if
8-
// your project has type errors.
9-
// !! WARN !!
10-
ignoreBuildErrors: true,
117
tsconfigPath: './tsconfig.json',
128
},
139
eslint: {
14-
// Warning: This allows production builds to successfully complete even if
15-
// your project has ESLint errors.
16-
ignoreDuringBuilds: true,
10+
dirs: ['pages', 'src'],
1711
},
1812
webpack5: true,
1913
webpack: (config) => {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"dev": "netlify dev",
5050
"build": "next build",
5151
"start": "next dev",
52+
"lint": "next lint",
5253
"test": "yarn test:unit && yarn test:e2e:run",
5354
"test:unit": "react-scripts test",
5455
"test:unit:update-snapshot": "react-scripts test -u",

src/config/experiments.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* @typedef {'newBackoffice'} Experiments
44
*/
55

6+
import { getPersistData, setPersistData } from '../persistData';
7+
8+
/** @type {Record<string, boolean>} */
69
const experiments = {};
710

811
/**
@@ -20,15 +23,13 @@ addSource(process.env.NEXT_PUBLIC_EXPERIMENTS);
2023
addSource(new URLSearchParams(window.location.search).get('experiments'));
2124

2225
if (Object.keys(experiments).length) {
23-
localStorage.setItem('experiments', JSON.stringify(experiments));
26+
setPersistData('experiments', experiments);
2427
}
2528

2629
/**
2730
* @param {Experiments} name
2831
*/
2932
export const isOpen = (name) => {
30-
const openExperiments = JSON.parse(
31-
localStorage.getItem('experiments') || '{}'
32-
);
33+
const openExperiments = getPersistData('experiments') || {};
3334
return openExperiments[name];
3435
};

src/persistData/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { MentorshipRequest, User } from '../types/models';
55
type PersistDataKeyMap = {
66
user: User;
77
'mentorship-request': Pick<MentorshipRequest, 'expectation' | 'background' | 'message'>;
8+
experiments: Record<string, boolean>;
89
}
910

1011
type PersistDataKey = keyof PersistDataKeyMap;

src/utils/tawk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function init() {
2525
document.head.prepend(s1);
2626
})();
2727

28-
window.Tawk_API = window.Tawk_API || {};
28+
window.Tawk_API = window.Tawk_API || ({} as TawkAPI);
2929
window.Tawk_API.onLoad = function() {
3030
window.Tawk_API.addTags(['Mentor', 'User']);
3131
};

0 commit comments

Comments
 (0)