From 1bd1772056aa582f4781edc1f28c8aea06617c26 Mon Sep 17 00:00:00 2001 From: Mu-An Chiou Date: Thu, 21 May 2020 16:10:07 -0400 Subject: [PATCH 01/10] Convert to TypeScript --- .eslintrc.json | 12 +- .flowconfig | 9 - .travis.yml | 9 - examples/index.html | 2 +- index.d.ts | 12 - package-lock.json | 3372 ++++++++--------- package.json | 36 +- prettier.config.js | 2 - rollup.config.js | 18 +- src/clipboard-copy-element.js.flow | 8 - ...y-element.js => clipboard-copy-element.ts} | 8 +- src/{clipboard.js => clipboard.ts} | 8 +- src/{index.js => index.ts} | 8 +- test/{karma.config.js => karma.config.cjs} | 2 +- test/test.js | 42 +- tsconfig.json | 13 + 16 files changed, 1655 insertions(+), 1906 deletions(-) delete mode 100644 .flowconfig delete mode 100644 .travis.yml delete mode 100644 index.d.ts delete mode 100644 prettier.config.js delete mode 100644 src/clipboard-copy-element.js.flow rename src/{clipboard-copy-element.js => clipboard-copy-element.ts} (91%) rename src/{clipboard.js => clipboard.ts} (76%) rename src/{index.js => index.ts} (73%) rename test/{karma.config.js => karma.config.cjs} (80%) create mode 100644 tsconfig.json diff --git a/.eslintrc.json b/.eslintrc.json index a4aaa98..0ee2295 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -2,20 +2,24 @@ "extends": [ "plugin:github/es6", "plugin:github/browser", - "plugin:github/flow" + "plugin:github/typescript" ], + "globals": { + "ClipboardCopyElement": "readable" + }, "overrides": [ { "files": "test/**/*.js", - "rules": { - "flowtype/require-valid-file-annotation": "off" - }, "env": { "mocha": true }, "globals": { "assert": true } + }, + { + "files": "*.js", + "parser": "espree" } ] } diff --git a/.flowconfig b/.flowconfig deleted file mode 100644 index 60e7050..0000000 --- a/.flowconfig +++ /dev/null @@ -1,9 +0,0 @@ -[ignore] - -[include] - -[libs] - -[options] - -[lints] diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a19f461..0000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -sudo: required -node_js: - - "node" -addons: - chrome: stable -cache: - directories: - - node_modules diff --git a/examples/index.html b/examples/index.html index e2a686f..9fb9b72 100644 --- a/examples/index.html +++ b/examples/index.html @@ -3,7 +3,7 @@ Codestin Search App - +