Skip to content

Commit c9f313e

Browse files
authored
Merge pull request #511 from zeromq/lint [skip ci]
2 parents 0651e45 + c3cb047 commit c9f313e

File tree

82 files changed

+5268
-982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+5268
-982
lines changed

.github/workflows/CI.yml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
matrix:
1515
os:
1616
- ubuntu-20.04
17-
- macos-latest
18-
- windows-latest
17+
- macos-11
18+
- windows-2019
1919
node_version:
2020
- 14
2121
node_arch:
@@ -30,29 +30,29 @@ jobs:
3030
- true
3131

3232
# include:
33-
# - os: windows-latest
34-
# node_version: 14
35-
# node_arch: x86
36-
# zmq_draft: false
37-
# zmq_shared: false
38-
# skip_gc_finalizer_tests: true
33+
# - os: windows-latest
34+
# node_version: 14
35+
# node_arch: x86
36+
# zmq_draft: false
37+
# zmq_shared: false
38+
# skip_gc_finalizer_tests: true
3939

40-
# - os: macos-11.0
41-
# node_version: 15
42-
# node_arch: arm64
43-
# zmq_draft: false
44-
# zmq_shared: false
40+
# - os: macos-11.0
41+
# node_version: 15
42+
# node_arch: arm64
43+
# zmq_draft: false
44+
# zmq_shared: false
4545

4646
env:
4747
ZMQ_VERSION: ${{ matrix.zmq_version }}
4848
ZMQ_DRAFT: ${{ matrix.zmq_draft }}
4949
ZMQ_SHARED: ${{ matrix.zmq_shared }}
5050
SKIP_GC_FINALIZER_TESTS: ${{ matrix.skip_gc_finalizer_tests }}
5151
steps:
52-
- uses: actions/checkout@v2
52+
- uses: actions/checkout@v3
5353

5454
- name: Cache
55-
uses: actions/cache@v2
55+
uses: actions/cache@v3
5656
with:
5757
path: |
5858
./node_modules/
@@ -66,8 +66,16 @@ jobs:
6666
restore-keys: |
6767
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ matrix.zmq_draft }}-ZMQ_VERSION:${{ matrix.zmq_version }}-Node:${{ matrix.node_version }}"
6868
69+
- name: Setup Cpp
70+
uses: aminya/setup-cpp@v1
71+
with:
72+
vcvarsall: ${{ contains(matrix.os, 'windows') }}
73+
cmake: true
74+
ninja: true
75+
architecture: ${{ matrix.node_arch }}
76+
6977
- name: Install Node
70-
uses: actions/setup-node@v2
78+
uses: actions/setup-node@v3
7179
with:
7280
node-version: ${{ matrix.node_version }}
7381
architecture: ${{ matrix.node_arch }}
@@ -77,11 +85,6 @@ jobs:
7785
run: |
7886
brew install libsodium
7987
80-
- uses: ilammy/msvc-dev-cmd@v1
81-
if: contains(matrix.os, 'windows')
82-
with:
83-
arch: ${{ matrix.node_arch }}
84-
8588
- name: Install Dependencies and Build
8689
run: npm install
8790

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
public-hoist-pattern[]=*
22
package-lock=false
3-
lockfile=false
3+
lockfile=true
44
prefer-frozen-lockfile=false

draft.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if (require(".").capability.draft) {
55
} else {
66
throw new Error(
77
"ZeroMQ draft features are not enabled in this build. " +
8-
"To enable support, (re)compile this library with --zmq-draft.",
8+
"To enable support, (re)compile this library with --zmq-draft.",
99
)
1010
}
1111

examples/majordomo/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ async function request(
4949
}
5050

5151
async function main() {
52-
for (const worker of workers) worker.start()
52+
for (const worker of workers) {
53+
worker.start()
54+
}
5355
broker.start()
5456

5557
/* Requests are issued in parallel. */
@@ -65,7 +67,9 @@ async function main() {
6567
request("coffee", "irish coffee"),
6668
])
6769

68-
for (const worker of workers) worker.stop()
70+
for (const worker of workers) {
71+
worker.stop()
72+
}
6973
broker.stop()
7074
}
7175

examples/queue/queue.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ export class Queue {
2020
}
2121

2222
async trySend() {
23-
if (this.sending) return
23+
if (this.sending) {
24+
return
25+
}
2426
this.sending = true
2527

2628
while (this.queue.length) {

examples/threaded-worker/processor.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ export class Processor {
3939
const output: string[] = Array.from({length: input.length})
4040
for await (const [pos, res] of this.output) {
4141
output[parseInt(pos.toString(), 10)] = res.toString()
42-
if (output.every(el => el !== undefined)) break
42+
if (output.every(el => el !== undefined)) {
43+
break
44+
}
4345
}
4446

4547
return output.join("")

examples/threaded-worker/threaded-worker.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ export class ThreadedWorker {
4242

4343
const listen = async () => {
4444
for await (const [sig] of this.signal) {
45-
if (sig.toString() === "stop") this.stop()
45+
if (sig.toString() === "stop") {
46+
this.stop()
47+
}
4648
}
4749
}
4850

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@
3131
"chai": ">=4.3",
3232
"choma": ">= 1.2",
3333
"deasync": "^0.1.21",
34-
"eslint-config-atomic": "^1.16.2",
35-
"eslint-plugin-prettier": "^3.4.0",
34+
"eslint-config-atomic": "^1.18.1",
35+
"eslint-plugin-prettier": "^4.2.1",
3636
"fs-extra": "^10.0.0",
3737
"gunzip-maybe": "^1.4.2",
3838
"mocha": ">=9.0",
3939
"node-addon-api": "^4.0.0",
4040
"node-fetch": "^2.6.1",
4141
"prebuildify": "^4.1.2",
42-
"prettier": "^2.3.2",
42+
"prettier": "^2.7.1",
4343
"semver": ">=7",
4444
"shx": "^0.3.3",
4545
"tar-fs": "^2.1.1",
4646
"ts-morph": "^11.0.3",
4747
"ts-node": ">=10",
48-
"typescript": ">=4.3",
48+
"typescript": "4.3",
4949
"weak-napi": "^2.0.2"
5050
},
5151
"engines": {

0 commit comments

Comments
 (0)