build: fix prettier configuration
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 15 Aug 2023 14:29:34 +0000 (16:29 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 15 Aug 2023 14:29:34 +0000 (16:29 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
.prettierignore
.prettierrc.json [new file with mode: 0644]
CHANGELOG.md
README.md

index bd5535a6035b27160c376132126242ab9dedc4de..b1c05a9774badf691f78b811382fb1592c3eafcc 100644 (file)
@@ -1 +1,10 @@
+.nyc_output/
+benchmarks/internal/results/
+coverage/
+docs/**/*.html
+docs/**/*.css
+docs/**/*.js
+lib/
+outputs/
 pnpm-lock.yaml
+reports/
diff --git a/.prettierrc.json b/.prettierrc.json
new file mode 100644 (file)
index 0000000..80901f7
--- /dev/null
@@ -0,0 +1,6 @@
+{
+  "$schema": "https://json.schemastore.org/prettierrc",
+  "semi": false,
+  "singleQuote": true,
+  "trailingComma": "none"
+}
index 77bd77a69f9fca0824f824dbabe8b1f4099408b9..83e827088a6cb4c9185bc2e0681d738799284ba4 100644 (file)
@@ -729,15 +729,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ```js
 // Before
-const DynamicThreadPool = require("poolifier/lib/dynamic");
+const DynamicThreadPool = require('poolifier/lib/dynamic')
 // After
-const { DynamicThreadPool } = require("poolifier/lib/dynamic");
+const { DynamicThreadPool } = require('poolifier/lib/dynamic')
 ```
 
 But you should always prefer just using
 
 ```js
-const { DynamicThreadPool } = require("poolifier");
+const { DynamicThreadPool } = require('poolifier')
 ```
 
 #### New type definitions for input data and response
index abeb9f9f4386ead4df1597192dbadadc683c6923..98afab20652c43e742ebfa80140925ae21ec28e3 100644 (file)
--- a/README.md
+++ b/README.md
@@ -110,7 +110,7 @@ const { DynamicThreadPool, FixedThreadPool, PoolEvents, availableParallelism } =
 
 // a fixed worker_threads pool
 const pool = new FixedThreadPool(availableParallelism(), './yourWorker.js', {
-  errorHandler: e => console.error(e),
+  errorHandler: (e) => console.error(e),
   onlineHandler: () => console.info('worker is online')
 })
 
@@ -119,7 +119,7 @@ pool.emitter.on(PoolEvents.busy, () => console.info('Pool is busy'))
 
 // or a dynamic worker_threads pool
 const pool = new DynamicThreadPool(Math.floor(availableParallelism() / 2), availableParallelism(), './yourWorker.js', {
-  errorHandler: e => console.error(e),
+  errorHandler: (e) => console.error(e),
   onlineHandler: () => console.info('worker is online')
 })
 
@@ -131,10 +131,10 @@ pool.emitter.on(PoolEvents.busy, () => console.info('Pool is busy'))
 // so you can easy switch from one to another
 pool
   .execute()
-  .then(res => {
+  .then((res) => {
     console.info(res)
   })
-  .catch(err => {
+  .catch((err) => {
     console.error(err)
   })
 ```