forked from orbit-oss/is
Fix linting
This commit is contained in:
parent
7bf407fbf1
commit
ffc6ce4586
3 changed files with 14 additions and 13 deletions
11
package.json
11
package.json
|
|
@ -46,14 +46,15 @@
|
||||||
"types"
|
"types"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sindresorhus/tsconfig": "^0.3.0",
|
"@sindresorhus/tsconfig": "^0.4.0",
|
||||||
"@types/jsdom": "^12.2.3",
|
"@types/jsdom": "^12.2.3",
|
||||||
"@types/node": "^12.0.0",
|
"@types/node": "^12.0.0",
|
||||||
"@types/zen-observable": "^0.8.0",
|
"@types/zen-observable": "^0.8.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^1.5.0",
|
"@typescript-eslint/eslint-plugin": "^1.5.0",
|
||||||
"ava": "^1.4.1",
|
"@typescript-eslint/parser": "^1.10.2",
|
||||||
"del-cli": "^1.1.0",
|
"ava": "^2.1.0",
|
||||||
"eslint-config-xo-typescript": "^0.10.1",
|
"del-cli": "^2.0.0",
|
||||||
|
"eslint-config-xo-typescript": "^0.14.0",
|
||||||
"jsdom": "^15.0.0",
|
"jsdom": "^15.0.0",
|
||||||
"rxjs": "^6.4.0",
|
"rxjs": "^6.4.0",
|
||||||
"tempy": "^0.3.0",
|
"tempy": "^0.3.0",
|
||||||
|
|
@ -85,6 +86,8 @@
|
||||||
"BigUint64Array"
|
"BigUint64Array"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
|
"import/first": "off",
|
||||||
|
"import/newline-after-import": "off",
|
||||||
"@typescript-eslint/explicit-function-return-type": "off"
|
"@typescript-eslint/explicit-function-return-type": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
/// <reference lib="dom"/>
|
/// <reference lib="dom"/>
|
||||||
|
|
||||||
// TODO: Use the `URL` global when targeting Node.js 10
|
// TODO: Use the `URL` global when targeting Node.js 10
|
||||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
||||||
const URLGlobal = typeof URL === 'undefined' ? require('url').URL : URL;
|
const URLGlobal = typeof URL === 'undefined' ? require('url').URL : URL;
|
||||||
|
|
||||||
export type Class<T = unknown> = new (...args: any[]) => T;
|
export type Class<T = unknown> = new (...args: any[]) => T;
|
||||||
|
|
|
||||||
15
test/test.ts
15
test/test.ts
|
|
@ -1,15 +1,14 @@
|
||||||
import fs from 'fs';
|
import fs = require('fs');
|
||||||
import net from 'net';
|
import net = require('net');
|
||||||
import Stream from 'stream';
|
import Stream = require('stream');
|
||||||
import util from 'util';
|
import {inspect} from 'util';
|
||||||
import tempy from 'tempy';
|
import tempy = require('tempy');
|
||||||
import test, {ExecutionContext} from 'ava';
|
import test, {ExecutionContext} from 'ava';
|
||||||
import {JSDOM} from 'jsdom';
|
import {JSDOM} from 'jsdom';
|
||||||
import {Subject, Observable} from 'rxjs';
|
import {Subject, Observable} from 'rxjs';
|
||||||
import ZenObservable from 'zen-observable';
|
import ZenObservable = require('zen-observable');
|
||||||
import is, {TypeName} from '../source';
|
import is, {TypeName} from '../source';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
||||||
const URLGlobal = typeof URL === 'undefined' ? require('url').URL : URL;
|
const URLGlobal = typeof URL === 'undefined' ? require('url').URL : URL;
|
||||||
|
|
||||||
const isNode10orHigher = Number(process.versions.node.split('.')[0]) >= 10;
|
const isNode10orHigher = Number(process.versions.node.split('.')[0]) >= 10;
|
||||||
|
|
@ -472,7 +471,7 @@ const testType = (t: ExecutionContext, type: string, exclude?: string[]) => {
|
||||||
const assert = isTypeUnderTest ? t.true.bind(t) : t.false.bind(t);
|
const assert = isTypeUnderTest ? t.true.bind(t) : t.false.bind(t);
|
||||||
|
|
||||||
for (const fixture of fixtures) {
|
for (const fixture of fixtures) {
|
||||||
assert(testIs(fixture), `Value: ${util.inspect(fixture)}`);
|
assert(testIs(fixture), `Value: ${inspect(fixture)}`);
|
||||||
|
|
||||||
if (isTypeUnderTest && typename) {
|
if (isTypeUnderTest && typename) {
|
||||||
t.is(is(fixture), typename);
|
t.is(is(fixture), typename);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue