-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
CLI: Typescript strict mode #22254
CLI: Typescript strict mode #22254
Changes from all commits
1c2a717
84a6952
3f28ddd
fe60f6c
4eadf30
008880f
edb293d
7bdd65a
ffd71bd
cb3a600
533d35c
c083c0d
15fcbb7
08428fe
55986a8
5c8c2a6
6845a06
f27df86
f516d10
14c32d5
74da582
2b454f2
75a868f
70a5a6b
d2e39bd
b554e0e
75300e3
44131b2
abc7d48
ab83e54
dfe520f
7a8a80c
3e8af28
fd769b4
b687df4
39009b5
8f0b100
96135bf
6a8644b
d531dde
ba9f329
1edcc46
679cd26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export class HandledError extends Error { | ||
public handled = true; | ||
|
||
constructor(messageOrError: string | Error) { | ||
super(typeof messageOrError === 'string' ? messageOrError : messageOrError.message); | ||
constructor(error: unknown) { | ||
super(String(error)); | ||
|
||
if (typeof messageOrError !== 'string') this.cause = messageOrError; | ||
if (typeof error !== 'string') this.cause = error; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -75,7 +75,7 @@ export const builderVite: Fix<BuilderViteOptions> = { | |||
|
||||
logger.info(`✅ Updating main.js to use vite builder`); | ||||
if (!dryRun) { | ||||
await updateMainConfig({ dryRun, mainConfigPath }, async (main) => { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
but |
||||
await updateMainConfig({ dryRun: !!dryRun, mainConfigPath }, async (main) => { | ||||
const updatedBuilder = | ||||
typeof builder === 'string' | ||||
? '@storybook/builder-vite' | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,15 +33,15 @@ export const eslintPlugin: Fix<EslintPluginRunOptions> = { | |
return null; | ||
} | ||
|
||
let eslintFile; | ||
let unsupportedExtension; | ||
let eslintFile: string | null = null; | ||
let unsupportedExtension: string | undefined; | ||
try { | ||
eslintFile = findEslintFile(); | ||
} catch (err) { | ||
unsupportedExtension = err.message; | ||
unsupportedExtension = String(err); | ||
} | ||
|
||
if (!eslintFile && !unsupportedExtension) { | ||
if (!eslintFile || !unsupportedExtension) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm pretty sure this is meant to be |
||
logger.warn('Unable to find .eslintrc config file, skipping'); | ||
return null; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably would have just made more sense to add a tuple return-type to the
getVersionSpecifier
function definition.