Skip to content

Commit

Permalink
refactor: migrate from Flow to TypeScript
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Flowtype definitions were removed
  • Loading branch information
nodkz authored Mar 9, 2020
1 parent 698b14b commit f19e08e
Show file tree
Hide file tree
Showing 56 changed files with 1,722 additions and 10,866 deletions.
46 changes: 0 additions & 46 deletions .babelrc

This file was deleted.

52 changes: 0 additions & 52 deletions .eslintrc

This file was deleted.

49 changes: 49 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
const path = require('path');

module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'prettier'],
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
parserOptions: {
sourceType: 'module',
useJSXTextNode: true,
project: [path.resolve(__dirname, 'tsconfig.json')],
},
rules: {
'no-underscore-dangle': 0,
'arrow-body-style': 0,
'no-unused-expressions': 0,
'no-plusplus': 0,
'no-console': 0,
'func-names': 0,
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'ignore',
},
],
'no-prototype-builtins': 0,
'prefer-destructuring': 0,
'no-else-return': 0,
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/camelcase': 0,
},
env: {
jasmine: true,
jest: true,
},
};
46 changes: 0 additions & 46 deletions .flowconfig

This file was deleted.

3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"singleQuote": true,
"arrowParens": "always",
"tabWidth": 2,
"useTabs": false,
"printWidth": 100,
"trailingComma": "es5"
}
}
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ notifications:
node_js:
- "10"
- "12"
before_install: yarn global add greenkeeper-lockfile@1
before_script: greenkeeper-lockfile-update
after_script: greenkeeper-lockfile-upload
script:
- yarn run test
- yarn run build
Expand Down
19 changes: 8 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,26 @@
"version": "0.2.0",
"configurations": [
{
"name": "Jest",
"name": "Jest Current File",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["--runInBand", "--watch"],
"cwd": "${workspaceFolder}",
"args": ["${fileBasenameNoExtension}", "--config", "jest.config.js"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true
"runtimeArgs": ["--nolazy"], // tells v8 to compile your code ahead of time, so that breakpoints work correctly
"disableOptimisticBPs": true // also helps that breakpoints work correctly
},
{
"name": "Jest Current File",
"name": "Jest",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"${fileBasenameNoExtension}",
"--config",
"jest.config.js"
],
"args": ["--runInBand", "--watch"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true
}
]
}
}
13 changes: 9 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"eslint.validate": ["javascript"],
"javascript.validate.enable": false,
"javascript.autoClosingTags": false,
"eslint.autoFixOnSave": true,
"eslint.validate": [
{ "language": "javascript", "autoFix": true },
{ "language": "javascriptreact", "autoFix": true },
{ "language": "typescript", "autoFix": true },
{ "language": "typescriptreact", "autoFix": true }
],
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"eslint.autoFixOnSave": true,
}
25 changes: 25 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Eslint checks",
"type": "shell",
"command": "./node_modules/.bin/eslint 'packages/*/src/**/*.{js,ts,tsx}'",
"problemMatcher": ["$eslint-stylish"],
"isBackground": true,
"presentation": {
"reveal": "never"
},
"runOptions": {
"reevaluateOnRerun": true,
"runOn": "folderOpen"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[![npm](https://img.shields.io/npm/v/graphql-compose-json.svg)](https://www.npmjs.com/package/graphql-compose-json)
[![trends](https://img.shields.io/npm/dt/graphql-compose-json.svg)](http://www.npmtrends.com/graphql-compose-json)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Greenkeeper badge](https://badges.greenkeeper.io/graphql-compose/graphql-compose-json.svg)](https://greenkeeper.io/)

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.

Expand Down
87 changes: 0 additions & 87 deletions flow-typed/npm/@babel/cli_vx.x.x.js

This file was deleted.

Loading

0 comments on commit f19e08e

Please sign in to comment.