Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run lint on the whole project #511

Merged
merged 6 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
matrix:
os:
- ubuntu-20.04
- macos-latest
- windows-latest
- macos-11
- windows-2019
node_version:
- 14
node_arch:
Expand All @@ -30,29 +30,29 @@ jobs:
- true

# include:
# - os: windows-latest
# node_version: 14
# node_arch: x86
# zmq_draft: false
# zmq_shared: false
# skip_gc_finalizer_tests: true
# - os: windows-latest
# node_version: 14
# node_arch: x86
# zmq_draft: false
# zmq_shared: false
# skip_gc_finalizer_tests: true

# - os: macos-11.0
# node_version: 15
# node_arch: arm64
# zmq_draft: false
# zmq_shared: false
# - os: macos-11.0
# node_version: 15
# node_arch: arm64
# zmq_draft: false
# zmq_shared: false

env:
ZMQ_VERSION: ${{ matrix.zmq_version }}
ZMQ_DRAFT: ${{ matrix.zmq_draft }}
ZMQ_SHARED: ${{ matrix.zmq_shared }}
SKIP_GC_FINALIZER_TESTS: ${{ matrix.skip_gc_finalizer_tests }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
./node_modules/
Expand All @@ -66,8 +66,16 @@ jobs:
restore-keys: |
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ matrix.zmq_draft }}-ZMQ_VERSION:${{ matrix.zmq_version }}-Node:${{ matrix.node_version }}"

- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
vcvarsall: ${{ contains(matrix.os, 'windows') }}
cmake: true
ninja: true
architecture: ${{ matrix.node_arch }}

- name: Install Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
architecture: ${{ matrix.node_arch }}
Expand All @@ -77,11 +85,6 @@ jobs:
run: |
brew install libsodium

- uses: ilammy/msvc-dev-cmd@v1
if: contains(matrix.os, 'windows')
with:
arch: ${{ matrix.node_arch }}

- name: Install Dependencies and Build
run: npm install

Expand Down
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
public-hoist-pattern[]=*
package-lock=false
lockfile=false
lockfile=true
prefer-frozen-lockfile=false
2 changes: 1 addition & 1 deletion draft.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if (require(".").capability.draft) {
} else {
throw new Error(
"ZeroMQ draft features are not enabled in this build. " +
"To enable support, (re)compile this library with --zmq-draft.",
"To enable support, (re)compile this library with --zmq-draft.",
)
}

Expand Down
8 changes: 6 additions & 2 deletions examples/majordomo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ async function request(
}

async function main() {
for (const worker of workers) worker.start()
for (const worker of workers) {
worker.start()
}
broker.start()

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

for (const worker of workers) worker.stop()
for (const worker of workers) {
worker.stop()
}
broker.stop()
}

Expand Down
4 changes: 3 additions & 1 deletion examples/queue/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export class Queue {
}

async trySend() {
if (this.sending) return
if (this.sending) {
return
}
this.sending = true

while (this.queue.length) {
Expand Down
4 changes: 3 additions & 1 deletion examples/threaded-worker/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export class Processor {
const output: string[] = Array.from({length: input.length})
for await (const [pos, res] of this.output) {
output[parseInt(pos.toString(), 10)] = res.toString()
if (output.every(el => el !== undefined)) break
if (output.every(el => el !== undefined)) {
break
}
}

return output.join("")
Expand Down
4 changes: 3 additions & 1 deletion examples/threaded-worker/threaded-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export class ThreadedWorker {

const listen = async () => {
for await (const [sig] of this.signal) {
if (sig.toString() === "stop") this.stop()
if (sig.toString() === "stop") {
this.stop()
}
}
}

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@
"chai": ">=4.3",
"choma": ">= 1.2",
"deasync": "^0.1.21",
"eslint-config-atomic": "^1.16.2",
"eslint-plugin-prettier": "^3.4.0",
"eslint-config-atomic": "^1.18.1",
"eslint-plugin-prettier": "^4.2.1",
"fs-extra": "^10.0.0",
"gunzip-maybe": "^1.4.2",
"mocha": ">=9.0",
"node-addon-api": "^4.0.0",
"node-fetch": "^2.6.1",
"prebuildify": "^4.1.2",
"prettier": "^2.3.2",
"prettier": "^2.7.1",
"semver": ">=7",
"shx": "^0.3.3",
"tar-fs": "^2.1.1",
"ts-morph": "^11.0.3",
"ts-node": ">=10",
"typescript": ">=4.3",
"typescript": "4.3",
"weak-napi": "^2.0.2"
},
"engines": {
Expand Down
Loading