Skip to content

Commit ee44225

Browse files
committed
Reconfigure TypeScript compiler
1 parent 36c4a01 commit ee44225

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ node_modules
33
package-lock.json
44

55
# TypeScript
6-
/build
6+
/build
7+
**/*.d.ts
8+
**/*.js

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"description": "A few useful functions for signing ethereum data",
55
"main": "index.js",
66
"scripts": {
7-
"build": "tsc -d",
8-
"test": "npm run build && ts-node test/index.ts"
7+
"build": "tsc --project .",
8+
"test": "npm run build && node test/index.js"
99
},
1010
"repository": {
1111
"type": "git",
@@ -22,7 +22,7 @@
2222
},
2323
"homepage": "https://github.com/MetaMask/eth-sig-util#readme",
2424
"dependencies": {
25-
"@types/node": "^13.1.2",
25+
"@types/node": "^10",
2626
"buffer": "^5.2.1",
2727
"elliptic": "^6.4.0",
2828
"ethereumjs-abi": "0.6.5",
@@ -32,7 +32,6 @@
3232
},
3333
"devDependencies": {
3434
"tape": "^4.9.1",
35-
"ts-node": "^8.5.4",
36-
"typescript": "3.4.3"
35+
"typescript": "3.7.4"
3736
}
3837
}

test/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ test('signedTypeData with V3 string', (t) => {
509509
{ name: 'contents', type: 'string' }
510510
],
511511
},
512-
primaryType: 'Mail' as 'Mail',
512+
primaryType: 'Mail' as const,
513513
domain: {
514514
name: 'Ether Mail',
515515
version: '1',
@@ -581,7 +581,7 @@ test('signedTypeData_v4', (t) => {
581581
chainId: 1,
582582
verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
583583
},
584-
primaryType: 'Mail' as 'Mail',
584+
primaryType: 'Mail' as const,
585585
message: {
586586
from: {
587587
name: 'Cow',

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"compilerOptions": {
3-
"outDir": "./build",
3+
"declaration": true,
44
"target": "es5"
55
},
66
"include": [
7+
"./test/**/*",
78
"./index.ts",
89
"./utils/**/*"
910
]

0 commit comments

Comments
 (0)