From e810ae02a0d7bc24ec5663cb03b00bb9aa81fea7 Mon Sep 17 00:00:00 2001 From: Feng Yu Date: Sun, 8 May 2022 23:08:10 +0800 Subject: [PATCH] tools: refactor lint-sh.js to esm module PR-URL: https://github.com/nodejs/node/pull/42942 Reviewed-By: Antoine du Hamel Reviewed-By: Darshan Sen --- .github/workflows/linters.yml | 2 +- tools/{lint-sh.js => lint-sh.mjs} | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename tools/{lint-sh.js => lint-sh.mjs} (96%) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 7373aabaca0456..79e4696d048375 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -156,7 +156,7 @@ jobs: persist-credentials: false - run: shellcheck -V - name: Lint Shell scripts - run: tools/lint-sh.js . + run: tools/lint-sh.mjs . lint-codeowners: if: github.event.pull_request.draft == false runs-on: ubuntu-latest diff --git a/tools/lint-sh.js b/tools/lint-sh.mjs similarity index 96% rename from tools/lint-sh.js rename to tools/lint-sh.mjs index 378cb38af28744..681c7cd5665dce 100755 --- a/tools/lint-sh.js +++ b/tools/lint-sh.mjs @@ -1,9 +1,9 @@ #!/usr/bin/env node -'use strict'; -const { execSync, spawn } = require('child_process'); -const { promises: fs, readdirSync, statSync } = require('fs'); -const { extname, join, relative, resolve } = require('path'); +import { execSync, spawn } from 'node:child_process'; +import { promises as fs, readdirSync, statSync } from 'node:fs'; +import { extname, join, relative, resolve } from 'node:path'; +import process from 'node:process'; const FIX_MODE_ENABLED = process.argv.includes('--fix'); const USE_NPX = process.argv.includes('--from-npx');