diff --git a/.eslintrc.json b/.eslintrc.json index efc2ee546..50eef44ec 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,7 +6,7 @@ }, "parserOptions": { "ecmaVersion": 2019, - "sourceType": "script" + "sourceType": "module" }, "extends": "eslint:recommended", "rules": { @@ -30,9 +30,6 @@ "env": { "browser": true, "node": false - }, - "parserOptions": { - "sourceType": "module" } } ] diff --git a/build/vnu-jar.js b/build/vnu-jar.mjs similarity index 92% rename from build/vnu-jar.js rename to build/vnu-jar.mjs index d725a378c..fe9661f66 100644 --- a/build/vnu-jar.js +++ b/build/vnu-jar.mjs @@ -6,10 +6,8 @@ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ -'use strict' - -const { execFile, spawn } = require('node:child_process') -const vnu = require('vnu-jar') +import { execFile, spawn } from 'node:child_process' +import vnu from 'vnu-jar' execFile('java', ['-version'], (error, stdout, stderr) => { if (error) { diff --git a/package.json b/package.json index db1f90aaa..037a6cc65 100644 --- a/package.json +++ b/package.json @@ -24,12 +24,12 @@ "serve": "hugo server --port 4000 --disableFastRender", "serve-only": "npx sirv-cli _site --port 4000", "test": "npm-run-all build --parallel --continue-on-error --aggregate-output test-*", - "test-eslint": "eslint --ignore-path .gitignore --cache --cache-location .cache/.eslintcache --report-unused-disable-directives .", + "test-eslint": "eslint --ignore-path .gitignore --cache --cache-location .cache/.eslintcache --report-unused-disable-directives --ext .js,.mjs .", "test-fusv": "fusv src/assets/scss/", "test-stylelint": "stylelint src/assets/scss/ --cache --cache-location .cache/.stylelintcache", "test-markdownlint": "markdownlint-cli2 \"**/*.md\" \"!**/node_modules/**\"", "test-linkinator": "linkinator _site --recurse --silent --skip \"^(?!http://localhost)\"", - "test-vnu": "node build/vnu-jar.js", + "test-vnu": "node build/vnu-jar.mjs", "test-lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json", "netlify": "cross-env-shell HUGO_BASEURL=$DEPLOY_PRIME_URL npm run build" },