mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 14:59:37 +08:00
Add Tests and Cleanup ignore lint errors
This commit is contained in:
@@ -1,3 +1,35 @@
|
||||
import ejs = require("ejs");
|
||||
import * as fs from 'graceful-fs';
|
||||
|
||||
const fileName = 'test.ejs';
|
||||
const people = ['geddy', 'neil', 'alex'];
|
||||
const html = ejs.render('<%= people.join(", "); %>', { people: people });
|
||||
const data = { people };
|
||||
const template = '<%= people.join(", "); %>';
|
||||
const options = {delimiter: '$'};
|
||||
let result: string;
|
||||
let cacheResult: string;
|
||||
let ejsFunction: ejs.TemplateFunction;
|
||||
|
||||
const SimpleCallback = (err: any, html?: string) => {
|
||||
if (err) {
|
||||
return null;
|
||||
}
|
||||
return html;
|
||||
};
|
||||
|
||||
result = ejs.render(template);
|
||||
result = ejs.render(template, data);
|
||||
result = ejs.render(template, data, options);
|
||||
|
||||
cacheResult = ejs.renderFile(fileName, SimpleCallback);
|
||||
cacheResult = ejs.renderFile(fileName, data, SimpleCallback);
|
||||
cacheResult = ejs.renderFile(fileName, data, options, SimpleCallback);
|
||||
|
||||
ejsFunction = ejs.compile(template);
|
||||
ejsFunction({});
|
||||
ejsFunction(data);
|
||||
ejs.compile(template, options);
|
||||
|
||||
ejs.fileLoader = (str: string) => str;
|
||||
|
||||
ejs.clearCache();
|
||||
|
||||
@@ -1,7 +1 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"object-literal-shorthand": false,
|
||||
"unified-signatures": false
|
||||
}
|
||||
}
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
|
||||
Reference in New Issue
Block a user