Skip to content

Commit

Permalink
use shared deno config & fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
v1rtl committed Mar 7, 2023
1 parent 4c58d41 commit 5f5313c
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"deno.enable": true
"deno.enable": true,
"deno.config": "./deno.json",
"prettier.enable": false
}
36 changes: 36 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"lint": {
"files": {
"include": ["./**/*.ts"],
"exclude": ["./**/*.js"]
}
},
"fmt": {
"files": {
"include": ["./**/*.ts", "./**/*.md", "./**/*.json"],
"exclude": ["./**/*.js"]
},
"options": {
"singleQuote": true,
"semiColons": false,
"useTabs": false,
"indentWidth": 2,
"lineWidth": 120
}
},
"imports": {
"solc": "./mod.ts",
"solc/download": "./download.ts",
"solc/types": "./types.ts",
"solc/env": "./env.ts"
},
"test": {
"files": {
"exclude": ["./**/*.js", "examples"]
}
},
"tasks": {
"test": "deno test --no-check --allow-net --allow-read --allow-write --coverage=coverage",
"cov": "deno coverage coverage --lcov > coverage.lcov"
}
}
2 changes: 1 addition & 1 deletion deps.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { parse } from 'https://esm.sh/graphql@16.6.0/language/parser'
export type { Location, DefinitionNode, DocumentNode } from 'https://esm.sh/graphql@16.6.0/language/ast'
export type { DefinitionNode, DocumentNode, Location } from 'https://esm.sh/graphql@16.6.0/language/ast'
2 changes: 1 addition & 1 deletion example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const query = `
`

const resolvers = {
hello: () => 'world'
hello: () => 'world',
}

const schema = buildASTSchema(typeDefs)
Expand Down
6 changes: 3 additions & 3 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse, Location, DefinitionNode, DocumentNode } from './deps.ts'
import { DefinitionNode, DocumentNode, Location, parse } from './deps.ts'
// A map docString -> graphql document
const docCache = new Map<string, DocumentNode>()

Expand Down Expand Up @@ -78,7 +78,7 @@ function stripLoc(doc: DocumentNode) {
})
})

const loc = doc.loc as Record<string, any>
const loc = doc.loc as { startToken: unknown; endToken: unknown }
if (loc) {
delete loc.startToken
delete loc.endToken
Expand Down Expand Up @@ -120,7 +120,7 @@ function parseDocument(source: string) {
* type Query {
* hello: String
* }
*`
* `
*
* const query = `{ hello }`
*
Expand Down
2 changes: 1 addition & 1 deletion mod_test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { buildASTSchema, isSchema } from 'https://esm.sh/graphql@16.6.0'
import { it, expect, run } from 'https://deno.land/x/tincan@1.0.1/mod.ts'
import { expect, it, run } from 'https://deno.land/x/tincan@1.0.1/mod.ts'
import { gql } from './mod.ts'

const typeDefs = gql`
Expand Down

0 comments on commit 5f5313c

Please sign in to comment.