mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-28 08:17:54 +08:00
cleanup simple ignore style lint errors
This commit is contained in:
@@ -726,7 +726,6 @@ function frozen() {
|
||||
Object.freeze({}).should.be.frozen;
|
||||
}
|
||||
|
||||
|
||||
class PoorlyConstructedError { }
|
||||
function _throw() {
|
||||
// See GH-45: some poorly-constructed custom errors don't have useful names
|
||||
@@ -736,11 +735,11 @@ function _throw() {
|
||||
|
||||
const specificError = new RangeError('boo');
|
||||
|
||||
const goodFn = () => { }
|
||||
, badFn = () => { throw new Error('testing'); }
|
||||
, refErrFn = () => { throw new ReferenceError('hello'); }
|
||||
, ickyErrFn = () => { throw new PoorlyConstructedError(); }
|
||||
, specificErrFn = () => { throw specificError; };
|
||||
const goodFn = () => { };
|
||||
const badFn = () => { throw new Error('testing'); };
|
||||
const refErrFn = () => { throw new ReferenceError('hello'); };
|
||||
const ickyErrFn = () => { throw new PoorlyConstructedError(); };
|
||||
const specificErrFn = () => { throw specificError; };
|
||||
|
||||
expect(goodFn).to.not.throw();
|
||||
goodFn.should.not.throw();
|
||||
@@ -1090,7 +1089,7 @@ function oneOf() {
|
||||
expect(obj).to.not.be.oneOf([{ z: 3 }]);
|
||||
}
|
||||
|
||||
//tdd
|
||||
// tdd
|
||||
declare function suite(description: string, action: Function): void;
|
||||
declare function test(description: string, action: Function): void;
|
||||
|
||||
@@ -1105,7 +1104,6 @@ class CrashyObject {
|
||||
}
|
||||
|
||||
suite('assert', () => {
|
||||
|
||||
test('assert', () => {
|
||||
const foo: string = 'bar';
|
||||
assert(foo === 'bar', 'expected foo to equal `bar`');
|
||||
@@ -1207,26 +1205,26 @@ suite('assert', () => {
|
||||
assert.deepEqual({ tea: 'chai' }, { tea: 'chai' });
|
||||
assert.deepEqual({ tea: 'chai' }, { tea: 'black' });
|
||||
|
||||
const obja = Object.create({ tea: 'chai' })
|
||||
, objb = Object.create({ tea: 'chai' });
|
||||
const obja = Object.create({ tea: 'chai' });
|
||||
const objb = Object.create({ tea: 'chai' });
|
||||
|
||||
assert.deepEqual(obja, objb);
|
||||
|
||||
const obj1 = Object.create({ tea: 'chai' })
|
||||
, obj2 = Object.create({ tea: 'black' });
|
||||
const obj1 = Object.create({ tea: 'chai' });
|
||||
const obj2 = Object.create({ tea: 'black' });
|
||||
|
||||
assert.deepEqual(obj1, obj2);
|
||||
});
|
||||
|
||||
test('deepEqual (ordering)', () => {
|
||||
const a = { a: 'b', c: 'd' }
|
||||
, b = { c: 'd', a: 'b' };
|
||||
const a = { a: 'b', c: 'd' };
|
||||
const b = { c: 'd', a: 'b' };
|
||||
assert.deepEqual(a, b);
|
||||
});
|
||||
|
||||
test('deepEqual (circular)', () => {
|
||||
const circularObject: any = {}
|
||||
, secondCircularObject: any = {};
|
||||
const circularObject: any = {};
|
||||
const secondCircularObject: any = {};
|
||||
circularObject.field = circularObject;
|
||||
secondCircularObject.field = secondCircularObject;
|
||||
|
||||
@@ -1242,8 +1240,8 @@ suite('assert', () => {
|
||||
});
|
||||
|
||||
test('notDeepEqual (circular)', () => {
|
||||
const circularObject: any = {}
|
||||
, secondCircularObject: any = { tea: 'jasmine' };
|
||||
const circularObject: any = {};
|
||||
const secondCircularObject: any = { tea: 'jasmine' };
|
||||
circularObject.field = circularObject;
|
||||
secondCircularObject.field = secondCircularObject;
|
||||
|
||||
@@ -1372,13 +1370,13 @@ suite('assert', () => {
|
||||
});
|
||||
|
||||
test('nestedInclude', () => {
|
||||
assert.nestedInclude({'.a': {'b': 'x'}}, {'\\.a.[b]': 'x'});
|
||||
assert.nestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'x'});
|
||||
assert.nestedInclude({'.a': {b: 'x'}}, {'\\.a.[b]': 'x'});
|
||||
assert.nestedInclude({a: {'[b]': 'x'}}, {'a.\\[b\\]': 'x'});
|
||||
});
|
||||
|
||||
test('notNestedInclude', () => {
|
||||
assert.notNestedInclude({'.a': {'b': 'x'}}, {'\\.a.b': 'y'});
|
||||
assert.notNestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'y'});
|
||||
assert.notNestedInclude({'.a': {b: 'x'}}, {'\\.a.b': 'y'});
|
||||
assert.notNestedInclude({a: {'[b]': 'x'}}, {'a.\\[b\\]': 'y'});
|
||||
});
|
||||
|
||||
test('deepNestedInclude', () => {
|
||||
@@ -1387,7 +1385,7 @@ suite('assert', () => {
|
||||
});
|
||||
|
||||
test('notDeepNestedInclude', () => {
|
||||
assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}})
|
||||
assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}});
|
||||
assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}});
|
||||
});
|
||||
|
||||
@@ -1548,7 +1546,6 @@ suite('assert', () => {
|
||||
assert.sameMembers([1, 54], [6, 1, 54]);
|
||||
});
|
||||
|
||||
|
||||
test('isAbove', () => {
|
||||
assert.isAbove(10, 5);
|
||||
assert.isAbove(1, 5);
|
||||
@@ -1738,7 +1735,7 @@ suite('assert', () => {
|
||||
test('hasAllKeys', () => {
|
||||
assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'bar', 'baz']);
|
||||
assert.hasAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337});
|
||||
assert.hasAllKeys(new Map<any,any>([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']);
|
||||
assert.hasAllKeys(new Map<any, any>([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']);
|
||||
assert.hasAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']);
|
||||
});
|
||||
|
||||
@@ -1747,8 +1744,8 @@ suite('assert', () => {
|
||||
assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, ['foo', 'bar', 'baz']);
|
||||
assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, baz: 1337});
|
||||
assert.containsAllKeys({foo: 1, bar: 2, baz: 3}, {foo: 30, bar: 99, baz: 1337});
|
||||
assert.containsAllKeys(new Map<any,any>([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}]);
|
||||
assert.containsAllKeys(new Map<any,any>([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']);
|
||||
assert.containsAllKeys(new Map<any, any>([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}]);
|
||||
assert.containsAllKeys(new Map<any, any>([[{foo: 1}, 'bar'], ['key', 'value']]), [{foo: 1}, 'key']);
|
||||
assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}]);
|
||||
assert.containsAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{foo: 'bar'}, 'anotherKey']);
|
||||
});
|
||||
@@ -1756,21 +1753,21 @@ suite('assert', () => {
|
||||
test('doesNotHaveAnyKeys', () => {
|
||||
assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']);
|
||||
assert.doesNotHaveAnyKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'});
|
||||
assert.doesNotHaveAnyKeys(new Map<any,any>([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']);
|
||||
assert.doesNotHaveAnyKeys(new Map<any, any>([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']);
|
||||
assert.doesNotHaveAnyKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{one: 'two'}, 'example']);
|
||||
});
|
||||
|
||||
test('doesNotHaveAllKeys', () => {
|
||||
assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, ['one', 'two', 'example']);
|
||||
assert.doesNotHaveAllKeys({foo: 1, bar: 2, baz: 3}, {one: 1, two: 2, example: 'foo'});
|
||||
assert.doesNotHaveAllKeys(new Map<any,any>([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']);
|
||||
assert.doesNotHaveAllKeys(new Map<any, any>([[{foo: 1}, 'bar'], ['key', 'value']]), [{one: 'two'}, 'example']);
|
||||
assert.doesNotHaveAllKeys(new Set([{foo: 'bar'}, 'anotherKey']), [{one: 'two'}, 'example']);
|
||||
});
|
||||
|
||||
test('hasAnyDeepKeys', () => {
|
||||
assert.hasAnyDeepKeys(new Map<any,any>([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'});
|
||||
assert.hasAnyDeepKeys(new Map<any,any>([[{one: 'one'}, 'valueOne'], [1, 2]]), [{one: 'one'}, {two: 'two'}]);
|
||||
assert.hasAnyDeepKeys(new Map<any,any>([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]);
|
||||
assert.hasAnyDeepKeys(new Map<any, any>([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'});
|
||||
assert.hasAnyDeepKeys(new Map<any, any>([[{one: 'one'}, 'valueOne'], [1, 2]]), [{one: 'one'}, {two: 'two'}]);
|
||||
assert.hasAnyDeepKeys(new Map<any, any>([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]);
|
||||
assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {one: 'one'});
|
||||
assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {three: 'three'}]);
|
||||
assert.hasAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]);
|
||||
@@ -1778,28 +1775,28 @@ suite('assert', () => {
|
||||
|
||||
test('hasAllDeepKeys', () => {
|
||||
assert.hasAllDeepKeys(new Map([[{one: 'one'}, 'valueOne']]), {one: 'one'});
|
||||
assert.hasAllDeepKeys(new Map<any,any>([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]);
|
||||
assert.hasAllDeepKeys(new Map<any, any>([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]);
|
||||
assert.hasAllDeepKeys(new Set([{one: 'one'}]), {one: 'one'});
|
||||
assert.hasAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]);
|
||||
});
|
||||
|
||||
test('containsAllDeepKeys', () => {
|
||||
assert.containsAllDeepKeys(new Map<any,any>([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'});
|
||||
assert.containsAllDeepKeys(new Map<any,any>([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]);
|
||||
assert.containsAllDeepKeys(new Map<any, any>([[{one: 'one'}, 'valueOne'], [1, 2]]), {one: 'one'});
|
||||
assert.containsAllDeepKeys(new Map<any, any>([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{one: 'one'}, {two: 'two'}]);
|
||||
assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {one: 'one'});
|
||||
assert.containsAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {two: 'two'}]);
|
||||
});
|
||||
|
||||
test('doesNotHaveAnyDeepKeys', () => {
|
||||
assert.doesNotHaveAnyDeepKeys(new Map<any,any>([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'});
|
||||
assert.doesNotHaveAnyDeepKeys(new Map<any,any>([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {fifty: 'fifty'}]);
|
||||
assert.doesNotHaveAnyDeepKeys(new Map<any, any>([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'});
|
||||
assert.doesNotHaveAnyDeepKeys(new Map<any, any>([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {fifty: 'fifty'}]);
|
||||
assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {twenty: 'twenty'});
|
||||
assert.doesNotHaveAnyDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{twenty: 'twenty'}, {fifty: 'fifty'}]);
|
||||
});
|
||||
|
||||
test('doesNotHaveAllDeepKeys', () => {
|
||||
assert.doesNotHaveAllDeepKeys(new Map<any,any>([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'});
|
||||
assert.doesNotHaveAllDeepKeys(new Map<any,any>([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {one: 'one'}]);
|
||||
assert.doesNotHaveAllDeepKeys(new Map<any, any>([[{one: 'one'}, 'valueOne'], [1, 2]]), {thisDoesNot: 'exist'});
|
||||
assert.doesNotHaveAllDeepKeys(new Map<any, any>([[{one: 'one'}, 'valueOne'], [{two: 'two'}, 'valueTwo']]), [{twenty: 'twenty'}, {one: 'one'}]);
|
||||
assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), {twenty: 'twenty'});
|
||||
assert.doesNotHaveAllDeepKeys(new Set([{one: 'one'}, {two: 'two'}]), [{one: 'one'}, {fifty: 'fifty'}]);
|
||||
});
|
||||
|
||||
13
types/chai/index.d.ts
vendored
13
types/chai/index.d.ts
vendored
@@ -713,7 +713,6 @@ declare namespace Chai {
|
||||
*/
|
||||
notInclude(haystack: any[], needle: any, message?: string): void;
|
||||
|
||||
|
||||
/**
|
||||
* Asserts that haystack includes needle. Can be used to assert the inclusion of a value in an array or a subset of properties in an object. Deep equality is used.
|
||||
*
|
||||
@@ -1289,7 +1288,7 @@ declare namespace Chai {
|
||||
* @param property Property of object expected to be modified.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
changes<T>(modifier: Function, object: T, property: string /* keyof T */, message?: string): void
|
||||
changes<T>(modifier: Function, object: T, property: string /* keyof T */, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that a function does not change the value of a property.
|
||||
@@ -1300,7 +1299,7 @@ declare namespace Chai {
|
||||
* @param property Property of object expected not to be modified.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
doesNotChange<T>(modifier: Function, object: T, property: string /* keyof T */, message?: string): void
|
||||
doesNotChange<T>(modifier: Function, object: T, property: string /* keyof T */, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that a function increases an object property.
|
||||
@@ -1311,7 +1310,7 @@ declare namespace Chai {
|
||||
* @param property Property of object expected to be increased.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
increases<T>(modifier: Function, object: T, property: string /* keyof T */, message?: string): void
|
||||
increases<T>(modifier: Function, object: T, property: string /* keyof T */, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that a function does not increase an object property.
|
||||
@@ -1322,7 +1321,7 @@ declare namespace Chai {
|
||||
* @param property Property of object expected not to be increased.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
doesNotIncrease<T>(modifier: Function, object: T, property: string /* keyof T */, message?: string): void
|
||||
doesNotIncrease<T>(modifier: Function, object: T, property: string /* keyof T */, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that a function decreases an object property.
|
||||
@@ -1333,7 +1332,7 @@ declare namespace Chai {
|
||||
* @param property Property of object expected to be decreased.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
decreases<T>(modifier: Function, object: T, property: string /* keyof T */, message?: string): void
|
||||
decreases<T>(modifier: Function, object: T, property: string /* keyof T */, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that a function does not decrease an object property.
|
||||
@@ -1344,7 +1343,7 @@ declare namespace Chai {
|
||||
* @param property Property of object expected not to be decreased.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
doesNotDecrease<T>(modifier: Function, object: T, property: string /* keyof T */, message?: string): void
|
||||
doesNotDecrease<T>(modifier: Function, object: T, property: string /* keyof T */, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts if value is not a false value, and throws if it is a true value.
|
||||
|
||||
@@ -3,25 +3,17 @@
|
||||
"rules": {
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"new-parens": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-empty-interface": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"prefer-const": false,
|
||||
"semicolon": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"unified-signatures": false,
|
||||
"whitespace": false
|
||||
"unified-signatures": false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user