Skip to content

Commit 31a1046

Browse files
droberts-ctrlodaurnimator
authored andcommitted
Fix build system for modern JS+github
- update github workflow with currently supported versions - update ESLint config (moves to new format)
1 parent d6362d1 commit 31a1046

5 files changed

Lines changed: 1718 additions & 1767 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
node-version: [12.x, 14.x, 16.x, 17.x]
16+
node-version: [20.x, 22.x, 24.x, 25.x]
1717

1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v6
2020
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v2
21+
uses: actions/setup-node@v6
2222
with:
2323
node-version: ${{ matrix.node-version }}
2424
cache: 'yarn'

eslint.config.mjs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import globals from "globals";
2+
import { defineConfig } from "eslint/config";
3+
4+
export default defineConfig([
5+
{ files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: {...globals.browser, ...globals.node, ...globals.worker} } },
6+
{ files: ["test/**/*.{js,mjs,cjs}"], languageOptions: { globals: globals.jest } },
7+
{
8+
"rules": {
9+
"indent": [
10+
"error",
11+
"tab",
12+
{
13+
"SwitchCase": 1
14+
}
15+
],
16+
"linebreak-style": [
17+
"error",
18+
"unix"
19+
],
20+
"no-empty": [
21+
2,
22+
{
23+
"allowEmptyCatch": true
24+
}
25+
],
26+
"no-unused-vars": [
27+
2,
28+
{
29+
"args": "none",
30+
"caughtErrors": "none"
31+
}
32+
],
33+
"semi": [
34+
"error",
35+
"always"
36+
]
37+
}
38+
}
39+
]);

package.json

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -17,70 +17,21 @@
1717
"url": "https://github.com/fengari-lua/fengari-interop/issues"
1818
},
1919
"homepage": "https://github.com/fengari-lua/fengari-interop",
20-
"peerDependencies": {
21-
"fengari": "^0.1.0"
22-
},
20+
"peerDependencies": { "fengari": "^0.1.0" },
2321
"main": "src/js.js",
2422
"directories": {
2523
"lib": "src",
2624
"test": "test"
2725
},
2826
"devDependencies": {
29-
"eslint": "^8.3.0",
27+
"eslint": "^9.39.1",
3028
"fengari": "^0.1.0",
31-
"jest": "^27.4.0"
29+
"globals": "^16.5.0",
30+
"jest": "^30.2.0"
3231
},
3332
"scripts": {
3433
"lint": "eslint src/ test/",
3534
"prepublishOnly": "git diff-index --quiet --cached HEAD -- && npm run lint && npm run test",
3635
"test": "jest"
37-
},
38-
"eslintConfig": {
39-
"env": {
40-
"browser": true,
41-
"es6": true,
42-
"node": true,
43-
"worker": true
44-
},
45-
"extends": "eslint:recommended",
46-
"rules": {
47-
"indent": [
48-
"error",
49-
"tab",
50-
{
51-
"SwitchCase": 1
52-
}
53-
],
54-
"linebreak-style": [
55-
"error",
56-
"unix"
57-
],
58-
"no-empty": [
59-
2,
60-
{
61-
"allowEmptyCatch": true
62-
}
63-
],
64-
"no-unused-vars": [
65-
2,
66-
{
67-
"args": "none"
68-
}
69-
],
70-
"semi": [
71-
"error",
72-
"always"
73-
]
74-
},
75-
"overrides": [
76-
{
77-
"files": [
78-
"test/*.js"
79-
],
80-
"env": {
81-
"jest": true
82-
}
83-
}
84-
]
8536
}
8637
}

src/js.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ if (typeof process !== "undefined") {
9191

9292
const global_env = (function(Object) {
9393
return typeof globalThis === 'object' ?
94-
globalThis // eslint-disable-line no-undef
94+
globalThis
9595
: (this ?
9696
// compat: strict mode is unsupported
9797
this

0 commit comments

Comments
 (0)