-
Notifications
You must be signed in to change notification settings - Fork 11.7k
chore: upgrade ts target (perf) #26392
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
Changes from all commits
71dc3a5
0c77238
d75b98c
3003c6a
7292652
a02a6a0
d6cda53
b8d35d0
f4b8cfd
038541a
276f752
488fc7c
1d3f0a7
d159218
7a9385a
41fec39
d01dac4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,7 @@ export class FloatingButton extends HTMLElement { | |
| } | ||
|
|
||
| // Button added here triggers the modal on click. So, it has to have the same data attributes as the modal target as well | ||
| dataset!: DOMStringMap & FloatingButtonDataset & ModalTargetDatasetProps; | ||
| declare dataset: DOMStringMap & FloatingButtonDataset & ModalTargetDatasetProps; | ||
| buttonWrapperStyleDisplay!: HTMLElement["style"]["display"]; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 HIGH - Uninitialized property access on toggle callback Category: bug Description: Suggestion: Confidence: 85% |
||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| //@ts-ignore | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| { | ||
| "name": "@calcom/platform-enums", | ||
| "version": "0.0.0", | ||
| "type": "module", | ||
| "main": "./dist/index.ts", | ||
| "types": "./dist/index.ts", | ||
|
Comment on lines
5
to
6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 HIGH - Incorrect main and types entry points with TS source files Category: bug Description: Suggestion: Confidence: 75% |
||
| "private": true, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| { | ||
| "extends": "@calcom/tsconfig/base.json", | ||
| "compilerOptions": { | ||
| "target": "ES5", | ||
| "target": "ES2022", | ||
| "resolveJsonModule": true, | ||
| "experimentalDecorators": true, | ||
| "baseUrl": "./", | ||
|
Comment on lines
1
to
7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 HIGH - Missing TypeScript project reference configuration Category: quality Description: Suggestion: Confidence: 70% |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,20 @@ | ||
| import { createInstance } from "i18next"; | ||
| import type { i18n as I18nInstance } from "i18next"; | ||
| import path from "node:path"; | ||
| import { fileURLToPath } from "node:url"; | ||
| import { createRequire } from "node:module"; | ||
|
|
||
| import { WEBAPP_URL } from "@calcom/lib/constants"; | ||
| import { fetchWithTimeout } from "@calcom/lib/fetchWithTimeout"; | ||
| import logger from "@calcom/lib/logger"; | ||
|
|
||
| /* eslint-disable @typescript-eslint/no-require-imports */ | ||
| const { i18n } = require("@calcom/config/next-i18next.config"); | ||
| const path = require("node:path"); | ||
| const __filename = fileURLToPath(import.meta.url); | ||
| const __dirname = path.dirname(__filename); | ||
| const require = createRequire(import.meta.url); | ||
| const i18nConfig = require("@calcom/config/next-i18next.config"); | ||
| const { i18n } = i18nConfig; | ||
| const translationsPath = path.resolve(__dirname, "../../../../apps/web/public/static/locales/en/common.json"); | ||
| const englishTranslations: Record<string, string> = require(translationsPath); | ||
|
Comment on lines
+5
to
17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 HIGH - Using createRequire for CommonJS require() in ESM context Category: quality Description: Suggestion: Confidence: 65% |
||
| /* eslint-enable @typescript-eslint/no-require-imports */ | ||
|
|
||
| const translationCache = new Map<string, Record<string, string>>([["en-common", englishTranslations]]); | ||
| const i18nInstanceCache = new Map<string, I18nInstance>(); | ||
|
Comment on lines
19
to
20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 HIGH - Module-level mutable caches without cleanup strategy Category: bug Description: Suggestion: Confidence: 85% There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM - Hardcoded locale transformation without configuration Category: quality Description: Suggestion: Why this matters: Simpler code is easier to understand, test, and maintain. Reducing unnecessary abstraction lowers cognitive load and reduces places where bugs can hide. Standard library functions are well-tested and familiar to most developers. Confidence: 60% There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM - Potential null dereference without validation Category: quality Description: Suggestion: Confidence: 70% |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 HIGH - CommonJS require() import for qs-stringify
Agent: react
Category: quality
Description:
Using TypeScript's
import = require()syntax which compiles to CommonJS. While valid, this pattern may cause issues in pure ESM contexts.Suggestion:
Convert to ES Module import: 'import stringify from "qs-stringify";' if the package supports ESM.
Confidence: 75%
Rule:
ts_use_es_modules_import_exportReview ID:
0d8706e4-cb4f-47ad-8896-885907bfafa3Rate it 👍 or 👎 to improve future reviews | Powered by diffray