Skip to content

Commit 499938c

Browse files
committed
create eslint config & add CI job to run it
1 parent 141c29a commit 499938c

File tree

4 files changed

+489
-9
lines changed

4 files changed

+489
-9
lines changed

.github/workflows/pre-commit-hooks.yml

+12
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,15 @@ jobs:
2929
run: cargo clippy
3030
- name: cargo fmt
3131
run: cargo fmt --check
32+
33+
eslint:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: actions/setup-node@v4
38+
with:
39+
node-version: 20
40+
cache: yarn
41+
- run: yarn install
42+
- run: yarn run eslint
43+
working-directory: node-binding

node-binding/eslint.config.mjs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import globals from "globals";
2+
import pluginJs from "@eslint/js";
3+
4+
5+
export default [
6+
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}},
7+
{languageOptions: { globals: globals.node }},
8+
pluginJs.configs.recommended,
9+
];

node-binding/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
},
1010
"license": "MIT",
1111
"devDependencies": {
12+
"@eslint/js": "^9.11.0",
1213
"@napi-rs/cli": "^2.18.4",
13-
"ava": "^6.0.1"
14+
"ava": "^6.0.1",
15+
"eslint": "^9.11.0",
16+
"globals": "^15.9.0"
1417
},
1518
"ava": {
1619
"timeout": "3m"

0 commit comments

Comments
 (0)