From 6913aa1e5e9793cca80f34dd206b264fecdb5347 Mon Sep 17 00:00:00 2001 From: JounQin Date: Tue, 2 Jan 2024 01:07:01 +0800 Subject: [PATCH] chore: log error details on `--debug` flag enabled (#511) --- .changeset/poor-lions-buy.md | 5 +++++ packages/eslint-mdx/src/parser.ts | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/poor-lions-buy.md diff --git a/.changeset/poor-lions-buy.md b/.changeset/poor-lions-buy.md new file mode 100644 index 0000000..23e5cbe --- /dev/null +++ b/.changeset/poor-lions-buy.md @@ -0,0 +1,5 @@ +--- +"eslint-mdx": patch +--- + +chore: log error details on `--debug` flag enabled diff --git a/packages/eslint-mdx/src/parser.ts b/packages/eslint-mdx/src/parser.ts index 1b373c3..8984515 100644 --- a/packages/eslint-mdx/src/parser.ts +++ b/packages/eslint-mdx/src/parser.ts @@ -62,6 +62,10 @@ export class Parser { ignoreRemarkConfig, }) } catch (err: unknown) { + /* istanbul ignore if */ + if (process.argv.includes('--debug')) { + console.error(err) + } const error = err as VFileMessage throw Object.assign( new SyntaxError(error.message, {