From 33d331a29745e77550f90deef9246691bc9c45b2 Mon Sep 17 00:00:00 2001 From: segayuu Date: Fri, 24 Nov 2017 09:59:13 +0900 Subject: [PATCH] cleanup lint ignore error: export-just-namespace --- types/ejs/index.d.ts | 152 ++++++++++++++++++++---------------------- types/ejs/tslint.json | 1 - 2 files changed, 74 insertions(+), 79 deletions(-) diff --git a/types/ejs/index.d.ts b/types/ejs/index.d.ts index 7532fbd3cc..0fade248a9 100644 --- a/types/ejs/index.d.ts +++ b/types/ejs/index.d.ts @@ -3,85 +3,81 @@ // Definitions by: Ben Liddicott // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace Ejs { - type Data = { [name: string]: any }; - type Dependencies = string[]; - let cache: Cache; - let localsName: string; - function resolveInclude(name: string, filename: string): string; - function compile(template: string, opts?: Options): (TemplateFunction); - function render(template: string, data?: Data, opts?: Options): string; +export type Data = { [name: string]: any }; +export type Dependencies = string[]; +export let cache: Cache; +export let localsName: string; +export function resolveInclude(name: string, filename: string): string; +export function compile(template: string, opts?: Options): (TemplateFunction); +export function render(template: string, data?: Data, opts?: Options): string; - type RenderFileCallback = (err: Error, str?: string) => T; - function renderFile(path: string, cb: RenderFileCallback): T; - function renderFile(path: string, data: Data, cb: RenderFileCallback): T; - function renderFile(path: string, data: Data, opts: Options, cb: RenderFileCallback): T; +export type RenderFileCallback = (err: Error, str?: string) => T; +export function renderFile(path: string, cb: RenderFileCallback): T; +export function renderFile(path: string, data: Data, cb: RenderFileCallback): T; +export function renderFile(path: string, data: Data, opts: Options, cb: RenderFileCallback): T; - function clearCache(): any; +export function clearCache(): any; - type TemplateFunction = (data: Data) => any; - interface Options { - cache?: any; - filename?: string; - context?: any; - compileDebug?: boolean; - client?: boolean; - delimiter?: string; - debug?: any; - _with?: boolean; - } - class Template { - constructor(text: string, opts: Options); - opts: Options; - templateText: string; - mode: string; - truncate: boolean; - currentLine: number; - source: string; - dependencies: Dependencies; - createRegex(): RegExp; - compile(): TemplateFunction; - generateSource(): any; - parseTemplateText(): string[]; - scanLine(line: string): any; - } - namespace Template { - interface MODES { - EVAL: string; - ESCAPED: string; - RAW: string; - COMMENT: string; - LITERAL: string; - } - } - function escapeRegexChars(s: string): string; - function escapeXML(markup: string): string; - function shallowCopy(to: T1, fro: any): T1; - interface Cache { - _data: { [name: string]: any }; - set(key: string, val: any): any; - get(key: string): any; - } - function resolve(from1: string, to: string): string; - function resolve(from1: string, from2: string, to: string): string; - function resolve(from1: string, from2: string, from3: string, to: string): string; - function resolve(from1: string, from2: string, from3: string, from4: string, to: string): string; - function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, to: string): string; - function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, to: string): string; - function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, from7: string, to: string): string; - function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, from7: string, from8: string, to: string): string; - function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, from7: string, from8: string, from9: string, to: string): string; - function resolve(...args: string[]): string; - function normalize(path: string): string; - function isAbsolute(path: string): boolean; - function join(...args: string[]): string; - function relative(from: string, to: string): string; - let sep: string; - let delimiter: string; - function dirname(path: string): string; - function basename(path: string): string; - function extname(path: string): string; - function filter(xs: any, f: any): any; // TODO WHUT? +export type TemplateFunction = (data: Data) => any; +export interface Options { + cache?: any; + filename?: string; + context?: any; + compileDebug?: boolean; + client?: boolean; + delimiter?: string; + debug?: any; + _with?: boolean; } - -export = Ejs; +export class Template { + constructor(text: string, opts: Options); + opts: Options; + templateText: string; + mode: string; + truncate: boolean; + currentLine: number; + source: string; + dependencies: Dependencies; + createRegex(): RegExp; + compile(): TemplateFunction; + generateSource(): any; + parseTemplateText(): string[]; + scanLine(line: string): any; +} +export namespace Template { + interface MODES { + EVAL: string; + ESCAPED: string; + RAW: string; + COMMENT: string; + LITERAL: string; + } +} +export function escapeRegexChars(s: string): string; +export function escapeXML(markup: string): string; +export function shallowCopy(to: T1, fro: any): T1; +export interface Cache { + _data: { [name: string]: any }; + set(key: string, val: any): any; + get(key: string): any; +} +export function resolve(from1: string, to: string): string; +export function resolve(from1: string, from2: string, to: string): string; +export function resolve(from1: string, from2: string, from3: string, to: string): string; +export function resolve(from1: string, from2: string, from3: string, from4: string, to: string): string; +export function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, to: string): string; +export function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, to: string): string; +export function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, from7: string, to: string): string; +export function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, from7: string, from8: string, to: string): string; +export function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, from7: string, from8: string, from9: string, to: string): string; +export function resolve(...args: string[]): string; +export function normalize(path: string): string; +export function isAbsolute(path: string): boolean; +export function join(...args: string[]): string; +export function relative(from: string, to: string): string; +export let sep: string; +export let delimiter: string; +export function dirname(path: string): string; +export function basename(path: string): string; +export function extname(path: string): string; +export function filter(xs: any, f: any): any; // TODO WHUT? diff --git a/types/ejs/tslint.json b/types/ejs/tslint.json index 06b9038d96..a3126dd180 100644 --- a/types/ejs/tslint.json +++ b/types/ejs/tslint.json @@ -1,7 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "export-just-namespace": false, "interface-over-type-literal": false, "object-literal-shorthand": false, "unified-signatures": false