From 25b5d3eadb3333167ac9c271270c20e0ab9aa4f4 Mon Sep 17 00:00:00 2001 From: Junyoung Choi Date: Wed, 19 Jul 2017 09:36:42 +0900 Subject: [PATCH 1/2] Add @types/filenamify --- types/filenamify/filenamify-tests.ts | 10 ++++++++++ types/filenamify/index.d.ts | 15 +++++++++++++++ types/filenamify/tsconfig.json | 22 ++++++++++++++++++++++ types/filenamify/tslint.json | 7 +++++++ 4 files changed, 54 insertions(+) create mode 100644 types/filenamify/filenamify-tests.ts create mode 100644 types/filenamify/index.d.ts create mode 100644 types/filenamify/tsconfig.json create mode 100644 types/filenamify/tslint.json diff --git a/types/filenamify/filenamify-tests.ts b/types/filenamify/filenamify-tests.ts new file mode 100644 index 0000000000..212ff424cf --- /dev/null +++ b/types/filenamify/filenamify-tests.ts @@ -0,0 +1,10 @@ +import * as filenamify from 'filenamify'; + +filenamify(''); +// => 'foo!bar' + +filenamify('foo:"bar"', {replacement: '🐴'}); +// => 'foo🐴bar' + +filenamify.path('/some/!path'); +// => '/some/path' diff --git a/types/filenamify/index.d.ts b/types/filenamify/index.d.ts new file mode 100644 index 0000000000..981b04443d --- /dev/null +++ b/types/filenamify/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for filenamify 2.0 +// Project: https://github.com/sindresorhus/filenamify +// Definitions by: Junyoung Choi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function filenamify(input: string, options?: filenamify.Options): string; + +declare namespace filenamify { + interface Options { + replacement: string; + } + function path(input: string, options?: filenamify.Options): string; +} + +export = filenamify; diff --git a/types/filenamify/tsconfig.json b/types/filenamify/tsconfig.json new file mode 100644 index 0000000000..aec1f33988 --- /dev/null +++ b/types/filenamify/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "filenamify-tests.ts" + ] +} diff --git a/types/filenamify/tslint.json b/types/filenamify/tslint.json new file mode 100644 index 0000000000..279473e356 --- /dev/null +++ b/types/filenamify/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // This package uses the Function type, and it will take effort to fix. + "ban-types": false + } +} From bec17f7f614543e385e9ad0dab92c32c4ab48a25 Mon Sep 17 00:00:00 2001 From: Junyoung Choi Date: Thu, 20 Jul 2017 10:26:08 +0900 Subject: [PATCH 2/2] Remove unncessary rules section from tslint.json --- types/filenamify/tslint.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/types/filenamify/tslint.json b/types/filenamify/tslint.json index 279473e356..f93cf8562a 100644 --- a/types/filenamify/tslint.json +++ b/types/filenamify/tslint.json @@ -1,7 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - // This package uses the Function type, and it will take effort to fix. - "ban-types": false - } + "extends": "dtslint/dt.json" }