Skip to content

Commit c589c3d

Browse files
saihajIvanGoncharov
authored andcommitted
Temporary relax tsconfig and added bunch of error supressions
1 parent 76e0607 commit c589c3d

28 files changed

+158
-56
lines changed

.eslintrc.yml

+15-17
Original file line numberDiff line numberDiff line change
@@ -457,22 +457,21 @@ overrides:
457457
'@typescript-eslint/await-thenable': error
458458
'@typescript-eslint/ban-ts-comment': [error, { 'ts-expect-error': false }]
459459
'@typescript-eslint/ban-tslint-comment': error
460-
'@typescript-eslint/ban-types': error
460+
'@typescript-eslint/ban-types': off # TODO temporarily disabled
461461
'@typescript-eslint/class-literal-property-style': off # TODO enable after TS conversion
462462
'@typescript-eslint/consistent-indexed-object-style': off # TODO enable after TS conversion
463-
'@typescript-eslint/consistent-type-assertions':
464-
[error, { assertionStyle: as, objectLiteralTypeAssertions: never }]
465-
'@typescript-eslint/consistent-type-definitions': off # TODO consider
466-
'@typescript-eslint/consistent-type-imports': off # TODO enable after TS conversion
463+
'@typescript-eslint/consistent-type-assertions': off # TODO temporarily disable
464+
'@typescript-eslint/consistent-type-definitions': error
465+
'@typescript-eslint/consistent-type-imports': error
467466
'@typescript-eslint/explicit-function-return-type': off # TODO consider
468467
'@typescript-eslint/explicit-member-accessibility': off # TODO consider
469468
'@typescript-eslint/explicit-module-boundary-types': off # TODO consider
470-
'@typescript-eslint/member-ordering': off # TODO consider
469+
'@typescript-eslint/member-ordering': error
471470
'@typescript-eslint/method-signature-style': error
472471
'@typescript-eslint/naming-convention': off # TODO consider
473472
'@typescript-eslint/no-base-to-string': error
474473
'@typescript-eslint/no-confusing-non-null-assertion': error
475-
'@typescript-eslint/no-confusing-void-expression': error
474+
'@typescript-eslint/no-confusing-void-expression': off # TODO enable with ignoreArrowShorthand
476475
'@typescript-eslint/no-dynamic-delete': off
477476
'@typescript-eslint/no-empty-interface': error
478477
'@typescript-eslint/no-explicit-any': off # TODO error
@@ -494,21 +493,21 @@ overrides:
494493
'@typescript-eslint/no-require-imports': error
495494
'@typescript-eslint/no-this-alias': error
496495
'@typescript-eslint/no-type-alias': off # TODO consider
497-
'@typescript-eslint/no-unnecessary-boolean-literal-compare': error
498-
'@typescript-eslint/no-unnecessary-condition': error
496+
'@typescript-eslint/no-unnecessary-boolean-literal-compare': off # FIXME requires on strictNullChecks
497+
'@typescript-eslint/no-unnecessary-condition': off # TODO temporary disable
499498
'@typescript-eslint/no-unnecessary-qualifier': error
500499
'@typescript-eslint/no-unnecessary-type-arguments': error
501500
'@typescript-eslint/no-unnecessary-type-assertion': error
502-
'@typescript-eslint/no-unnecessary-type-constraint': off # TODO consider
501+
'@typescript-eslint/no-unnecessary-type-constraint': error
503502
'@typescript-eslint/no-unsafe-argument': off # TODO consider
504503
'@typescript-eslint/no-unsafe-assignment': off # TODO consider
505504
'@typescript-eslint/no-unsafe-call': off # TODO consider
506505
'@typescript-eslint/no-unsafe-member-access': off # TODO consider
507506
'@typescript-eslint/no-unsafe-return': off # TODO consider
508507
'@typescript-eslint/no-var-requires': error
509-
'@typescript-eslint/non-nullable-type-assertion-style': error
510-
'@typescript-eslint/prefer-as-const': off # TODO consider
511-
'@typescript-eslint/prefer-enum-initializers': off # TODO consider
508+
'@typescript-eslint/non-nullable-type-assertion-style': off #TODO temporarily disabled
509+
'@typescript-eslint/prefer-as-const': error
510+
'@typescript-eslint/prefer-enum-initializers': error
512511
'@typescript-eslint/prefer-for-of': off # TODO switch to error after TS migration
513512
'@typescript-eslint/prefer-function-type': error
514513
'@typescript-eslint/prefer-includes': off # TODO switch to error after IE11 drop
@@ -524,12 +523,11 @@ overrides:
524523
'@typescript-eslint/prefer-string-starts-ends-with': off # TODO switch to error after IE11 drop
525524
'@typescript-eslint/promise-function-async': off
526525
'@typescript-eslint/require-array-sort-compare': error
527-
'@typescript-eslint/restrict-plus-operands':
528-
[error, { checkCompoundAssignments: true }]
529-
'@typescript-eslint/restrict-template-expressions': error
526+
'@typescript-eslint/restrict-plus-operands': off #TODO temporarily disabled
527+
'@typescript-eslint/restrict-template-expressions': off #TODO temporarily disabled
530528
'@typescript-eslint/sort-type-union-intersection-members': off # TODO consider
531529
'@typescript-eslint/strict-boolean-expressions': off # TODO consider
532-
'@typescript-eslint/switch-exhaustiveness-check': error
530+
'@typescript-eslint/switch-exhaustiveness-check': off #TODO temporarily disabled
533531
'@typescript-eslint/triple-slash-reference': error
534532
'@typescript-eslint/typedef': off
535533
'@typescript-eslint/unbound-method': off # TODO consider

