Skip to content

Commit c6a29cc

Browse files
build: update npm command for format (#5603)
1 parent a750518 commit c6a29cc

File tree

7 files changed

+8
-7
lines changed

7 files changed

+8
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{".":"12.0.0-beta-3"}
1+
{ ".": "12.0.0-beta-3" }

.github/workflows/mocha.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
format:
2020
uses: ./.github/workflows/npm-script.yml
2121
with:
22-
npm-script: format
22+
npm-script: format:check
2323

2424
lint:
2525
uses: ./.github/workflows/npm-script.yml

docs-next/src/content/docs/running/configuring.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title: Configuring Mocha (Node.js)
99
Mocha supports configuration files, typical of modern command-line tools, in several formats:
1010

1111
- **JavaScript**: Create a `.mocharc.js` (or `.mocharc.cjs` when using [`"type"="module"`](/explainers/nodejs-native-esm-support) in your `package.json`)
12-
in your project's root directory, and export an object (`module.exports = {/* ... */}`) containing your configuration. For native ESM and using `type="module"`
12+
in your project's root directory, and export an object (`module.exports = {/* ... */}`) containing your configuration. For native ESM and using `type="module"`
1313
or using `.mjs`, use a default export (`default export {/* ... */}`).
1414
- **YAML**: Create a `.mocharc.yaml` (or `.mocharc.yml`) in your project's root directory.
1515
- **JSON**: Create a `.mocharc.json` (or `.mocharc.jsonc`) in your project's root directory.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2258,7 +2258,7 @@ The HTML reporter is the default reporter when running Mocha in the browser. It
22582258
Mocha supports configuration files, typical of modern command-line tools, in several formats:
22592259

22602260
- **JavaScript**: Create a `.mocharc.js` (or `.mocharc.cjs` when using [`"type"="module"`](/explainers/nodejs-native-esm-support) in your `package.json`)
2261-
in your project's root directory, and export an object (`module.exports = {/* ... */}`) containing your configuration. For native ESM and using `type="module"`
2261+
in your project's root directory, and export an object (`module.exports = {/* ... */}`) containing your configuration. For native ESM and using `type="module"`
22622262
or using `.mjs`, use a default export (`default export {/* ... */}`).
22632263
in your project's root directory, and export an object (`module.exports = {/* ... */}`) containing your configuration.
22642264
- **YAML**: Create a `.mocharc.yaml` (or `.mocharc.yml`) in your project's root directory.

lib/nodejs/esm-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const requireModule = async (file, esmDecorator) => {
9898
return require(file);
9999
} catch (requireErr) {
100100
debug("requireModule caught err: %O", requireErr.message);
101-
if (requireErr.name === 'TSError') {
101+
if (requireErr.name === "TSError") {
102102
throw requireErr;
103103
}
104104
try {

mocha.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* eslint-disable-next-line n/no-missing-import */
33
import "./mocha.js";
44

5-
const {mocha, Mocha} = globalThis;
5+
const { mocha, Mocha } = globalThis;
66

77
const mochaExports = {
88
after: (...args) => globalThis.after?.(...args),

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
"docs:build-new": "cd docs-next && npm i && npm run build-with-old",
5353
"docs:preview": "http-server docs/_site -o",
5454
"docs": "run-s docs-clean docs:api docs:build docs:build-new",
55-
"format": "prettier --write .",
55+
"format:check": "prettier --check .",
56+
"format:fix": "prettier --write .",
5657
"lint:installed-check": "installed-check --engine-check",
5758
"lint:knip": "knip --cache",
5859
"lint:code": "eslint . --max-warnings 0",

0 commit comments

Comments
 (0)