Various tweaks

This commit is contained in:
Sindre Sorhus 2017-11-07 10:23:00 +07:00
parent 59a638b216
commit 89867fbc16
3 changed files with 38 additions and 29 deletions

View file

@ -17,7 +17,7 @@
"node": ">=4"
},
"scripts": {
"lint": "tslint --project .",
"lint": "tslint --format stylish --project .",
"build": "tsc",
"test": "npm run lint && npm run build && ava dist/tests",
"prepublish": "npm run build && del dist/tests"
@ -53,7 +53,7 @@
"del-cli": "^1.1.0",
"jsdom": "^9.12.0",
"tslint": "^5.8.0",
"tslint-xo": "^0.2.2",
"tslint-xo": "^0.3.0",
"typescript": "^2.6.1"
},
"types": "dist/index.d.ts"

View file

@ -72,13 +72,13 @@ const types = new Map<string, Test>([
['function', {
is: m.function_,
fixtures: [
// tslint:disable:no-empty no-unused-variable only-arrow-functions no-function-expression
function foo() {}, // tslint:disable-line:no-unused
function() {},
// tslint:disable:no-unused no-empty no-unused-variable only-arrow-functions no-function-expression
function foo() {},
function () {},
() => {},
async function() {},
function *(): any {}
// tslint:enable:no-empty no-unused-variable only-arrow-functions no-function-expression
async function () {},
function * (): any {}
// tslint:enable:no-unused no-empty no-unused-variable only-arrow-functions no-function-expression
]
}],
['buffer', {
@ -130,19 +130,23 @@ const types = new Map<string, Test>([
['generator', {
is: m.generator,
fixtures: [
(function *() { yield 4; })() // tslint:disable-line
(function * () {
yield 4;
})()
]
}],
['generatorFunction', {
is: m.generatorFunction,
fixtures: [
function *() { yield 4; } // tslint:disable-line
function * () {
yield 4;
}
]
}],
['asyncFunction', {
is: m.asyncFunction,
fixtures: [
async function() {}, // tslint:disable-line:no-empty only-arrow-functions no-function-expression
async function () {}, // tslint:disable-line:no-empty only-arrow-functions no-function-expression
async () => {} // tslint:disable-line:no-empty
]
}],
@ -282,7 +286,7 @@ const types = new Map<string, Test>([
document.createProcessingInstruction('xml-stylesheet', 'href="mycss.css" type="text/css"'),
document.createComment('This is a comment'),
document,
document.implementation.createDocumentType('svg:svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'), // tslint:disable-line
document.implementation.createDocumentType('svg:svg', '-//W3C//DTD SVG 1.1//EN', 'https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'),
document.createDocumentFragment()
]
}],
@ -579,7 +583,7 @@ test('is.typedArray', t => {
});
test('is.arrayLike', t => {
(() => {
(function () { // tslint:disable-line:only-arrow-functions
t.true(m.arrayLike(arguments));
})();
t.true(m.arrayLike([]));

View file

@ -1,20 +1,25 @@
{
"compileOnSave": true,
"compilerOptions": {
/* es2015 requires moduleResolution and module to be set,
see https://github.com/Microsoft/TypeScript/issues/8189 */
"target": "es2015",
"moduleResolution": "node",
"module": "none",
"strict": true,
"declaration": true,
"sourceMap": true,
"outDir": "dist",
"removeComments": true,
"lib": [
"es2015",
"dom",
"scripthost"
]
}
"target": "es2015",
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"pretty": true,
"newLine": "lf",
"stripInternal": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"alwaysStrict": true
},
"exclude": [
"node_modules",
"dist"
]
}