File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import tseslint from "typescript-eslint" ;
2+
3+ export default tseslint . config (
4+ {
5+ ignores : [
6+ "dist/" ,
7+ "node_modules/" ,
8+ "wasm/" ,
9+ "webpack.config.js" ,
10+ "playwright.config.ts" ,
11+ "scripts/" ,
12+ "tests/" ,
13+ ] ,
14+ } ,
15+ tseslint . configs . recommended ,
16+ {
17+ files : [ "src/**/*.{ts,tsx}" ] ,
18+ languageOptions : {
19+ parserOptions : {
20+ project : [ "./tsconfig.json" ] ,
21+ tsconfigRootDir : import . meta. dirname ,
22+ } ,
23+ } ,
24+ } ,
25+ ) ;
Original file line number Diff line number Diff line change 22 "name" : " @bitgo/wasm-web-ui" ,
33 "version" : " 0.1.0" ,
44 "description" : " Web frontend for BitGoWASM libraries" ,
5+ "type" : " module" ,
56 "repository" : {
67 "type" : " git" ,
78 "url" : " git+https://github.com/BitGo/BitGoWASM.git"
Original file line number Diff line number Diff line change 1010 * Usage: node scripts/extract-samples.js
1111 */
1212
13- const fs = require ( "fs" ) ;
14- const path = require ( "path" ) ;
13+ import fs from "fs" ;
14+ import path from "path" ;
15+ import { fileURLToPath } from "url" ;
16+
17+ const __filename = fileURLToPath ( import . meta. url ) ;
18+ const __dirname = path . dirname ( __filename ) ;
1519
1620const FIXTURES_DIR = path . resolve ( __dirname , "../src/fixtures/fixed-script" ) ;
1721const OUTPUT_FILE = path . resolve ( __dirname , "../src/wasm-utxo/parser/samples.ts" ) ;
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ let currentPath: string | null = null;
3232 */
3333export function parseHash ( hash : string = location . hash ) : ParsedHash {
3434 // Remove leading # if present
35- let hashContent = hash . startsWith ( "#" ) ? hash . slice ( 1 ) : hash ;
35+ const hashContent = hash . startsWith ( "#" ) ? hash . slice ( 1 ) : hash ;
3636
3737 // Default to root path
3838 if ( ! hashContent || hashContent === "/" ) {
Original file line number Diff line number Diff line change @@ -703,7 +703,7 @@ class SolanaTransactionParser extends BaseComponent {
703703 }
704704
705705 private share ( ) : void {
706- copyToClipboard ( location . href , this . $ ( ".btn" ) ! ) ;
706+ void copyToClipboard ( location . href , this . $ ( ".btn" ) ! ) ;
707707 }
708708
709709 private clear ( ) : void {
Original file line number Diff line number Diff line change @@ -507,7 +507,7 @@ class AddressConverter extends BaseComponent {
507507 {
508508 class : "copy-btn" ,
509509 style : "margin-left: 0.5rem" ,
510- onclick : ( e : Event ) => copyToClipboard ( hexString , e . target as HTMLElement ) ,
510+ onclick : ( e : Event ) => void copyToClipboard ( hexString , e . target as HTMLElement ) ,
511511 } ,
512512 "Copy" ,
513513 ) ,
@@ -569,7 +569,7 @@ class AddressConverter extends BaseComponent {
569569 "button" ,
570570 {
571571 class : "copy-btn" ,
572- onclick : ( e : Event ) => copyToClipboard ( outcome . address , e . target as HTMLElement ) ,
572+ onclick : ( e : Event ) => void copyToClipboard ( outcome . address , e . target as HTMLElement ) ,
573573 } ,
574574 "Copy" ,
575575 ) ,
@@ -595,7 +595,7 @@ class AddressConverter extends BaseComponent {
595595 }
596596
597597 private share ( ) : void {
598- copyToClipboard ( location . href , this . $ ( ".btn" ) ! ) ;
598+ void copyToClipboard ( location . href , this . $ ( ".btn" ) ! ) ;
599599 }
600600
601601 private clear ( ) : void {
Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ function renderTreeNode(
231231 class : "copy-btn" ,
232232 onclick : ( e : Event ) => {
233233 e . stopPropagation ( ) ;
234- copyToClipboard ( getFullValue ( node . value ) , e . target as HTMLElement ) ;
234+ void copyToClipboard ( getFullValue ( node . value ) , e . target as HTMLElement ) ;
235235 } ,
236236 } ,
237237 "Copy" ,
@@ -1437,7 +1437,8 @@ class PsbtTxParser extends BaseComponent {
14371437 this . applyPsbtEdit ( ) ;
14381438 } catch ( e ) {
14391439 if ( errorEl ) {
1440- errorEl . replaceChildren ( h ( "div" , { class : "error-message" } , `${ e } ` ) ) ;
1440+ const message = e instanceof Error ? e . message : String ( e ) ;
1441+ errorEl . replaceChildren ( h ( "div" , { class : "error-message" } , message ) ) ;
14411442 }
14421443 }
14431444 }
@@ -1502,7 +1503,7 @@ class PsbtTxParser extends BaseComponent {
15021503 }
15031504
15041505 private share ( ) : void {
1505- copyToClipboard ( location . href , this . $ ( ".btn" ) ! ) ;
1506+ void copyToClipboard ( location . href , this . $ ( ".btn" ) ! ) ;
15061507 }
15071508
15081509 private clear ( ) : void {
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1- const path = require ( "path" ) ;
2- const HtmlWebpackPlugin = require ( "html-webpack-plugin" ) ;
1+ import path from "path" ;
2+ import HtmlWebpackPlugin from "html-webpack-plugin" ;
3+ import { fileURLToPath } from "url" ;
34
4- module . exports = {
5+ const __filename = fileURLToPath ( import . meta. url ) ;
6+ const __dirname = path . dirname ( __filename ) ;
7+
8+ export default {
59 entry : "./src/index.ts" ,
610 module : {
711 rules : [
You can’t perform that action at this time.
0 commit comments