Skip to content

Commit 7719790

Browse files
Update code as per review
Fix ESLint config Add Node 20.x to CI script Remove ESLint comments
1 parent e82983c commit 7719790

8 files changed

Lines changed: 8 additions & 9 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

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

1818
steps:
1919
- uses: actions/checkout@v2

eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ export default defineConfig([
2727
"no-unused-vars": [
2828
2,
2929
{
30-
"args": "none"
30+
"args": "none",
31+
"caughtErrors": "none"
3132
}
3233
],
3334
"semi": [

src/lauxlib.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,6 @@ if (typeof process === "undefined") {
968968
lf.buff[lf.n++] = com.c; /* 'c' is the first character of the stream */
969969
let status = lua_load(L, getF, lf, lua_tostring(L, -1), mode);
970970
let readstatus = lf.err;
971-
// eslint-disable-next-line no-unused-vars
972971
if (filename) try { fs.closeSync(lf.f); } catch (e) {} /* close file (even in case of errors) */
973972
if (readstatus) {
974973
lua_settop(L, fnameindex); /* ignore results from 'lua_load' */

src/lbaselib.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ if (typeof process === "undefined") {
9797
try {
9898
/* If the string is valid utf8, then we can use to_jsstring */
9999
s = to_jsstring(s);
100-
} catch (e) { // eslint-disable-line no-unused-vars
100+
} catch (e) {
101101
/* otherwise push copy of raw array */
102102
let copy = new Uint8Array(s.length);
103103
copy.set(s);
@@ -269,7 +269,7 @@ const luaB_ipairs = function(L) {
269269
const b_str2int = function(s, base) {
270270
try {
271271
s = to_jsstring(s);
272-
} catch (e) { // eslint-disable-line no-unused-vars
272+
} catch (e) {
273273
return null;
274274
}
275275
let r = /^[\t\v\f \n\r]*([+-]?)0*([0-9A-Za-z]+)[\t\v\f \n\r]*$/.exec(s);

src/ldo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ const luaD_rawrunprotected = function(L, f, ud) {
424424
}
425425

426426
lj.status = LUA_ERRRUN;
427-
} catch (e) { //eslint-disable-line no-unused-vars
427+
} catch (e) {
428428
if (lj.status === LUA_OK) {
429429
/* also failed */
430430
lj.status = -1;

src/loadlib.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ if (typeof process !== "undefined") { // Only with Node
202202
try {
203203
let fd = fs.openSync(filename, 'r');
204204
fs.closeSync(fd);
205-
} catch (e) { // eslint-disable-line no-unused-vars
205+
} catch (e) {
206206
return false;
207207
}
208208
return true;

src/lobject.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ const lua_strx2number = function(s) {
478478
const lua_str2number = function(s) {
479479
try {
480480
s = to_jsstring(s);
481-
} catch (e) { //eslint-disable-line no-unused-vars
481+
} catch (e) {
482482
return null;
483483
}
484484
/* use a regex to validate number and also to get length

test/test-suite/ltests.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,6 @@ const checkpanic = function(L) {
691691
try { /* set jump buffer */
692692
runJS(L, L1, { script: code, offset: 0 }); /* run code unprotected */
693693
lua.lua_pushliteral(L, "no errors");
694-
// eslint-disable-next-line no-unused-vars
695694
} catch (e) { /* error handling */
696695
/* move error message to original state */
697696
lua.lua_pushstring(L, lua.lua_tostring(L1, -1));

0 commit comments

Comments
 (0)