Skip to content

Commit 7bdc961

Browse files
committed
refactor: migrate to typescript
1 parent f17bfb2 commit 7bdc961

File tree

109 files changed

+451448
-385041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+451448
-385041
lines changed

.babelrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

.eslintignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
coverage
21
flow-typed
2+
lib
3+
mjs
4+
esm

.eslintrc.js

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,46 @@
1+
const path = require('path');
2+
13
module.exports = {
2-
env: {
3-
node: true,
4-
es6: true,
5-
jest: true,
6-
},
7-
extends: ['airbnb-base', 'prettier'],
8-
plugins: ['prettier'],
9-
env: {
10-
jasmine: true,
11-
jest: true,
4+
parser: '@typescript-eslint/parser',
5+
plugins: ['@typescript-eslint', 'prettier'],
6+
extends: ['plugin:@typescript-eslint/recommended', 'prettier', 'plugin:prettier/recommended'],
7+
parserOptions: {
8+
sourceType: 'module',
9+
useJSXTextNode: true,
10+
project: [path.resolve(__dirname, 'tsconfig.json')],
1211
},
13-
parser: 'babel-eslint',
1412
rules: {
15-
'import/no-unresolved': [2, { commonjs: true, amd: true }],
1613
'no-underscore-dangle': 0,
1714
'arrow-body-style': 0,
18-
'import/no-extraneous-dependencies': 0,
19-
'import/imports-first': 0,
20-
'import/no-cycle': 0,
15+
'no-unused-expressions': 0,
16+
'no-plusplus': 0,
2117
'no-console': 0,
22-
'no-restricted-syntax': 0,
23-
'global-require': 0,
24-
'import/no-dynamic-require': 0,
25-
'import/prefer-default-export': 0,
26-
'no-use-before-define': 0,
27-
'no-param-reassign': 0,
2818
'func-names': 0,
29-
'prettier/prettier': [
19+
'comma-dangle': [
3020
'error',
3121
{
32-
printWidth: 100,
33-
singleQuote: true,
34-
trailingComma: 'es5',
22+
arrays: 'always-multiline',
23+
objects: 'always-multiline',
24+
imports: 'always-multiline',
25+
exports: 'always-multiline',
26+
functions: 'ignore',
3527
},
3628
],
29+
'no-prototype-builtins': 0,
30+
'prefer-destructuring': 0,
31+
'no-else-return': 0,
32+
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
33+
'@typescript-eslint/explicit-member-accessibility': 0,
34+
'@typescript-eslint/no-explicit-any': 0,
35+
'@typescript-eslint/no-inferrable-types': 0,
36+
'@typescript-eslint/explicit-function-return-type': 0,
37+
'@typescript-eslint/no-use-before-define': 0,
38+
'@typescript-eslint/no-empty-function': 0,
39+
'@typescript-eslint/camelcase': 0,
40+
'@typescript-eslint/ban-ts-comment': 0,
41+
},
42+
env: {
43+
jasmine: true,
44+
jest: true,
3745
},
38-
globals: { Class: true },
3946
};

.flowconfig

Lines changed: 0 additions & 49 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"singleQuote": true,
3-
"arrowParens": "always",
43
"tabWidth": 2,
54
"useTabs": false,
65
"printWidth": 100,

.vscode/launch.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@
2828
"console": "integratedTerminal",
2929
"internalConsoleOptions": "neverOpen",
3030
"disableOptimisticBPs": true
31+
},
32+
{
33+
"type": "node",
34+
"request": "launch",
35+
"name": "Debug",
36+
"program": "${workspaceFolder}/index.js",
37+
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/babel-node",
38+
"runtimeArgs": [
39+
"--nolazy"
40+
]
3141
}
3242
]
3343
}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
Live example on Heroku: [https://graphql-compose.herokuapp.com/](https://graphql-compose.herokuapp.com/)
66

7-
```
8-
npm install
9-
npm run seed && npm run start:watch
7+
```bash
8+
yarn install
9+
yarn seed && yarn dev
1010
open http://localhost:3000
1111
```
1212

config.js renamed to config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* @flow */
2-
31
import path from 'path';
42
import fs from 'fs';
53

@@ -19,7 +17,7 @@ export function resolveExamplePath(...args: any) {
1917
}
2018

2119
export function getExampleNames() {
22-
const preferableOrder = ['user', 'userForRelay', 'northwind', 'mongooseDiscriminators'];
20+
const preferableOrder = ['user', 'northwind', 'mongooseDiscriminators'];
2321
const dirs = getDirectories(examplesPath);
2422

2523
const result = [];

0 commit comments

Comments
 (0)