Skip to content

Commit 83e89bc

Browse files
committed
chore: typecheck everything
1 parent 5d7f0e7 commit 83e89bc

File tree

17 files changed

+109
-67
lines changed

17 files changed

+109
-67
lines changed

.eslintrc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
module.exports = {
1+
/**
2+
* @type {import('eslint').Linter.Config}
3+
*/
4+
const opts = {
25
env: {
36
es2020: true,
47
node: true,
@@ -22,3 +25,4 @@ module.exports = {
2225
],
2326
},
2427
};
28+
module.exports = opts;

babel.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
module.exports = {
1+
/**
2+
* @type {import('@babel/core').TransformOptions}
3+
*/
4+
const opts = {
25
presets: [
3-
['@babel/preset-env', { targets: { node: 'current' } }],
6+
['@babel/env', { targets: { node: 'current' } }],
47
'@babel/typescript',
58
],
69
plugins: [
@@ -10,3 +13,4 @@ module.exports = {
1013
'@babel/proposal-optional-chaining',
1114
],
1215
};
16+
module.exports = opts;

implementations/apollo-server/index.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// @ts-check
2-
31
import { GraphQLSchema, GraphQLString, GraphQLObjectType } from 'graphql';
42
import { ApolloServer } from '@apollo/server';
53
import { startStandaloneServer } from '@apollo/server/standalone';

implementations/express-graphql/index.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// @ts-check
2-
31
import { GraphQLSchema, GraphQLString, GraphQLObjectType } from 'graphql';
42
import express from 'express';
53
import { graphqlHTTP } from 'express-graphql';

implementations/graphql-helix/index.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// @ts-check
2-
31
import { GraphQLSchema, GraphQLString, GraphQLObjectType } from 'graphql';
42
import {
53
getGraphQLParameters,

implementations/graphql-yoga/index.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// @ts-check
2-
31
import { GraphQLSchema, GraphQLString, GraphQLObjectType } from 'graphql';
42
import { createYoga } from 'graphql-yoga';
53
import { createServer } from 'http';

implementations/mercurius/index.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// @ts-check
2-
31
import { GraphQLSchema, GraphQLString, GraphQLObjectType } from 'graphql';
42
import Fastify from 'fastify';
53
import mercurius from 'mercurius';

jest.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
module.exports = {
1+
/**
2+
* @type {import('jest').Config}
3+
*/
4+
const opts = {
25
testEnvironment: 'node',
3-
moduleFileExtensions: ['js', 'ts'],
6+
moduleFileExtensions: ['ts', 'js'],
47
extensionsToTreatAsEsm: ['.ts'],
58
testPathIgnorePatterns: ['/node_modules/', '/fixtures/', '/utils/'],
69
};
10+
module.exports = opts;

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
7878
"build:esm": "tsc -b tsconfig.esm.json && node scripts/esm-post-process.mjs",
7979
"build:cjs": "tsc -b tsconfig.cjs.json",
80-
"build:umd": "rollup -c && gzip umd/graphql-http.min.js -c > umd/graphql-http.min.js.gz",
80+
"build:umd": "rollup --bundleConfigAsCjs --config rollup.config.ts --configPlugin typescript && gzip umd/graphql-http.min.js -c > umd/graphql-http.min.js.gz",
8181
"build": "yarn build:esm && yarn build:cjs && yarn build:umd",
8282
"release": "semantic-release"
8383
},
@@ -95,10 +95,13 @@
9595
"@babel/plugin-proposal-optional-chaining": "^7.18.9",
9696
"@babel/preset-env": "^7.20.2",
9797
"@babel/preset-typescript": "^7.18.6",
98+
"@rollup/plugin-terser": "^0.2.1",
9899
"@rollup/plugin-typescript": "^9.0.2",
99100
"@semantic-release/changelog": "^6.0.1",
100101
"@semantic-release/git": "^10.0.1",
102+
"@types/eslint": "^8.4.10",
101103
"@types/express": "^4.17.14",
104+
"@types/glob": "^8.0.0",
102105
"@types/jest": "^29.2.2",
103106
"@typescript-eslint/eslint-plugin": "^5.42.1",
104107
"@typescript-eslint/parser": "^5.42.1",
@@ -115,7 +118,6 @@
115118
"node-fetch": "^3.2.10",
116119
"prettier": "^2.7.1",
117120
"rollup": "^3.2.5",
118-
"rollup-plugin-terser": "^7.0.2",
119121
"semantic-release": "^19.0.5",
120122
"tslib": "^2.4.1",
121123
"typedoc": "^0.23.20",

rollup.config.mjs renamed to rollup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import typescript from '@rollup/plugin-typescript';
2-
import { terser } from 'rollup-plugin-terser';
2+
import terser from '@rollup/plugin-terser';
33

44
export default {
55
input: './src/client.ts',

0 commit comments

Comments
 (0)