Skip to content

Commit e695648

Browse files
saihajIvanGoncharov
authored andcommitted
build: rename to TS eslint rules and temporarily disable eslint rules
1 parent a45f108 commit e695648

File tree

7 files changed

+22
-20
lines changed

7 files changed

+22
-20
lines changed

.eslintrc.yml

Lines changed: 15 additions & 17 deletions
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/execution/__tests__/executor-test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ describe('Execute: Handles basic execution tasks', () => {
443443
throw new Error('Error getting syncError');
444444
},
445445
syncRawError() {
446-
// eslint-disable-next-line no-throw-literal
446+
// eslint-disable-next-line @typescript-eslint/no-throw-literal
447447
throw 'Error getting syncRawError';
448448
},
449449
syncReturnError() {
@@ -480,7 +480,7 @@ describe('Execute: Handles basic execution tasks', () => {
480480
},
481481
asyncRawError() {
482482
return new Promise(() => {
483-
// eslint-disable-next-line no-throw-literal
483+
// eslint-disable-next-line @typescript-eslint/no-throw-literal
484484
throw 'Error getting asyncRawError';
485485
});
486486
},

src/jsutils/__tests__/inspect-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ describe('inspect', () => {
171171

172172
// eslint-disable-next-line func-names
173173
const objectWithoutClassName = new (function () {
174-
// eslint-disable-next-line no-invalid-this
174+
// eslint-disable-next-line @typescript-eslint/no-invalid-this
175175
this.foo = 1;
176176
})();
177177
expect(inspect([[objectWithoutClassName]])).to.equal('[[[Object]]]');

src/subscription/__tests__/mapAsyncIterator-test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { describe, it } from 'mocha';
33

44
import { mapAsyncIterator } from '../mapAsyncIterator';
55

6+
/* eslint-disable @typescript-eslint/require-await */
67
describe('mapAsyncIterator', () => {
78
it('maps over async generator', async () => {
89
async function* source() {

src/subscription/__tests__/subscribe-test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ const DummyQueryType = new GraphQLObjectType({
150150
},
151151
});
152152

153+
/* eslint-disable @typescript-eslint/require-await */
153154
// Check all error cases when initializing the subscription.
154155
describe('Subscription Initialization Phase', () => {
155156
it('accepts multiple subscription fields defined in schema', async () => {

src/utilities/buildClientSchema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ export function buildClientSchema(
171171
// Given a type's introspection result, construct the correct
172172
// GraphQLType instance.
173173
function buildType(type: IntrospectionType): GraphQLNamedType {
174+
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
174175
if (type != null && type.name != null && type.kind != null) {
175176
switch (type.kind) {
176177
case TypeKind.SCALAR:

src/validation/validate.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export function validate(
5757
'Too many validation errors, error limit reached. Validation aborted.',
5858
),
5959
);
60+
// eslint-disable-next-line @typescript-eslint/no-throw-literal
6061
throw abortObj;
6162
}
6263
errors.push(error);

0 commit comments

Comments
 (0)