Skip to content
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

Test (can be ignored) #13900

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
5 changes: 5 additions & 0 deletions types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
export interface SendConfigEmit {
raw_event: SendPayload;
}

const testConst: string = {
t: 50

Check failure on line 52 in types/src/index.ts

View workflow job for this annotation

GitHub Actions / Lint Code Base

Missing trailing comma
};
testConst = 5;

Check failure on line 54 in types/src/index.ts

View workflow job for this annotation

GitHub Actions / Lint Code Base

'testConst' is assigned a value but never used
Comment on lines +51 to +54
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove or fix the invalid constant declaration and assignments.

The code segment has the following issues:

  1. Type mismatch: The constant testConst is declared as a string but assigned an object { t: 50 } and then a number 5.
  2. Incorrect reassignment: The constant is reassigned after initialization, which is not allowed.

Consider the following options to fix the issues:

  • If the constant is not needed, remove the declaration and assignments.
  • If the constant is needed, declare it with the correct type and assign a valid value. For example:
-const testConst: string = {
-  t: 50  
-};
-testConst = 5;
+const testConst: number = 5;

Do you want me to open a GitHub issue to track this fix?

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const testConst: string = {
t: 50
};
testConst = 5;
const testConst: number = 5;
Tools
Biome

[error] 53-54: Can't assign testConst because it's a constant

This is where the variable is defined as constant

Unsafe fix: Replace const with let if you assign it to a new value.

(lint/correctness/noConstAssign)

export interface SendConfigSSE {
channel: string;
payload: SendPayload;
Expand Down
Loading