Skip to content

Commit

Permalink
Use default Supress Comment for Flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Arilas committed May 6, 2019
1 parent 1590133 commit 8300ed4
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 26 deletions.
3 changes: 1 addition & 2 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ unsafe-getters-setters
untyped-import
untyped-type-import


[options]
suppress_comment=.*\\$FlowIgnore
module.use_strict=true
6 changes: 3 additions & 3 deletions src/createModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { BaseRecord } from './types'
import type { Mutators } from './repository'
import type { ColumnMeta } from './utils/createMetadataManager'

// $FlowIgnore
// $FlowFixMe
function definePrivate<T: Function, O>(obj: O, name: string, method: T) {
const wrappedMethod = method.bind(obj)
const descriptor = Object.getOwnPropertyDescriptor(obj, name)
Expand Down Expand Up @@ -36,7 +36,7 @@ export function createModel<T: BaseRecord>(
let origin: $Shape<T> = isFetched ? { ...model } : {}

function getChanges(): $Shape<T> {
// $FlowIgnore
// $FlowFixMe
const columnsMeta: { [key: $Keys<T>]: ColumnMeta } = mutators.getMetadata()
return Object.keys(columnsMeta).reduce(
(target: $Shape<T>, key: string) =>
Expand Down Expand Up @@ -90,6 +90,6 @@ export function createModel<T: BaseRecord>(
definePrivate(model, 'populate', populate)
definePrivate(model, 'remove', remove)

// $FlowIgnore
// $FlowFixMe
return model
}
2 changes: 1 addition & 1 deletion src/manager/connectionCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function connectionCreator<T: {}>(
This method is used to end pool connection and also clear manager state
*/
async function clear() {
// $FlowIgnore
// $FlowFixMe
if (manager.clear) {
await manager.clear()
}
Expand Down
2 changes: 1 addition & 1 deletion src/manager/metadataCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function metadataCreator<T: Queries>(
This method is used to start preparing manager for a use
*/
async function ready() {
// $FlowIgnore
// $FlowFixMe
if (manager.ready) {
await manager.ready()
}
Expand Down
4 changes: 2 additions & 2 deletions src/manager/repositoryCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ export function repositoryCreator<T: Metadata>(
tableName: string,
): Repository<Record> {
if (repos.hasOwnProperty(tableName)) {
// $FlowIgnore we assign it one time
// $FlowFixMe we assign it one time
return repos[tableName]
}
repos[tableName] = createRepository(tableName, manager)
// $FlowIgnore we assign it one time
// $FlowFixMe we assign it one time
return repos[tableName]
}

Expand Down
4 changes: 2 additions & 2 deletions src/query/delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class DeleteQuery extends Squel.cls.Delete {
const newBlocks = blocks || [
new Squel.cls.StringBlock(options, 'DELETE'),
new Squel.cls.TargetTableBlock(options),
// $FlowIgnore
// $FlowFixMe
new Squel.cls.FromTableBlock({
...(options || {}),
singleTable: true,
Expand All @@ -40,6 +40,6 @@ export default function remove(
manager: { ...Queries },
options?: QueryBuilderOptions,
): $DeleteQuery {
// $FlowIgnore
// $FlowFixMe
return new DeleteQuery(manager, options)
}
4 changes: 2 additions & 2 deletions src/query/insert.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class InsertQuery extends Squel.cls.Insert {
options: QueryBuilderOptions,
blocks?: Array<Squel.cls.Block>,
) {
// $FlowIgnore
// $FlowFixMe
super(options, blocks)

this._manager = manager
Expand All @@ -25,6 +25,6 @@ export default function insert(
manager: { ...Queries },
options?: QueryBuilderOptions,
): $InsertQuery {
// $FlowIgnore
// $FlowFixMe
return new InsertQuery(manager, options)
}
6 changes: 3 additions & 3 deletions src/query/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ export class SelectQuery<T: BaseRecord> extends Squel.cls.QueryBuilder {
[key: string]: BaseRecord,
}>,
> => {
// $FlowIgnore
// $FlowFixMe
const result: Array<{ [key: string]: ?Object }> = await this.execute(
true,
)
// $FlowIgnore
// $FlowFixMe
return result.map(item => this._mapper.map(item))
},
}
Expand All @@ -82,6 +82,6 @@ export default function select<T: BaseRecord>(
manager: { ...Metadata },
options?: QueryBuilderOptions,
): $SelectQuery<T> {
// $FlowIgnore
// $FlowFixMe
return new SelectQuery(manager, options)
}
2 changes: 1 addition & 1 deletion src/query/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ export default function update(
manager: { ...Queries },
options?: QueryBuilderOptions,
): $UpdateQuery {
// $FlowIgnore
// $FlowFixMe
return new UpdateQuery(manager, options)
}
2 changes: 1 addition & 1 deletion src/repository/modelsCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function modelsCreator<T: BaseRecord>(
entity: $Shape<Record>,
isSaved: boolean = false,
): Model<Record> {
// $FlowIgnore
// $FlowFixMe
return createModel<Record>(mutators, entity, isSaved)
}

Expand Down
2 changes: 1 addition & 1 deletion src/repository/selectorsCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function selectorsCreator<T: BaseRecord>(
selector(query)
const entities: Array<Record> = await query.execute()

// $FlowIgnore
// $FlowFixMe
return entities.map(entity => hydrator(entity, true))
}

Expand Down
2 changes: 1 addition & 1 deletion src/schema/createMigrationManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export function createMigrationManager(manager: Manager): MigrationManager {
Array.from(migrations.keys())
.filter(migration => !appliedMigrations.hasOwnProperty(migration))
.sort()
// $FlowIgnore fix for model
// $FlowFixMe fix for model
.map(migration => [migration, migrations.get(migration)]),
)
},
Expand Down
2 changes: 1 addition & 1 deletion src/schema/gateways/findAndUpdateGateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function findAndUpdateGateway(): (
return (tableName, criteria, changes) => ({
...createBaseGateway(),
getPostQueries() {
// $FlowIgnore
// $FlowFixMe
const query = updateQuery({})
.criteria(criteria)
.table(tableName)
Expand Down
4 changes: 2 additions & 2 deletions src/schema/gateways/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export function createContext(
const context = {}
let gateways = []
for (const name of Object.keys(registeredGateways)) {
// $FlowIgnore this is not what Flow should control in this application. It's abstract API
// $FlowFixMe this is not what Flow should control in this application. It's abstract API
const handler = registeredGateways[name](metadataManager)
// $FlowIgnore
// $FlowFixMe
context[name] = (...opts: Array<any>) => {
if (opts.length > handler.length) {
throw new Error(`${name} was called with mismatched amount of arguments.
Expand Down
2 changes: 1 addition & 1 deletion src/schema/gateways/putGateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function putGateway(): (
...createBaseGateway(),
getPostQueries() {
return [
// $FlowIgnore
// $FlowFixMe
insert({})
.into(tableName)
.setFieldsRows(entities)
Expand Down
2 changes: 1 addition & 1 deletion src/schema/gateways/tableGateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export function createTableBuilder(
callback: (table: SchemaToolCreateTableContext) => void,
isNew: boolean = true,
) {
// $FlowIgnore
// $FlowFixMe
return tableGateway({ hasTable: () => !isNew })(tableName, callback)
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/compose.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @flow strict */

// $FlowIgnore
// $FlowFixMe
const createComposer = (): $Compose => (...funcs) => {
return arg => funcs.reduceRight((composed, f) => f(composed), arg)
}
Expand Down

0 comments on commit 8300ed4

Please sign in to comment.