tools: refactor lint-sh.js to esm module

PR-URL: https://github.com/nodejs/node/pull/42942
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
Feng Yu
2022-05-08 23:08:10 +08:00
committed by GitHub
parent 5a217a2034
commit be1ca70515
2 changed files with 5 additions and 5 deletions

View File

@@ -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

View File

@@ -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');