From 163bde4027cb2b2812178724b03a10f3464604c4 Mon Sep 17 00:00:00 2001 From: Ayush Pahwa Date: Thu, 19 Sep 2024 16:20:24 +0800 Subject: [PATCH] chore: Revert "feat: telemetry added for current linter (#36400)" (#36411) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 6ab9684b737290ebc2476ca959477246d1b3766b. ## Description PR to revert changes made in telemetry for linter Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /test js ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 00ef3209fe35ed23db8aa7df0958f95359eb1363 > Cypress dashboard. > Tags: `@tag.JS` > Spec: >
Thu, 19 Sep 2024 07:56:21 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No ## Summary by CodeRabbit - **New Features** - Simplified linting process by removing telemetry-related functionality. - **Bug Fixes** - Improved performance and maintainability of the linting process. - **Refactor** - Updated method for retrieving keys from an object to use standard JavaScript functionality. --- .../src/plugins/Linting/utils/getLintingErrors.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/app/client/src/plugins/Linting/utils/getLintingErrors.ts b/app/client/src/plugins/Linting/utils/getLintingErrors.ts index 2a681a875c4..74b0b60ea62 100644 --- a/app/client/src/plugins/Linting/utils/getLintingErrors.ts +++ b/app/client/src/plugins/Linting/utils/getLintingErrors.ts @@ -36,8 +36,6 @@ import setters from "workers/Evaluation/setters"; import { isMemberExpressionNode } from "@shared/ast/src"; import { generate } from "astring"; import getInvalidModuleInputsError from "ee/plugins/Linting/utils/getInvalidModuleInputsError"; -import { startAndEndSpanForFn } from "UITelemetry/generateTraces"; -import { objectKeys } from "@appsmith/utils"; const EvaluationScriptPositions: Record = {}; @@ -69,7 +67,7 @@ function generateLintingGlobalData(data: Record) { libAccessors.forEach((accessor) => (globalData[accessor] = true)); // Add all supported web apis - objectKeys(SUPPORTED_WEB_APIS).forEach( + Object.keys(SUPPORTED_WEB_APIS).forEach( (apiName) => (globalData[apiName] = true), ); @@ -197,16 +195,7 @@ export default function getLintingErrors({ const lintingGlobalData = generateLintingGlobalData(data); const lintingOptions = lintOptions(lintingGlobalData); - startAndEndSpanForFn( - "Linter", - // adding some metrics to compare the performance changes with eslint - { - linter: "JSHint", - linesOfCodeLinted: originalBinding.split("\n").length, - codeSizeInChars: originalBinding.length, - }, - () => jshint(script, lintingOptions), - ); + jshint(script, lintingOptions); const sanitizedJSHintErrors = sanitizeJSHintErrors(jshint.errors, scriptPos); const jshintErrors: LintError[] = sanitizedJSHintErrors.map((lintError) => convertJsHintErrorToAppsmithLintError(