Skip to content

Commit f19e08e

Browse files
authored
refactor: migrate from Flow to TypeScript
BREAKING CHANGE: Flowtype definitions were removed
1 parent 698b14b commit f19e08e

Some content is hidden

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

56 files changed

+1722
-10866
lines changed

.babelrc

-46
This file was deleted.

.eslintrc

-52
This file was deleted.

.eslintrc.js

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
parser: '@typescript-eslint/parser',
5+
plugins: ['@typescript-eslint', 'prettier'],
6+
extends: [
7+
'plugin:@typescript-eslint/recommended',
8+
'prettier/@typescript-eslint',
9+
'plugin:prettier/recommended',
10+
],
11+
parserOptions: {
12+
sourceType: 'module',
13+
useJSXTextNode: true,
14+
project: [path.resolve(__dirname, 'tsconfig.json')],
15+
},
16+
rules: {
17+
'no-underscore-dangle': 0,
18+
'arrow-body-style': 0,
19+
'no-unused-expressions': 0,
20+
'no-plusplus': 0,
21+
'no-console': 0,
22+
'func-names': 0,
23+
'comma-dangle': [
24+
'error',
25+
{
26+
arrays: 'always-multiline',
27+
objects: 'always-multiline',
28+
imports: 'always-multiline',
29+
exports: 'always-multiline',
30+
functions: 'ignore',
31+
},
32+
],
33+
'no-prototype-builtins': 0,
34+
'prefer-destructuring': 0,
35+
'no-else-return': 0,
36+
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
37+
'@typescript-eslint/explicit-member-accessibility': 0,
38+
'@typescript-eslint/no-explicit-any': 0,
39+
'@typescript-eslint/no-inferrable-types': 0,
40+
'@typescript-eslint/explicit-function-return-type': 0,
41+
'@typescript-eslint/no-use-before-define': 0,
42+
'@typescript-eslint/no-empty-function': 0,
43+
'@typescript-eslint/camelcase': 0,
44+
},
45+
env: {
46+
jasmine: true,
47+
jest: true,
48+
},
49+
};

.flowconfig

-46
This file was deleted.

.prettierrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"singleQuote": true,
3+
"arrowParens": "always",
34
"tabWidth": 2,
45
"useTabs": false,
56
"printWidth": 100,
67
"trailingComma": "es5"
7-
}
8+
}

.travis.yml

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ notifications:
99
node_js:
1010
- "10"
1111
- "12"
12-
before_install: yarn global add greenkeeper-lockfile@1
13-
before_script: greenkeeper-lockfile-update
14-
after_script: greenkeeper-lockfile-upload
1512
script:
1613
- yarn run test
1714
- yarn run build

.vscode/launch.json

+8-11
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,26 @@
55
"version": "0.2.0",
66
"configurations": [
77
{
8-
"name": "Jest",
8+
"name": "Jest Current File",
99
"type": "node",
1010
"request": "launch",
1111
"program": "${workspaceFolder}/node_modules/.bin/jest",
12-
"args": ["--runInBand", "--watch"],
13-
"cwd": "${workspaceFolder}",
12+
"args": ["${fileBasenameNoExtension}", "--config", "jest.config.js"],
1413
"console": "integratedTerminal",
1514
"internalConsoleOptions": "neverOpen",
16-
"disableOptimisticBPs": true
15+
"runtimeArgs": ["--nolazy"], // tells v8 to compile your code ahead of time, so that breakpoints work correctly
16+
"disableOptimisticBPs": true // also helps that breakpoints work correctly
1717
},
1818
{
19-
"name": "Jest Current File",
19+
"name": "Jest",
2020
"type": "node",
2121
"request": "launch",
2222
"program": "${workspaceFolder}/node_modules/.bin/jest",
23-
"args": [
24-
"${fileBasenameNoExtension}",
25-
"--config",
26-
"jest.config.js"
27-
],
23+
"args": ["--runInBand", "--watch"],
24+
"cwd": "${workspaceFolder}",
2825
"console": "integratedTerminal",
2926
"internalConsoleOptions": "neverOpen",
3027
"disableOptimisticBPs": true
3128
}
3229
]
33-
}
30+
}

.vscode/settings.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
2-
"eslint.validate": ["javascript"],
32
"javascript.validate.enable": false,
4-
"javascript.autoClosingTags": false,
5-
"eslint.autoFixOnSave": true,
3+
"eslint.validate": [
4+
{ "language": "javascript", "autoFix": true },
5+
{ "language": "javascriptreact", "autoFix": true },
6+
{ "language": "typescript", "autoFix": true },
7+
{ "language": "typescriptreact", "autoFix": true }
8+
],
9+
"typescript.tsdk": "node_modules/typescript/lib",
610
"editor.codeActionsOnSave": {
711
"source.fixAll.eslint": true
8-
}
12+
},
13+
"eslint.autoFixOnSave": true,
914
}

.vscode/tasks.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "Eslint checks",
8+
"type": "shell",
9+
"command": "./node_modules/.bin/eslint 'packages/*/src/**/*.{js,ts,tsx}'",
10+
"problemMatcher": ["$eslint-stylish"],
11+
"isBackground": true,
12+
"presentation": {
13+
"reveal": "never"
14+
},
15+
"runOptions": {
16+
"reevaluateOnRerun": true,
17+
"runOn": "folderOpen"
18+
},
19+
"group": {
20+
"kind": "build",
21+
"isDefault": true
22+
}
23+
}
24+
]
25+
}

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[![npm](https://img.shields.io/npm/v/graphql-compose-json.svg)](https://www.npmjs.com/package/graphql-compose-json)
66
[![trends](https://img.shields.io/npm/dt/graphql-compose-json.svg)](http://www.npmtrends.com/graphql-compose-json)
77
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
8-
[![Greenkeeper badge](https://badges.greenkeeper.io/graphql-compose/graphql-compose-json.svg)](https://greenkeeper.io/)
98

109
This is a plugin for [graphql-compose](https://github.com/nodkz/graphql-compose), which generates GraphQLTypes from REST response or any JSON. It takes fields from object, determines their types and construct GraphQLObjectType with same shape.
1110

flow-typed/npm/@babel/cli_vx.x.x.js

-87
This file was deleted.

0 commit comments

Comments
 (0)