Skip to content

chore(website): display tsconfig errors in playground #8666

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

Closed
wants to merge 1 commit into from
Closed
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
18 changes: 17 additions & 1 deletion packages/website/src/components/linter/createLinter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,23 @@ export function createLinter(
console.log('[Editor] Updating', fileName, compilerOptions);
parser.updateConfig(compilerOptions);
} catch (e) {
console.error(e);
const lintMessage: Linter.LintMessage = {
source: 'eslint',
ruleId: '',
severity: 2,
nodeType: '',
column: 1,
line: 1,
message: String(e instanceof Error ? e.message : e),
Comment on lines +163 to +169
Copy link
Member

@Josh-Cena Josh-Cena Mar 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are reporting it as a lint error as if it's coming from our tool. It would be better described as coming from TypeScript and should be reported as if it's a type-checking error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review.
After revisiting it, I feel like I can't solve it(I really cant understand how the monaco editor works 😅)
I'll close this pr.

};
if (typeof e === 'object' && e && 'currentNode' in e) {
const node = e.currentNode as TSESTree.Node;
lintMessage.column = node.loc.start.column + 1;
lintMessage.line = node.loc.start.line;
lintMessage.endColumn = node.loc.end.column + 1;
lintMessage.endLine = node.loc.end.line;
}
onLint.trigger('/tsconfig.json', [lintMessage]);
}
};

Expand Down