diff options
author | 2023-07-03 05:59:43 -0700 | |
---|---|---|
committer | 2023-07-03 20:59:43 +0800 | |
commit | 2fea174303ca60f4765c6294d99ebc7a19e73403 (patch) | |
tree | 671f1f27d6d0827e51aaa20704b7f6154ad5d053 /packages/markdown/remark/src/index.ts | |
parent | fc6826ff7620b0c5e419de93ef7c463a12fe3652 (diff) | |
download | astro-2fea174303ca60f4765c6294d99ebc7a19e73403.tar.gz astro-2fea174303ca60f4765c6294d99ebc7a19e73403.tar.zst astro-2fea174303ca60f4765c6294d99ebc7a19e73403.zip |
feat: use typescript-eslint@v6's reworked configs (#7425)
Diffstat (limited to 'packages/markdown/remark/src/index.ts')
-rw-r--r-- | packages/markdown/remark/src/index.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/markdown/remark/src/index.ts b/packages/markdown/remark/src/index.ts index 0a21e1c98..aa02f8ea9 100644 --- a/packages/markdown/remark/src/index.ts +++ b/packages/markdown/remark/src/index.ts @@ -147,7 +147,7 @@ export async function renderMarkdown( function prefixError(err: any, prefix: string) { // If the error is an object with a `message` property, attempt to prefix the message - if (err && err.message) { + if (err?.message) { try { err.message = `${prefix}:\n${err.message}`; return err; @@ -160,9 +160,8 @@ function prefixError(err: any, prefix: string) { const wrappedError = new Error(`${prefix}${err ? `: ${err}` : ''}`); try { wrappedError.stack = err.stack; - // @ts-expect-error wrappedError.cause = err; - } catch (error) { + } catch { // It's ok if we could not set the stack or cause - the message is the most important part } |