Skip to content

Commit

Permalink
fix eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
kpinter-iohk committed Sep 20, 2024
1 parent a0cf1c0 commit d08cea8
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 30 deletions.
20 changes: 0 additions & 20 deletions offchain/.eslint.config.cjs

This file was deleted.

16 changes: 8 additions & 8 deletions offchain/esbuild.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as esbuild from "esbuild"
import * as esbuild from "esbuild";

esbuild.build({
entryPoints: [ './entry.js' ],
outfile: 'dist/index.js',
entryPoints: [ "./entry.js" ],
outfile: "dist/index.js",
bundle: true,
platform: 'node',
format: 'esm',
platform: "node",
format: "esm",
treeShaking: true,
logLevel: 'error',
logLevel: "error",
minify: true,
packages: 'external',
})
packages: "external",
});
2 changes: 1 addition & 1 deletion offchain/esbuild/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as esbuild from "esbuild";
import { buildOptions } from "./config.js";

if (process.argv.length < 4) {
throw `usage: node bundle.js ENTRY_POINT OUTPUT_FILENAME`;
throw "usage: node bundle.js ENTRY_POINT OUTPUT_FILENAME";
}

esbuild.build(
Expand Down
2 changes: 1 addition & 1 deletion offchain/esbuild/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import http from "node:http";
import * as url from "url";

if (process.argv.length < 6) {
throw `usage: node serve.js ENTRY_POINT OUTPUT_FILE SERVE_DIR PORT`;
throw "usage: node serve.js ENTRY_POINT OUTPUT_FILE SERVE_DIR PORT";
}

const ctx = await esbuild.context(
Expand Down
23 changes: 23 additions & 0 deletions offchain/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import js from "@eslint/js";
import globals from "globals";

export default [
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 'latest',
globals: {
...globals.browser,
...globals.commonjs,
...globals.es2021,
...globals.node,
}
},
rules: {
indent: ['error', 2],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'double'],
semi: ['error', 'always'],
},
},
];
17 changes: 17 additions & 0 deletions offchain/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions offchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"bip39": "^3.1.0",
"blakejs": "1.2.1",
"bufferutil": "4.0.5",
"globals": "^15.9.0",
"isomorphic-ws": "^5.0.0",
"puppeteer-core": "^15.3.2",
"reconnecting-websocket": "4.4.0",
Expand Down

0 comments on commit d08cea8

Please sign in to comment.