Skip to content

Enforce no-throw-literal rule in ESLint#6418

Merged
louislam merged 1 commit intomasterfrom
dev-eslint
Nov 26, 2025
Merged

Enforce no-throw-literal rule in ESLint#6418
louislam merged 1 commit intomasterfrom
dev-eslint

Conversation

@louislam
Copy link
Copy Markdown
Owner

@louislam louislam commented Nov 26, 2025

Failure message could be undefined because of lacking of this. Also it is a good practice I think.

Copilot AI review requested due to automatic review settings November 26, 2025 08:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enforces the no-throw-literal ESLint rule to ensure consistent error handling throughout the codebase. The rule prevents throwing non-Error objects, which is a JavaScript best practice.

  • Adds no-throw-literal rule to ESLint configuration as an error
  • Fixes existing violation in webhook notification provider by wrapping thrown string in Error object

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.eslintrc.js Adds no-throw-literal rule to enforce throwing Error objects instead of literals
server/notification-providers/webhook.js Fixes existing violation by changing throw "..." to throw new Error("...")

@louislam louislam merged commit 892bd42 into master Nov 26, 2025
25 checks passed
@louislam louislam deleted the dev-eslint branch November 26, 2025 08:10
@CommanderStorm CommanderStorm added this to the 2.1.0 milestone Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants