Skip to content

Commit 5f5313c

Browse files
author
v1rtl
committed
use shared deno config & fmt
1 parent 4c58d41 commit 5f5313c

File tree

6 files changed

+45
-7
lines changed

6 files changed

+45
-7
lines changed

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"deno.enable": true
2+
"deno.enable": true,
3+
"deno.config": "./deno.json",
4+
"prettier.enable": false
35
}

deno.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"lint": {
3+
"files": {
4+
"include": ["./**/*.ts"],
5+
"exclude": ["./**/*.js"]
6+
}
7+
},
8+
"fmt": {
9+
"files": {
10+
"include": ["./**/*.ts", "./**/*.md", "./**/*.json"],
11+
"exclude": ["./**/*.js"]
12+
},
13+
"options": {
14+
"singleQuote": true,
15+
"semiColons": false,
16+
"useTabs": false,
17+
"indentWidth": 2,
18+
"lineWidth": 120
19+
}
20+
},
21+
"imports": {
22+
"solc": "./mod.ts",
23+
"solc/download": "./download.ts",
24+
"solc/types": "./types.ts",
25+
"solc/env": "./env.ts"
26+
},
27+
"test": {
28+
"files": {
29+
"exclude": ["./**/*.js", "examples"]
30+
}
31+
},
32+
"tasks": {
33+
"test": "deno test --no-check --allow-net --allow-read --allow-write --coverage=coverage",
34+
"cov": "deno coverage coverage --lcov > coverage.lcov"
35+
}
36+
}

deps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export { parse } from 'https://esm.sh/graphql@16.6.0/language/parser'
2-
export type { Location, DefinitionNode, DocumentNode } from 'https://esm.sh/graphql@16.6.0/language/ast'
2+
export type { DefinitionNode, DocumentNode, Location } from 'https://esm.sh/graphql@16.6.0/language/ast'

example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const query = `
1414
`
1515

1616
const resolvers = {
17-
hello: () => 'world'
17+
hello: () => 'world',
1818
}
1919

2020
const schema = buildASTSchema(typeDefs)

mod.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { parse, Location, DefinitionNode, DocumentNode } from './deps.ts'
1+
import { DefinitionNode, DocumentNode, Location, parse } from './deps.ts'
22
// A map docString -> graphql document
33
const docCache = new Map<string, DocumentNode>()
44

@@ -78,7 +78,7 @@ function stripLoc(doc: DocumentNode) {
7878
})
7979
})
8080

81-
const loc = doc.loc as Record<string, any>
81+
const loc = doc.loc as { startToken: unknown; endToken: unknown }
8282
if (loc) {
8383
delete loc.startToken
8484
delete loc.endToken
@@ -120,7 +120,7 @@ function parseDocument(source: string) {
120120
* type Query {
121121
* hello: String
122122
* }
123-
*`
123+
* `
124124
*
125125
* const query = `{ hello }`
126126
*

mod_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { buildASTSchema, isSchema } from 'https://esm.sh/graphql@16.6.0'
2-
import { it, expect, run } from 'https://deno.land/x/tincan@1.0.1/mod.ts'
2+
import { expect, it, run } from 'https://deno.land/x/tincan@1.0.1/mod.ts'
33
import { gql } from './mod.ts'
44

55
const typeDefs = gql`

0 commit comments

Comments
 (0)