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

View file

@ -72,13 +72,13 @@ const types = new Map<string, Test>([
['function', { ['function', {
is: m.function_, is: m.function_,
fixtures: [ fixtures: [
// tslint:disable:no-empty no-unused-variable only-arrow-functions no-function-expression // tslint:disable:no-unused no-empty no-unused-variable only-arrow-functions no-function-expression
function foo() {}, // tslint:disable-line:no-unused function foo() {},
function() {}, function () {},
() => {}, () => {},
async function() {}, async function () {},
function *(): any {} function * (): any {}
// tslint:enable:no-empty no-unused-variable only-arrow-functions no-function-expression // tslint:enable:no-unused no-empty no-unused-variable only-arrow-functions no-function-expression
] ]
}], }],
['buffer', { ['buffer', {
@ -130,19 +130,23 @@ const types = new Map<string, Test>([
['generator', { ['generator', {
is: m.generator, is: m.generator,
fixtures: [ fixtures: [
(function *() { yield 4; })() // tslint:disable-line (function * () {
yield 4;
})()
] ]
}], }],
['generatorFunction', { ['generatorFunction', {
is: m.generatorFunction, is: m.generatorFunction,
fixtures: [ fixtures: [
function *() { yield 4; } // tslint:disable-line function * () {
yield 4;
}
] ]
}], }],
['asyncFunction', { ['asyncFunction', {
is: m.asyncFunction, is: m.asyncFunction,
fixtures: [ 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 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.createProcessingInstruction('xml-stylesheet', 'href="mycss.css" type="text/css"'),
document.createComment('This is a comment'), document.createComment('This is a comment'),
document, 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() document.createDocumentFragment()
] ]
}], }],
@ -579,7 +583,7 @@ test('is.typedArray', t => {
}); });
test('is.arrayLike', t => { test('is.arrayLike', t => {
(() => { (function () { // tslint:disable-line:only-arrow-functions
t.true(m.arrayLike(arguments)); t.true(m.arrayLike(arguments));
})(); })();
t.true(m.arrayLike([])); t.true(m.arrayLike([]));

View file

@ -1,20 +1,25 @@
{ {
"compileOnSave": true,
"compilerOptions": { "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", "outDir": "dist",
"removeComments": true, "target": "es2015",
"lib": [ "module": "commonjs",
"es2015", "moduleResolution": "node",
"dom", "declaration": true,
"scripthost" "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"
]
} }