Skip to content

fix: convert require() to ESM imports in scripts and fix lint errors#111

Open
Akash-bajpai wants to merge 1 commit into
accordproject:mainfrom
Akash-bajpai:fix/convert-require-to-esm-scripts
Open

fix: convert require() to ESM imports in scripts and fix lint errors#111
Akash-bajpai wants to merge 1 commit into
accordproject:mainfrom
Akash-bajpai:fix/convert-require-to-esm-scripts

Conversation

@Akash-bajpai
Copy link
Copy Markdown

Problem

The scripts/tag.js and scripts/updateRuntimeDependencies.js files were using require() style imports which violated the @typescript-eslint/no-require-imports rule, causing 7 lint errors.

Additionally, updateRuntimeDependencies.js had an unused expression (!existsSync && mkdirSync) which violated @typescript-eslint/no-unused-expressions.

Fix

  • Converted require() to ESM import statements in both files
  • Removed unused join import from path
  • Replaced logical expression with explicit if statement for clarity

Result

Lint errors reduced from 7 to 0. Only pre-existing warnings remain.

Relates to GSoC 2026 proposal: LLM Based Template Logic Executor

@Akash-bajpai Akash-bajpai force-pushed the fix/convert-require-to-esm-scripts branch from a8ff848 to 392a22e Compare March 20, 2026 16:14
…ssions

Signed-off-by: Akash-bajpai <aakashbajpai2003@gmail.com>
@Akash-bajpai Akash-bajpai force-pushed the fix/convert-require-to-esm-scripts branch from 392a22e to 15bd377 Compare March 20, 2026 16:20
@Akash-bajpai
Copy link
Copy Markdown
Author

Hi @dselman and @sanketshevkar! I'm Aakash Bajpai, a GSoC 2026 applicant. I've submitted a proposal for the LLM Based Template Logic Executor project. This is my first contribution to the repo — happy to make any changes needed! 🙏

@Akash-bajpai
Copy link
Copy Markdown
Author

Hi @dselman and @sanketshevkar GSoC 2026 applicant here. This is my first contribution — happy to make any changes! 🙏

@Akash-bajpai
Copy link
Copy Markdown
Author

Hi @dselman and @sanketshevkar! GSoC 2026 applicant here — happy to make any changes needed! 🙏

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 attempts to resolve lint issues in repository scripts by converting CommonJS imports to ESM syntax and replacing an unused logical expression with an explicit conditional.

Changes:

  • Converted require() calls in scripts to import statements.
  • Simplified runtime dependency packaging helpers.
  • Removed unused imports.

Reviewed changes

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

File Description
scripts/updateRuntimeDependencies.js Updates imports and directory helper logic for runtime declaration generation.
scripts/tag.js Updates semver import syntax and tag string quoting for npm publish tagging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const { readFileSync, writeFileSync, existsSync, mkdirSync, rmSync } = require('fs');
const tar = require('tar');
const path = require('path');
import { readFileSync, writeFileSync, existsSync, mkdirSync, rmSync } from 'fs';
Comment thread scripts/tag.js
'use strict';

const semver = require('semver');
import semver from "semver";
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.

2 participants