diff --git a/packages/insomnia/package.json b/packages/insomnia/package.json index eb466c6edb..b1ed93a30e 100644 --- a/packages/insomnia/package.json +++ b/packages/insomnia/package.json @@ -34,7 +34,7 @@ "start:electron": "cross-env NODE_ENV=development esr esbuild.main.ts && electron .", "test": "jest", "test:watch": "jest --watch", - "type-check": "tsc --noEmit -p tsconfig.build.json", + "type-check": "tsc --noEmit --project tsconfig.build.json", "type-check:watch": "npm run type-check -- --watch" }, "dependencies": { diff --git a/packages/insomnia/src/common/render.ts b/packages/insomnia/src/common/render.ts index 2ec0d61be9..cce7f53cb8 100644 --- a/packages/insomnia/src/common/render.ts +++ b/packages/insomnia/src/common/render.ts @@ -504,12 +504,9 @@ export async function getRenderedRequestAndContext( return { context: renderContext, request: { - // Add the yummy cookies cookieJar: renderedCookieJar, cookies: [], isPrivate: false, - // NOTE: Flow doesn't like Object.assign, so we have to do each property manually - // for now to convert Request to RenderedRequest. _id: renderedRequest._id, authentication: renderedRequest.authentication, body: renderedRequest.body, diff --git a/packages/insomnia/src/sync/git/git-vcs.ts b/packages/insomnia/src/sync/git/git-vcs.ts index 2bf027b9b8..e56f563cfa 100644 --- a/packages/insomnia/src/sync/git/git-vcs.ts +++ b/packages/insomnia/src/sync/git/git-vcs.ts @@ -200,7 +200,6 @@ export class GitVCS { const config = await this.getRemote('origin'); if (config === null) { - // Should never happen but it's here to make Flow happy throw new Error('Remote not found remote=origin'); } diff --git a/packages/insomnia/src/ui/components/graph-ql-explorer/graph-ql-default-value.tsx b/packages/insomnia/src/ui/components/graph-ql-explorer/graph-ql-default-value.tsx index 6a7d9dae2c..a231806f8c 100644 --- a/packages/insomnia/src/ui/components/graph-ql-explorer/graph-ql-default-value.tsx +++ b/packages/insomnia/src/ui/components/graph-ql-explorer/graph-ql-default-value.tsx @@ -8,7 +8,6 @@ interface Props { } export const GraphQLDefaultValue: FC = memo(({ field }) => { - // Make Flow happy :/ const fieldO: Record = field; if ('defaultValue' in fieldO && fieldO.defaultValue !== undefined) { diff --git a/scripts/convert-to-typescript b/scripts/convert-to-typescript deleted file mode 100755 index e516708232..0000000000 --- a/scripts/convert-to-typescript +++ /dev/null @@ -1,64 +0,0 @@ -#! /bin/bash -export INSOMNIA_ROOT="$HOME/src/github.com/Kong/insomnia" -export CODE_LOCATION="$INSOMNIA_ROOT/packages/insomnia/src" - -echo " -**/bin/* -**/build/* -**/dist/* -**/__fixtures__/* -**/flow-typed/* -*.md -**/__snapshots__/ -**/*.less -**/*.css -" > "$INSOMNIA_ROOT/.prettierignore" - -echo ' -{ - "bracketSpacing": true, - "jsxBracketSameLine": true, - "semi": true, - "singleQuote": true, - "tabWidth": 2, - "arrowParens": "avoid", - "trailingComma": "all", - "printWidth": 100 -} -' > "$INSOMNIA_ROOT/.prettierrc" - -cd "$INSOMNIA_ROOT" || return - -npm install --save-dev typescript@4.2.3 - -# run flow-to-ts, which messes up formatting -npx @khanacademy/flow-to-ts@0.5.1 \ - --prettier=off \ # flow-to-ts uses pretter 2.2 and our codebase has been using prettier 1.5 \ - --write \ - --delete-source "$CODE_LOCATION/*.js" \ - "$CODE_LOCATION/**/**/**/**/**/**/*.js" - -# run prettier -npx prettier@2.2.1 \ - --config="$INSOMNIA_ROOT/.prettierrc" \ - --ignore-path="$INSOMNIA_ROOT/.prettierignore" \ - --write \ - "$CODE_LOCATION/**" -rm .prettierignore -rm .prettierrc - -# then run eslint to try and fix some of the things in the previous step. -npm install --save-dev eslint-plugin-jest-formatting -export ESLINTRC="$INSOMNIA_ROOT/.eslintrc.js" -export ESLINT="$INSOMNIA_ROOT/node_modules/.bin/eslint \ - --ext .ts,.tsx,.js \ - --fix \ - --plugin filenames - --plugin jest-formatting - --no-eslintrc \ - --parser=@typescript-eslint/parser \ - $CODE_LOCATION" - -$ESLINT --rule 'space-before-function-paren: ["error", { "anonymous": "never", "named": "never", "asyncArrow": "always" }]' - -$ESLINT --rule 'jest-formatting/padding-around-test-blocks: "error"'