src/error/__tests__/formatError-test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,10 @@ describe('formatError: default error formatter', () => {
4545
});
4646

4747
it('rejects null and undefined errors', () => {
48-
// @ts-expect-error
4948
expect(() => formatError(undefined)).to.throw(
5049
'Received null or undefined error.',
5150
);
5251

53-
// @ts-expect-error
5452
expect(() => formatError(null)).to.throw(
5553
'Received null or undefined error.',
5654
);

src/error/locatedError.ts

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export function locatedError(
2222
: new Error('Unexpected error value: ' + inspect(rawOriginalError));
2323

2424
// Note: this uses a brand-check to support GraphQL errors originating from other contexts.
25+
// @ts-expect-error FIXME: TS Conversion
2526
if (Array.isArray(originalError.path)) {
2627
// @ts-expect-error
2728
return originalError;

src/execution/execute.ts

+2
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ export function execute(args: ExecutionArgs): PromiseOrValue<ExecutionResult> {
191191
// field and its descendants will be omitted, and sibling fields will still
192192
// be executed. An execution which encounters errors will still result in a
193193
// resolved Promise.
194+
// @ts-expect-error FIXME: TS Conversion
194195
const data = executeOperation(exeContext, exeContext.operation, rootValue);
196+
// @ts-expect-error FIXME: TS Conversion
195197
return buildResponse(exeContext, data);
196198
}
197199

src/jsutils/__tests__/identityFunc-test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { identityFunc } from '../identityFunc';
55

66
describe('identityFunc', () => {
77
it('returns the first argument it receives', () => {
8+
// @ts-expect-error FIXME: TS Conversion
89
expect(identityFunc()).to.equal(undefined);
910
expect(identityFunc(undefined)).to.equal(undefined);
1011
expect(identityFunc(null)).to.equal(null);

src/jsutils/inspect.ts

+2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ function formatObjectValue(
3535

3636
const seenValues = [...previouslySeenValues, value];
3737

38+
// @ts-expect-error FIXME: TS Conversion
3839
if (typeof value.toJSON === 'function') {
40+
// @ts-expect-error FIXME: TS Conversion
3941
const jsonValue = (value.toJSON as () => unknown)();
4042

4143
// check for infinite recursion

src/language/__tests__/visitor-test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ function checkVisitorFnArgs(ast: any, args: any, isEdited: boolean = false) {
5151
}
5252

5353
function getValue(node: ASTNode) {
54+
// @ts-expect-error FIXME: TS Conversion
5455
return node.value != null ? node.value : undefined;
5556
}
5657

@@ -264,6 +265,7 @@ describe('Visitor', () => {
264265
if (node.kind === 'Field' && node.name.value === 'a') {
265266
return {
266267
kind: 'Field',
268+
// @ts-expect-error FIXME: TS Conversion
267269
selectionSet: [addedField].concat(node.selectionSet),
268270
};
269271
}

0 commit comments

Comments
 (0)