Skip to content

Commit db0db0d

Browse files
chore: add ESLint config and commands for linting JavaScript bindings.
Signed-off-by: victor.linroth.sensmetry <victor.linroth@sensmetry.com>
1 parent 9e1e6c6 commit db0db0d

5 files changed

Lines changed: 727 additions & 24 deletions

File tree

.github/workflows/js-wasm.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,19 @@ jobs:
7777
export WASM_BINDGEN_USE_BROWSER=1
7878
wasm-pack test --headless --chrome
7979
80-
- name: Build for Node.js and test
80+
- name: Build for Node.js
8181
run: |
8282
cd bindings/js
8383
npm install
84+
85+
- name: ESLint
86+
run: |
87+
cd bindings/js
88+
npm run lint
89+
90+
- name: Test with Node.js
91+
run: |
92+
cd bindings/js
8493
npm run test:browser
8594
8695
ci-gate:

bindings/js/eslint.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import { defineConfig } from "eslint/config";
4+
5+
export default defineConfig([
6+
{
7+
files: ["**/*.{js,mjs,cjs}"],
8+
ignores: [
9+
"browser_dist/**/*.js",
10+
"browser_pkg/**/*.js",
11+
"browser_test_dist/**/*.js",
12+
],
13+
plugins: { js },
14+
extends: ["js/recommended"],
15+
languageOptions: {
16+
globals: { ...globals.browser, ...globals.jasmine, ...globals.node },
17+
},
18+
},
19+
]);

0 commit comments

Comments
 (0)