Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable TS strict mode #168

Merged
merged 58 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
7e2f9fc
feat: enable TS strict mode
doprz Mar 15, 2024
1e53b2d
fix: strict TS errors
doprz Mar 15, 2024
cd2cb12
fix: strict TS errors
doprz Mar 15, 2024
75681a2
fix: strict TS errors
doprz Mar 15, 2024
eca4281
fix: strict TS errors
doprz Mar 15, 2024
53d74d2
fix: strict TS errors
doprz Mar 15, 2024
01e94bf
fix: strict TS errors
doprz Mar 15, 2024
5692f96
fix: strict TS errors
Lukas-Zenick Mar 15, 2024
18123c5
fix: strict TS errors
Lukas-Zenick Mar 15, 2024
a0bfaee
fix: colors bug with default
Lukas-Zenick Mar 15, 2024
6234d72
fix: strict TS errors
doprz Mar 16, 2024
6f84bb4
fix: strict TS errors
doprz Mar 16, 2024
962d987
fix: strict TS errors
doprz Mar 16, 2024
817dc08
fix: strict TS errors
doprz Mar 16, 2024
f57b462
fix: strict TS errors
doprz Mar 16, 2024
6bc6847
fix: strict TS errors
doprz Mar 16, 2024
b3e37b1
fix: strict TS errors
doprz Mar 16, 2024
4c57a84
fix: strict TS errors
doprz Mar 16, 2024
9e3bd42
fix: strict TS errors
doprz Mar 16, 2024
2b59df7
fix: strict TS errors
doprz Mar 16, 2024
3dc94d6
Merge branch 'main' of https://github.com/Longhorn-Developers/UT-Regi…
doprz Mar 17, 2024
ea73f5c
fix: strict TS errors
doprz Mar 17, 2024
496526b
fix: text type errors
Razboy20 Mar 17, 2024
cb94e43
Merge branch 'main' of https://github.com/Longhorn-Developers/UT-Regi…
doprz Mar 18, 2024
6f5a8f3
Merge branch 'feature/ts-strict' of https://github.com/Longhorn-Devel…
doprz Mar 18, 2024
ef8bb3f
fix: strict TS errors
doprz Mar 18, 2024
4b7a34a
Merge branch 'main' of https://github.com/Longhorn-Developers/UT-Regi…
doprz Mar 20, 2024
f7a5f80
fix: strict TS errors
doprz Mar 20, 2024
7da48fb
fix: strict TS errors - add definite assignment assertion
doprz Mar 20, 2024
0f1c20e
fix: strict TS errors - add definite assignment assertion
doprz Mar 20, 2024
d9a08b8
fix: strict TS errors
doprz Mar 20, 2024
5f5b243
fix: strict TS errors
doprz Mar 20, 2024
2429665
fix: strict TS errors
doprz Mar 20, 2024
65168ca
fix: strict TS errors
doprz Mar 20, 2024
1184a4e
fix: strict TS errors
doprz Mar 20, 2024
fd127a8
fix: strict TS errors
doprz Mar 20, 2024
3351d2f
fix(ESLint): error on no-explicit-any
doprz Mar 21, 2024
8f1026a
fix: type annotations for any types
doprz Mar 21, 2024
63a7968
fix: strict TS errors
doprz Mar 21, 2024
d1163c4
fix: strict TS errors
doprz Mar 21, 2024
ebcc66f
fix: strict TS errors
doprz Mar 21, 2024
45a0187
fix: strict TS errors (and remove packages)
Razboy20 Mar 21, 2024
8ff6af8
Merge branch 'main' into feature/ts-strict
Razboy20 Mar 21, 2024
18c1980
fix: strict TS errors
doprz Mar 21, 2024
c621581
Merge branch 'feature/ts-strict' of https://github.com/Longhorn-Devel…
doprz Mar 21, 2024
097107f
fix: strict TS errors
doprz Mar 21, 2024
02b8193
fix: strict TS errors
doprz Mar 21, 2024
1a2ba2c
fix: strict TS errors
doprz Mar 21, 2024
a255ccf
fix: strict TS errors
doprz Mar 21, 2024
e4ddb45
fix: strict TS errors
doprz Mar 21, 2024
e2e64d8
fix: strict TS errors
doprz Mar 21, 2024
5df24ab
feat: enable React.StrictMode
doprz Mar 21, 2024
a2cdc6b
fix: strict TS errors (done!)
Razboy20 Mar 21, 2024
784d33d
fix: build error
Razboy20 Mar 21, 2024
4006ed2
fix: replace no-explicit-any assertions
Razboy20 Mar 21, 2024
1c3acc2
refactor: cleanup
Razboy20 Mar 21, 2024
a703320
refactor: more cleanup
Razboy20 Mar 21, 2024
31d1ff5
style: prettier
Razboy20 Mar 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"react": "^18.2.0",
"react-devtools-core": "^5.0.0",
"react-dom": "^18.2.0",
"rollup": "^4.13.0",
"sass": "^1.71.1",
"sql.js": "1.10.2"
},
Expand Down
124 changes: 64 additions & 60 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions src/debug/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ function DevDashboard() {
// listen for changes to the chrome storage to update the local storage state displayed in the dashboard
useEffect(() => {
const onChanged = (changes: chrome.storage.StorageChange, areaName: chrome.storage.AreaName) => {
let copy = {};
let copy: Record<string, any> = {};

if (areaName === 'local') {
copy = { ...localStorage };
} else if (areaName === 'sync') {
Expand All @@ -102,8 +103,8 @@ function DevDashboard() {
copy = { ...sessionStorage };
}

Object.keys(changes).forEach(key => {
copy[key] = changes[key].newValue;
Object.keys(changes).forEach((key: string) => {
copy[key] = changes[key as keyof typeof changes].newValue;
});

if (areaName === 'local') {
Expand All @@ -125,7 +126,7 @@ function DevDashboard() {
}, [localStorage, syncStorage, sessionStorage]);

const handleEditStorage = (areaName: string) => (changes: Record<string, any>) => {
chrome.storage[areaName].set(changes);
(chrome.storage as any)[areaName].set(changes);
};

return (
Expand All @@ -145,4 +146,9 @@ function DevDashboard() {
);
}

createRoot(document.getElementById('root')).render(<DevDashboard />);
const rootElement = document.getElementById('root');
if (rootElement) {
createRoot(rootElement).render(<DevDashboard />);
} else {
throw new Error('No root element found');
}
10 changes: 5 additions & 5 deletions src/pages/background/lib/renameSchedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ export default async function renameSchedule(scheduleId: string, newName: string
if (scheduleIndex === -1) {
return `Schedule ${scheduleId} does not exist`;
}
// if (schedules.find(schedule => schedule.name === newName)) {
// return `Schedule ${newName} already exists`;
// }

schedules[scheduleIndex].name = newName;
schedules[scheduleIndex].updatedAt = Date.now();
const scheduleToUpdate = schedules[scheduleIndex];
if (scheduleToUpdate) {
scheduleToUpdate.name = newName;
scheduleToUpdate.updatedAt = Date.now();
}

await UserScheduleStore.set('schedules', schedules);
return undefined;
Expand Down
Loading
Loading