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

TypeScript: Revert a few @ts-expect-errors #19168

Merged
merged 1 commit into from
Sep 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion code/lib/api/src/modules/versions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import global from 'global';
// @ts-expect-error no typedefs
// @ts-ignore (FIXME should be expect-error no typedefs but fails build --prep)
import semver from '@storybook/semver';
import memoize from 'memoizerific';

Expand Down
4 changes: 2 additions & 2 deletions code/lib/builder-webpack5/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const bail: WebpackBuilder['bail'] = async () => {
}
// we wait for the compiler to finish it's work, so it's command-line output doesn't interfere
return new Promise((res, rej) => {
// @ts-expect-error (Converted from ts-ignore)
// @ts-ignore (FIXME: should be expect-error but fails build --prep)
if (process && compilation) {
try {
compilation.close(() => res());
Expand Down Expand Up @@ -219,7 +219,7 @@ const builder: BuilderFunction = async function* builderGeneratorFn({ startTime,

logger.trace({ message: '=> Preview built', time: process.hrtime(startTime) });
if (stats && stats.hasWarnings()) {
// @ts-expect-error (Converted from ts-ignore)
// @ts-ignore (FIXME should be @ts-expect-error but fails build --prep)
stats
.toJson({ warnings: true } as StatsOptions)
.warnings.forEach((e) => logger.warn(e.message));
Expand Down
2 changes: 1 addition & 1 deletion code/lib/core-common/src/utils/envs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @ts-expect-error does not have defs, but universal-dotenv is in TS now
// @ts-ignore (FIXME should be "@ts-expect-error does not have defs, but universal-dotenv is in TS now" but fails build --prep)
import { getEnvironment } from 'lazy-universal-dotenv';
import { nodePathsToArray } from './paths';

Expand Down
2 changes: 1 addition & 1 deletion code/lib/core-common/src/utils/normalize-stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const DEFAULT_FILES = '**/*.@(mdx|stories.mdx|stories.tsx|stories.ts|stories.jsx
// TODO: remove - LEGACY support for bad glob patterns we had in SB 5 - remove in SB7
const fixBadGlob = deprecate(
(match: RegExpMatchArray) => {
// @ts-expect-error this will get removed later anyway
// @ts-ignore (FIXME should be "@ts-expect-error this will get removed later anyway" but fails build --prep)
return match.input.replace(match[1], `@${match[1]}`);
},
dedent`
Expand Down
2 changes: 1 addition & 1 deletion code/lib/preview-web/src/render/StoryRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function createController(): AbortController {
return {
signal: { aborted: false },
abort() {
// @ts-expect-error (Converted from ts-ignore)
// @ts-ignore (should be @ts-expect-error but fails build --prep)
this.signal.aborted = true;
},
} as AbortController;
Expand Down