From 4f489b1a1e0c1d966570014b51fe649786096524 Mon Sep 17 00:00:00 2001 From: TokugawaT_YD <41653501+TokugawaTakesi@users.noreply.github.com> Date: Fri, 18 Sep 2020 01:23:47 +0900 Subject: [PATCH] Types for gulp-pug-linter (#47522) * clear to tests * Clear to tests * fixed issues * Update types/gulp-pug-linter/index.d.ts Co-authored-by: Ilya Kaminsky * fixed issues Co-authored-by: Ilya Kaminsky --- .../gulp-pug-linter/gulp-pug-linter-tests.ts | 14 +++++++++++ types/gulp-pug-linter/index.d.ts | 20 ++++++++++++++++ types/gulp-pug-linter/tsconfig.json | 23 +++++++++++++++++++ types/gulp-pug-linter/tslint.json | 3 +++ 4 files changed, 60 insertions(+) create mode 100644 types/gulp-pug-linter/gulp-pug-linter-tests.ts create mode 100644 types/gulp-pug-linter/index.d.ts create mode 100644 types/gulp-pug-linter/tsconfig.json create mode 100644 types/gulp-pug-linter/tslint.json diff --git a/types/gulp-pug-linter/gulp-pug-linter-tests.ts b/types/gulp-pug-linter/gulp-pug-linter-tests.ts new file mode 100644 index 0000000000..b6bc079273 --- /dev/null +++ b/types/gulp-pug-linter/gulp-pug-linter-tests.ts @@ -0,0 +1,14 @@ +import gulp = require('gulp'); +import * as gulpPugLinter from "gulp-pug-linter"; + +gulp.task('lint:template__default', () => ( + gulp + .src('./**/*.pug') + .pipe(gulpPugLinter({ failAfterError: true })) +)); + +gulp.task('lint:template__reporter', () => ( + gulp + .src('./**/*.pug') + .pipe(gulpPugLinter({ reporter: 'default' })) +)); diff --git a/types/gulp-pug-linter/index.d.ts b/types/gulp-pug-linter/index.d.ts new file mode 100644 index 0000000000..abe783e707 --- /dev/null +++ b/types/gulp-pug-linter/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for gulp-pug-linter 1.4 +// Project: https://github.com/ilyakam/gulp-pug-linter +// Definitions by: Takesi Tokugawa +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +interface GulpPugLinter { + (options?: GulpPugLinter.Options): NodeJS.ReadWriteStream; +} + +declare namespace GulpPugLinter { + interface Options { + reporter?: any; + failAfterError?: boolean; + } +} + +declare var gulpPugLinter: GulpPugLinter; +export = gulpPugLinter; diff --git a/types/gulp-pug-linter/tsconfig.json b/types/gulp-pug-linter/tsconfig.json new file mode 100644 index 0000000000..ada556920d --- /dev/null +++ b/types/gulp-pug-linter/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "gulp-pug-linter-tests.ts" + ] +} diff --git a/types/gulp-pug-linter/tslint.json b/types/gulp-pug-linter/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/gulp-pug-linter/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}