Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(lint): add semicolons (via
prettier
) (#807)
This diff only contains semicolon changes (except for a few places where adding a semicolon caused the line to wrap, and thus whitespace trailing commas were added also). You can confirm this with `git diff -w --word-diff-regex='[^[:space:]]'` and `git diff -w --word-diff-regex='[^;]'` across the relevant git range
- Loading branch information
Showing
30 changed files
with
1,502 additions
and
1,485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
printWidth: 100, | ||
semi: false, | ||
semi: true, | ||
singleQuote: true, | ||
trailingComma: "all", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { readFile } from 'fs' | ||
import * as minify from 'pg-minify' | ||
import { readFile } from 'fs'; | ||
import * as minify from 'pg-minify'; | ||
|
||
const kitchenSinkSchemaSql = new Promise<string>((resolve, reject) => { | ||
readFile('examples/kitchen-sink/schema.sql', (error, data) => { | ||
if (error) reject(error) | ||
else resolve(minify(data.toString().replace(/begin;|commit;/g, ''))) | ||
}) | ||
}) | ||
if (error) reject(error); | ||
else resolve(minify(data.toString().replace(/begin;|commit;/g, ''))); | ||
}); | ||
}); | ||
|
||
export default kitchenSinkSchemaSql | ||
export default kitchenSinkSchemaSql; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { Pool } from 'pg' | ||
import { parse as parsePgConnectionString } from 'pg-connection-string' | ||
import { Pool } from 'pg'; | ||
import { parse as parsePgConnectionString } from 'pg-connection-string'; | ||
|
||
const pgUrl = process.env.TEST_PG_URL || 'postgres://localhost:5432/postgraphile_test' | ||
const pgUrl = process.env.TEST_PG_URL || 'postgres://localhost:5432/postgraphile_test'; | ||
|
||
const pgPool = new Pool({ | ||
...parsePgConnectionString(pgUrl), | ||
max: 15, | ||
idleTimeoutMillis: 500, | ||
}) | ||
}); | ||
|
||
export default pgPool | ||
export default pgPool; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
import { parse, buildASTSchema } from 'graphql' | ||
import { printSchema } from 'graphql/utilities' | ||
import { parse, buildASTSchema } from 'graphql'; | ||
import { printSchema } from 'graphql/utilities'; | ||
|
||
export default function printSchemaOrdered(originalSchema) { | ||
// Clone schema so we don't damage anything | ||
const schema = buildASTSchema(parse(printSchema(originalSchema))) | ||
const schema = buildASTSchema(parse(printSchema(originalSchema))); | ||
|
||
const typeMap = schema.getTypeMap() | ||
const typeMap = schema.getTypeMap(); | ||
Object.keys(typeMap).forEach(name => { | ||
const gqlType = typeMap[name] | ||
const gqlType = typeMap[name]; | ||
|
||
// Object? | ||
if (gqlType.getFields) { | ||
const fields = gqlType.getFields() | ||
const keys = Object.keys(fields).sort() | ||
const fields = gqlType.getFields(); | ||
const keys = Object.keys(fields).sort(); | ||
keys.forEach(key => { | ||
const value = fields[key] | ||
const value = fields[key]; | ||
|
||
// Move the key to the end of the object | ||
delete fields[key] | ||
fields[key] = value | ||
delete fields[key]; | ||
fields[key] = value; | ||
|
||
// Sort args | ||
if (value.args) { | ||
value.args.sort((a, b) => a.name.localeCompare(b.name)) | ||
value.args.sort((a, b) => a.name.localeCompare(b.name)); | ||
} | ||
}) | ||
}); | ||
} | ||
|
||
// Enum? | ||
if (gqlType.getValues) { | ||
gqlType.getValues().sort((a, b) => a.name.localeCompare(b.name)) | ||
gqlType.getValues().sort((a, b) => a.name.localeCompare(b.name)); | ||
} | ||
}) | ||
}); | ||
|
||
return printSchema(schema) | ||
return printSchema(schema); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.