Skip to content

Commit 3daa21a

Browse files
eslint: run in github ci and locally with npm run lint
This is provided alongside pre-commit doing it as well. Signed-off-by: Erik Sundell <erik.sundell+2025@sensmetry.com>
1 parent f7d6fe1 commit 3daa21a

5 files changed

Lines changed: 730 additions & 28 deletions

File tree

.github/workflows/js-wasm.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,29 @@ jobs:
5151
echo "test=$test" >> "$GITHUB_OUTPUT"
5252
echo "gate=$gate" >> "$GITHUB_OUTPUT"
5353
54+
lint:
55+
name: JS/WASM Lints
56+
needs: [plan]
57+
if: needs.plan.outputs.test == 'true'
58+
runs-on: ubuntu-24.04
59+
defaults:
60+
run:
61+
working-directory: bindings/js
62+
63+
steps:
64+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
65+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
66+
with:
67+
node-version: 24
68+
cache: npm
69+
cache-dependency-path: bindings/js/package-lock.json
70+
71+
- name: Install dependencies
72+
run: npm ci
73+
74+
- name: Run linter
75+
run: npm run lint
76+
5477
test:
5578
name: JS/WASM Tests
5679
needs: [plan]

bindings/js/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,16 @@ npm run test:browser
5151

5252
## Formatting and linting
5353

54-
Format and lint all code based on configuration in `.pre-commit-config.yaml`,
55-
either with prek or pre-commit, available to install via uv or pip.
54+
Format Rust code and run linters for Rust and JavaScript:
5655

5756
```sh
58-
prek run -a
57+
./scripts/run_chores.sh
58+
```
59+
60+
You can also run the lint for JavaScript separately with
5961

60-
# like this, you ensure this formatting is run before git commits are made
61-
prek install
62+
```sh
63+
npm run lint
6264
```
65+
66+
assuming you have already installed the dependencies with `npm install`.

0 commit comments

Comments
 (0)