From d85736e4af80b3aa673101f94368add8353f11cc Mon Sep 17 00:00:00 2001 From: Lukas Tetzlaff Date: Tue, 31 Oct 2017 16:23:06 -0700 Subject: [PATCH] Setup Typescript, ignores and compiler options --- .gitignore | 3 +++ .npmignore | 1 + package.json | 9 +++++++-- tsconfig.json | 19 +++++++++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .npmignore create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index 239ecff..9bcca4e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ node_modules yarn.lock + +index.js +index.d.ts \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..a2e78d7 --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +index.ts \ No newline at end of file diff --git a/package.json b/package.json index 9cc88cc..a1e0256 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,13 @@ "node": ">=4" }, "scripts": { - "test": "xo && ava" + "test": "xo && ava", + "build": "tsc", + "prepublish": "tsc" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "keywords": [ "type", @@ -43,8 +46,10 @@ "compare" ], "devDependencies": { + "@types/node": "^8.0.47", "ava": "*", "jsdom": "^9.12.0", + "typescript": "^2.6.1", "xo": "*" } } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..d667e92 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "target": "es6", + "moduleResolution": "node", + "strict": true, + "alwaysStrict": true, + "declaration": true, + "outDir": ".", + "noImplicitAny": true, + "suppressImplicitAnyIndexErrors": true + }, + "include": [ + "index.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file