Skip to content

Commit

Permalink
Flag the remaining typescript build errors with todo's so we have a c…
Browse files Browse the repository at this point in the history
…lean build
  • Loading branch information
judeallred committed Nov 22, 2023
1 parent ac4c32e commit b225789
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .config/husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ set -e
. "$(dirname -- "$0")/_/husky.sh"

echo "************************************************************************"
echo "** Running sim-core's 'yarn check' **"
echo "** If this fails, run 'yarn fmt' and commit your fixes. **"
echo "** Running sim-core's 'yarn lint' **"
echo "** **"
echo "** If this fails, run 'yarn lint' for details. **"
echo "** You'll need to either fix formatting ('yarn fmt'), **"
echo "** or fix the typescript build ('yarn lint') **"
echo "** **"
echo "** (Output is stored in .config/husky/husky.log) **"
echo "** This takes about 10 seconds... **"
echo "************************************************************************"

cd apps/sim-core || exit 1
yarn check > ../../.config/husky/husky.log 2>&1;
yarn lint > ../../.config/husky/husky.log 2>&1;

echo "** Formatting check success. **"
echo "************************************************************************"
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const ModalShareByLink: FC<{
onSelectedReleaseChange,
hasReleases,
}) => {
//@ts-expect-error Genuine type error here, please fix.
const { params, setParams, changedParams } = useParams(defaultParams);
const { accessCode, requestAccessCode } = useRequestAccessCode(
project,
Expand Down Expand Up @@ -161,6 +162,7 @@ export const ModalShareByLink: FC<{
) : null}
<ModalShareViews
params={params}
//@ts-expect-error Genuine type error here, please fix.
onParamsChange={setParams}
availableTabs={viewerTabs}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const ModalShareEmbed: FC<{
"ReadEmbed",
);

//@ts-expect-error Genuine type error here, please fix.
const { params, setParams, changedParams } = useParams(defaultParams);
const value = iframeSrcCode(
project.pathWithNamespace,
Expand Down Expand Up @@ -131,6 +132,7 @@ export const ModalShareEmbed: FC<{
<div className="ModalShare__BottomSections">
<ModalShareViews
params={params}
//@ts-expect-error Genuine type error here, please fix.
onParamsChange={setParams}
availableTabs={embedViewerTabs}
/>
Expand Down
1 change: 1 addition & 0 deletions apps/sim-core/packages/core/src/features/scopes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ export const selectScope: Record<Scope, ScopeSelector> = scopeEntries.reduce(
): T & { [key in S]: ScopeSelector } =>
({
...existingSelectors,
//@ts-expect-error Genuine type error here, please fix.
[scope]: createSelectorForSelectorChain(selectorChain, existingSelectors),
}) as any,
{} as any,
Expand Down
2 changes: 2 additions & 0 deletions apps/sim-core/packages/core/src/util/resizeObserverPromise.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
export let resizeObserverPromise = Promise.resolve(window.ResizeObserver);

if (!window.ResizeObserver) {
//@ts-expect-error Todo: Clean out this polyfill.
resizeObserverPromise = import(
/* webpackChunkName: "ResizeObserver-polyfill" */ "@juggle/resize-observer/lib/exports/resize-observer"
)
.then((module) => {
//@ts-expect-error Todo: Clean out this polyfill.
window.ResizeObserver = module.ResizeObserver;

return module.ResizeObserver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function fetchDatasetContent(
const kvps: DataKeyValuePair[] = await Promise.all<DataKeyValuePair | null>(
datasets.map((dataset) => {
return Promise.resolve()
.then(() => {
.then(async () => {
if (cache.has(dataset.s3Key)) {
return Promise.resolve(cache.get(dataset.s3Key)?.data);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/sim-core/packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build": "tsc -b .",
"build:watch": "tsc -b . -w",
"fmt": "prettier --cache \"*.{ts,js,json}\" \"{scripts,src}/**/*.{ts,js,json}\" --write; eslint --quiet --fix \"*.{ts,js,json}\" \"{scripts,src}/**/*.{ts,js,json}\"",
"lint": "prettier --cache \"*.{ts,js,json}\" \"{scripts,src}/**/*.{ts,js,json}\" --check || exit 1; eslint --quiet \"*.{ts,js,json}\" \"{scripts,src}/**/*.{ts,js,json}; tsc --noEmit\""
"lint": "prettier --cache \"*.{ts,js,json}\" \"{scripts,src}/**/*.{ts,js,json}\" --check || exit 1; eslint --quiet \"*.{ts,js,json}\" \"{scripts,src}/**/*.{ts,js,json}\" ; tsc --noEmit"
},
"license": "SSPL-1.0",
"devDependencies": {
Expand Down

0 comments on commit b225789

Please sign in to comment.