Skip to content

Commit

Permalink
Temporary relax tsconfig and added bunch of error supressions
Browse files Browse the repository at this point in the history
  • Loading branch information
saihaj authored and IvanGoncharov committed May 25, 2021
1 parent 76e0607 commit c589c3d
Show file tree
Hide file tree
Showing 28 changed files with 158 additions and 56 deletions.
32 changes: 15 additions & 17 deletions .eslintrc.yml
Expand Up @@ -457,22 +457,21 @@ overrides:
'@typescript-eslint/await-thenable': error
'@typescript-eslint/ban-ts-comment': [error, { 'ts-expect-error': false }]
'@typescript-eslint/ban-tslint-comment': error
'@typescript-eslint/ban-types': error
'@typescript-eslint/ban-types': off # TODO temporarily disabled
'@typescript-eslint/class-literal-property-style': off # TODO enable after TS conversion
'@typescript-eslint/consistent-indexed-object-style': off # TODO enable after TS conversion
'@typescript-eslint/consistent-type-assertions':
[error, { assertionStyle: as, objectLiteralTypeAssertions: never }]
'@typescript-eslint/consistent-type-definitions': off # TODO consider
'@typescript-eslint/consistent-type-imports': off # TODO enable after TS conversion
'@typescript-eslint/consistent-type-assertions': off # TODO temporarily disable
'@typescript-eslint/consistent-type-definitions': error
'@typescript-eslint/consistent-type-imports': error
'@typescript-eslint/explicit-function-return-type': off # TODO consider
'@typescript-eslint/explicit-member-accessibility': off # TODO consider
'@typescript-eslint/explicit-module-boundary-types': off # TODO consider
'@typescript-eslint/member-ordering': off # TODO consider
'@typescript-eslint/member-ordering': error
'@typescript-eslint/method-signature-style': error
'@typescript-eslint/naming-convention': off # TODO consider
'@typescript-eslint/no-base-to-string': error
'@typescript-eslint/no-confusing-non-null-assertion': error
'@typescript-eslint/no-confusing-void-expression': error
'@typescript-eslint/no-confusing-void-expression': off # TODO enable with ignoreArrowShorthand
'@typescript-eslint/no-dynamic-delete': off
'@typescript-eslint/no-empty-interface': error
'@typescript-eslint/no-explicit-any': off # TODO error
Expand All @@ -494,21 +493,21 @@ overrides:
'@typescript-eslint/no-require-imports': error
'@typescript-eslint/no-this-alias': error
'@typescript-eslint/no-type-alias': off # TODO consider
'@typescript-eslint/no-unnecessary-boolean-literal-compare': error
'@typescript-eslint/no-unnecessary-condition': error
'@typescript-eslint/no-unnecessary-boolean-literal-compare': off # FIXME requires on strictNullChecks
'@typescript-eslint/no-unnecessary-condition': off # TODO temporary disable
'@typescript-eslint/no-unnecessary-qualifier': error
'@typescript-eslint/no-unnecessary-type-arguments': error
'@typescript-eslint/no-unnecessary-type-assertion': error
'@typescript-eslint/no-unnecessary-type-constraint': off # TODO consider
'@typescript-eslint/no-unnecessary-type-constraint': error
'@typescript-eslint/no-unsafe-argument': off # TODO consider
'@typescript-eslint/no-unsafe-assignment': off # TODO consider
'@typescript-eslint/no-unsafe-call': off # TODO consider
'@typescript-eslint/no-unsafe-member-access': off # TODO consider
'@typescript-eslint/no-unsafe-return': off # TODO consider
'@typescript-eslint/no-var-requires': error
'@typescript-eslint/non-nullable-type-assertion-style': error
'@typescript-eslint/prefer-as-const': off # TODO consider
'@typescript-eslint/prefer-enum-initializers': off # TODO consider
'@typescript-eslint/non-nullable-type-assertion-style': off #TODO temporarily disabled
'@typescript-eslint/prefer-as-const': error
'@typescript-eslint/prefer-enum-initializers': error
'@typescript-eslint/prefer-for-of': off # TODO switch to error after TS migration
'@typescript-eslint/prefer-function-type': error
'@typescript-eslint/prefer-includes': off # TODO switch to error after IE11 drop
Expand All @@ -524,12 +523,11 @@ overrides:
'@typescript-eslint/prefer-string-starts-ends-with': off # TODO switch to error after IE11 drop
'@typescript-eslint/promise-function-async': off
'@typescript-eslint/require-array-sort-compare': error
'@typescript-eslint/restrict-plus-operands':
[error, { checkCompoundAssignments: true }]
'@typescript-eslint/restrict-template-expressions': error
'@typescript-eslint/restrict-plus-operands': off #TODO temporarily disabled
'@typescript-eslint/restrict-template-expressions': off #TODO temporarily disabled
'@typescript-eslint/sort-type-union-intersection-members': off # TODO consider
'@typescript-eslint/strict-boolean-expressions': off # TODO consider
'@typescript-eslint/switch-exhaustiveness-check': error
'@typescript-eslint/switch-exhaustiveness-check': off #TODO temporarily disabled
'@typescript-eslint/triple-slash-reference': error
'@typescript-eslint/typedef': off
'@typescript-eslint/unbound-method': off # TODO consider
Expand Down
2 changes: 0 additions & 2 deletions src/error/__tests__/formatError-test.ts
Expand Up @@ -45,12 +45,10 @@ describe('formatError: default error formatter', () => {
});

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

// @ts-expect-error
expect(() => formatError(null)).to.throw(
'Received null or undefined error.',
);
Expand Down
1 change: 1 addition & 0 deletions src/error/locatedError.ts
Expand Up @@ -22,6 +22,7 @@ export function locatedError(
: new Error('Unexpected error value: ' + inspect(rawOriginalError));

// Note: this uses a brand-check to support GraphQL errors originating from other contexts.
// @ts-expect-error FIXME: TS Conversion
if (Array.isArray(originalError.path)) {
// @ts-expect-error
return originalError;
Expand Down
2 changes: 2 additions & 0 deletions src/execution/execute.ts
Expand Up @@ -191,7 +191,9 @@ export function execute(args: ExecutionArgs): PromiseOrValue<ExecutionResult> {
// field and its descendants will be omitted, and sibling fields will still
// be executed. An execution which encounters errors will still result in a
// resolved Promise.
// @ts-expect-error FIXME: TS Conversion
const data = executeOperation(exeContext, exeContext.operation, rootValue);
// @ts-expect-error FIXME: TS Conversion
return buildResponse(exeContext, data);
}

Expand Down
1 change: 1 addition & 0 deletions src/jsutils/__tests__/identityFunc-test.ts
Expand Up @@ -5,6 +5,7 @@ import { identityFunc } from '../identityFunc';

describe('identityFunc', () => {
it('returns the first argument it receives', () => {
// @ts-expect-error FIXME: TS Conversion
expect(identityFunc()).to.equal(undefined);
expect(identityFunc(undefined)).to.equal(undefined);
expect(identityFunc(null)).to.equal(null);
Expand Down
2 changes: 2 additions & 0 deletions src/jsutils/inspect.ts
Expand Up @@ -35,7 +35,9 @@ function formatObjectValue(

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

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

// check for infinite recursion
Expand Down
2 changes: 2 additions & 0 deletions src/language/__tests__/visitor-test.ts
Expand Up @@ -51,6 +51,7 @@ function checkVisitorFnArgs(ast: any, args: any, isEdited: boolean = false) {
}

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

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

0 comments on commit c589c3d

Please sign in to comment.