Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import globals from "globals";
import { defineConfig } from "eslint/config";

export default defineConfig([
{ files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: {...globals.browser, ...globals.node, ...globals.worker, ...globals.jest} } },
Comment thread
daurnimator marked this conversation as resolved.
Outdated
{
"rules": {
"indent": [
"error",
"tab",
{
"SwitchCase": 1
}
],
"linebreak-style": [
"error",
"unix"
],
"no-empty": [
2,
{
"allowEmptyCatch": true
}
],
"no-unused-vars": [
2,
{
"args": "none"
}
],
"semi": [
"error",
"always"
]
}
}
]);
57 changes: 4 additions & 53 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,70 +17,21 @@
"url": "https://github.com/fengari-lua/fengari-interop/issues"
},
"homepage": "https://github.com/fengari-lua/fengari-interop",
"peerDependencies": {
"fengari": "^0.1.0"
},
"peerDependencies": { "fengari": "^0.1.0" },
"main": "src/js.js",
"directories": {
"lib": "src",
"test": "test"
},
"devDependencies": {
"eslint": "^8.3.0",
"eslint": "^9.39.1",
"fengari": "^0.1.0",
"jest": "^27.4.0"
"globals": "^16.5.0",
"jest": "^30.2.0"
},
"scripts": {
"lint": "eslint src/ test/",
"prepublishOnly": "git diff-index --quiet --cached HEAD -- && npm run lint && npm run test",
"test": "jest"
},
"eslintConfig": {
"env": {
"browser": true,
"es6": true,
"node": true,
"worker": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
"tab",
{
"SwitchCase": 1
}
],
"linebreak-style": [
"error",
"unix"
],
"no-empty": [
2,
{
"allowEmptyCatch": true
}
],
"no-unused-vars": [
2,
{
"args": "none"
}
],
"semi": [
"error",
"always"
]
},
"overrides": [
{
"files": [
"test/*.js"
],
"env": {
"jest": true
}
}
]
}
}
4 changes: 2 additions & 2 deletions src/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ let custom_inspect_symbol;
if (typeof process !== "undefined") {
try { /* for node.js */
custom_inspect_symbol = require('util').inspect.custom;
} catch (e) {}
} catch {}
}

const global_env = (function(Object) {
return typeof globalThis === 'object' ?
globalThis // eslint-disable-line no-undef
globalThis
: (this ?
// compat: strict mode is unsupported
this
Expand Down
Loading