Skip to content

Commit

Permalink
feat: enable noImplicitOverride tsc setting (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
wschurman authored Sep 7, 2021
1 parent 7612392 commit 4263cb9
Show file tree
Hide file tree
Showing 49 changed files with 382 additions and 387 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"tsc": "lerna run tsc",
"clean": "lerna run clean",
"lint": "lerna run lint",
"lint-fix": "lerna run lint-fix",
"test": "lerna run test",
"integration": "./resources/run-with-docker lerna run integration-no-setup",
"prepublish": "lerna link && lerna run clean",
Expand All @@ -32,7 +33,7 @@
"lerna": "^4.0.0",
"nullthrows": "^1.1.1",
"pg": "^8.6.0",
"prettier": "^2.1.0",
"prettier": "^2.3.2",
"ts-jest": "~26.4.4",
"ts-mockito": "^2.6.1",
"typedoc": "^0.21.9",
Expand Down
1 change: 1 addition & 0 deletions packages/entity-cache-adapter-redis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"tsc": "tsc",
"clean": "rm -rf build coverage coverage-integration",
"lint": "eslint src",
"lint-fix": "eslint src --fix",
"test": "jest --rootDir . --config ../../resources/jest.config.js",
"integration": "../../resources/run-with-docker yarn integration-no-setup",
"integration-no-setup": "jest --config ../../resources/jest-integration.config.js --rootDir . --runInBand --passWithNoTests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,31 @@ export class RedisTestEntityPrivacyPolicy extends EntityPrivacyPolicy<
ViewerContext,
RedisTestEntity
> {
protected readonly createRules = [
protected override readonly createRules = [
new AlwaysAllowPrivacyPolicyRule<
RedisTestEntityFields,
string,
ViewerContext,
RedisTestEntity
>(),
];
protected readonly readRules = [
protected override readonly readRules = [
new AlwaysAllowPrivacyPolicyRule<
RedisTestEntityFields,
string,
ViewerContext,
RedisTestEntity
>(),
];
protected readonly updateRules = [
protected override readonly updateRules = [
new AlwaysAllowPrivacyPolicyRule<
RedisTestEntityFields,
string,
ViewerContext,
RedisTestEntity
>(),
];
protected readonly deleteRules = [
protected override readonly deleteRules = [
new AlwaysAllowPrivacyPolicyRule<
RedisTestEntityFields,
string,
Expand Down
1 change: 1 addition & 0 deletions packages/entity-database-adapter-knex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"tsc": "tsc",
"clean": "rm -rf build coverage coverage-integration",
"lint": "eslint src",
"lint-fix": "eslint src --fix",
"test": "jest --rootDir . --config ../../resources/jest.config.js --passWithNoTests",
"integration": "../../resources/run-with-docker yarn integration-no-setup",
"integration-no-setup": "jest --config ../../resources/jest-integration.config.js --rootDir . --runInBand --passWithNoTests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,10 @@ export default class PostgresEntityDatabaseAdapter<TFields> extends EntityDataba

if (tableFieldSingleValueEqualityOperands.length > 0) {
const whereObject: { [key: string]: any } = {};
const nonNullTableFieldSingleValueEqualityOperands = tableFieldSingleValueEqualityOperands.filter(
({ tableValue }) => tableValue !== null
);
const nullTableFieldSingleValueEqualityOperands = tableFieldSingleValueEqualityOperands.filter(
({ tableValue }) => tableValue === null
);
const nonNullTableFieldSingleValueEqualityOperands =
tableFieldSingleValueEqualityOperands.filter(({ tableValue }) => tableValue !== null);
const nullTableFieldSingleValueEqualityOperands =
tableFieldSingleValueEqualityOperands.filter(({ tableValue }) => tableValue === null);

if (nonNullTableFieldSingleValueEqualityOperands.length > 0) {
for (const { tableField, tableValue } of nonNullTableFieldSingleValueEqualityOperands) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
import PostgresEntityDatabaseAdapter from './PostgresEntityDatabaseAdapter';

export default class PostgresEntityDatabaseAdapterProvider
implements IEntityDatabaseAdapterProvider {
implements IEntityDatabaseAdapterProvider
{
getDatabaseAdapter<TFields>(
entityConfiguration: EntityConfiguration<TFields>
): EntityDatabaseAdapter<TFields> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,31 +106,31 @@ class ErrorsTestEntityPrivacyPolicy extends EntityPrivacyPolicy<
ViewerContext,
ErrorsTestEntity
> {
protected readonly createRules = [
protected override readonly createRules = [
new AlwaysAllowPrivacyPolicyRule<
ErrorsTestEntityFields,
number,
ViewerContext,
ErrorsTestEntity
>(),
];
protected readonly readRules = [
protected override readonly readRules = [
new AlwaysAllowPrivacyPolicyRule<
ErrorsTestEntityFields,
number,
ViewerContext,
ErrorsTestEntity
>(),
];
protected readonly updateRules = [
protected override readonly updateRules = [
new AlwaysAllowPrivacyPolicyRule<
ErrorsTestEntityFields,
number,
ViewerContext,
ErrorsTestEntity
>(),
];
protected readonly deleteRules = [
protected override readonly deleteRules = [
new AlwaysAllowPrivacyPolicyRule<
ErrorsTestEntityFields,
number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,31 @@ class InvalidTestEntityPrivacyPolicy extends EntityPrivacyPolicy<
ViewerContext,
InvalidTestEntity
> {
protected readonly createRules = [
protected override readonly createRules = [
new AlwaysAllowPrivacyPolicyRule<
InvalidTestEntityFields,
number,
ViewerContext,
InvalidTestEntity
>(),
];
protected readonly readRules = [
protected override readonly readRules = [
new AlwaysAllowPrivacyPolicyRule<
InvalidTestEntityFields,
number,
ViewerContext,
InvalidTestEntity
>(),
];
protected readonly updateRules = [
protected override readonly updateRules = [
new AlwaysAllowPrivacyPolicyRule<
InvalidTestEntityFields,
number,
ViewerContext,
InvalidTestEntity
>(),
];
protected readonly deleteRules = [
protected override readonly deleteRules = [
new AlwaysAllowPrivacyPolicyRule<
InvalidTestEntityFields,
number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,31 +81,31 @@ class PostgresTestEntityPrivacyPolicy extends EntityPrivacyPolicy<
ViewerContext,
PostgresTestEntity
> {
protected readonly createRules = [
protected override readonly createRules = [
new AlwaysAllowPrivacyPolicyRule<
PostgresTestEntityFields,
string,
ViewerContext,
PostgresTestEntity
>(),
];
protected readonly readRules = [
protected override readonly readRules = [
new AlwaysAllowPrivacyPolicyRule<
PostgresTestEntityFields,
string,
ViewerContext,
PostgresTestEntity
>(),
];
protected readonly updateRules = [
protected override readonly updateRules = [
new AlwaysAllowPrivacyPolicyRule<
PostgresTestEntityFields,
string,
ViewerContext,
PostgresTestEntity
>(),
];
protected readonly deleteRules = [
protected override readonly deleteRules = [
new AlwaysAllowPrivacyPolicyRule<
PostgresTestEntityFields,
string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,31 +63,31 @@ class PostgresTriggerTestEntityPrivacyPolicy extends EntityPrivacyPolicy<
ViewerContext,
PostgresTriggerTestEntity
> {
protected readonly createRules = [
protected override readonly createRules = [
new AlwaysAllowPrivacyPolicyRule<
PostgresTriggerTestEntityFields,
string,
ViewerContext,
PostgresTriggerTestEntity
>(),
];
protected readonly readRules = [
protected override readonly readRules = [
new AlwaysAllowPrivacyPolicyRule<
PostgresTriggerTestEntityFields,
string,
ViewerContext,
PostgresTriggerTestEntity
>(),
];
protected readonly updateRules = [
protected override readonly updateRules = [
new AlwaysAllowPrivacyPolicyRule<
PostgresTriggerTestEntityFields,
string,
ViewerContext,
PostgresTriggerTestEntity
>(),
];
protected readonly deleteRules = [
protected override readonly deleteRules = [
new AlwaysAllowPrivacyPolicyRule<
PostgresTriggerTestEntityFields,
string,
Expand Down Expand Up @@ -144,23 +144,22 @@ class ThrowConditionallyNonTransactionalTrigger extends EntityNonTransactionalMu
}
}

export const postgresTestEntityConfiguration = new EntityConfiguration<
PostgresTriggerTestEntityFields
>({
idField: 'id',
tableName: 'postgres_test_entities',
schema: {
id: new UUIDField({
columnName: 'id',
cache: true,
}),
name: new StringField({
columnName: 'name',
}),
},
databaseAdapterFlavor: 'postgres',
cacheAdapterFlavor: 'redis',
});
export const postgresTestEntityConfiguration =
new EntityConfiguration<PostgresTriggerTestEntityFields>({
idField: 'id',
tableName: 'postgres_test_entities',
schema: {
id: new UUIDField({
columnName: 'id',
cache: true,
}),
name: new StringField({
columnName: 'name',
}),
},
databaseAdapterFlavor: 'postgres',
cacheAdapterFlavor: 'redis',
});

const postgresTestEntityCompanionDefinition = new EntityCompanionDefinition({
entityClass: PostgresTriggerTestEntity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,31 @@ class PostgresValidatorTestEntityPrivacyPolicy extends EntityPrivacyPolicy<
ViewerContext,
PostgresValidatorTestEntity
> {
protected readonly createRules = [
protected override readonly createRules = [
new AlwaysAllowPrivacyPolicyRule<
PostgresValidatorTestEntityFields,
string,
ViewerContext,
PostgresValidatorTestEntity
>(),
];
protected readonly readRules = [
protected override readonly readRules = [
new AlwaysAllowPrivacyPolicyRule<
PostgresValidatorTestEntityFields,
string,
ViewerContext,
PostgresValidatorTestEntity
>(),
];
protected readonly updateRules = [
protected override readonly updateRules = [
new AlwaysAllowPrivacyPolicyRule<
PostgresValidatorTestEntityFields,
string,
ViewerContext,
PostgresValidatorTestEntity
>(),
];
protected readonly deleteRules = [
protected override readonly deleteRules = [
new AlwaysAllowPrivacyPolicyRule<
PostgresValidatorTestEntityFields,
string,
Expand Down Expand Up @@ -126,23 +126,22 @@ class ThrowConditionallyTrigger extends EntityMutationTrigger<
}
}

export const postgresTestEntityConfiguration = new EntityConfiguration<
PostgresValidatorTestEntityFields
>({
idField: 'id',
tableName: 'postgres_test_entities',
schema: {
id: new UUIDField({
columnName: 'id',
cache: true,
}),
name: new StringField({
columnName: 'name',
}),
},
databaseAdapterFlavor: 'postgres',
cacheAdapterFlavor: 'redis',
});
export const postgresTestEntityConfiguration =
new EntityConfiguration<PostgresValidatorTestEntityFields>({
idField: 'id',
tableName: 'postgres_test_entities',
schema: {
id: new UUIDField({
columnName: 'id',
cache: true,
}),
name: new StringField({
columnName: 'name',
}),
},
databaseAdapterFlavor: 'postgres',
cacheAdapterFlavor: 'redis',
});

const postgresTestEntityCompanionDefinition = new EntityCompanionDefinition({
entityClass: PostgresValidatorTestEntity,
Expand Down
1 change: 1 addition & 0 deletions packages/entity-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"tsc": "tsc",
"clean": "rm -rf build coverage coverage-integration",
"lint": "eslint src",
"lint-fix": "eslint src --fix",
"test": "jest --rootDir . --config ../../resources/jest.config.js",
"integration": "../../resources/run-with-docker yarn integration-no-setup",
"integration-no-setup": "jest --config ../../resources/jest-integration.config.js --rootDir . --runInBand --passWithNoTests",
Expand Down
8 changes: 4 additions & 4 deletions packages/entity-example/src/entities/NotePrivacyPolicy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ export default class NotePrivacyPolicy extends EntityPrivacyPolicy<
ExampleViewerContext,
NoteEntity
> {
protected readonly readRules = [
protected override readonly readRules = [
new AlwaysAllowPrivacyPolicyRule<NoteFields, string, ExampleViewerContext, NoteEntity>(),
];
protected readonly createRules = [
protected override readonly createRules = [
new AllowIfUserOwnerPrivacyRule<NoteFields, string, NoteEntity>('userID'),
];
protected readonly updateRules = [
protected override readonly updateRules = [
new AllowIfUserOwnerPrivacyRule<NoteFields, string, NoteEntity>('userID'),
];
protected readonly deleteRules = [
protected override readonly deleteRules = [
new AllowIfUserOwnerPrivacyRule<NoteFields, string, NoteEntity>('userID'),
];
}
1 change: 1 addition & 0 deletions packages/entity-full-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"tsc": "tsc",
"clean": "rm -rf build coverage coverage-integration",
"lint": "eslint src",
"lint-fix": "eslint src --fix",
"test": "jest --rootDir . --config ../../resources/jest.config.js --passWithNoTests",
"integration": "../../resources/run-with-docker yarn integration-no-setup",
"integration-no-setup": "jest --config ../../resources/jest-integration.config.js --rootDir . --runInBand --passWithNoTests",
Expand Down
Loading

0 comments on commit 4263cb9

Please sign in to comment.