mirror of
https://github.com/Kong/insomnia.git
synced 2026-05-07 14:33:20 -04:00
removes delinquent flowtype leftovers (#4792)
This commit is contained in:
committed by
GitHub
parent
52393eccc0
commit
fa02c76afa
@@ -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": {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ interface Props {
|
||||
}
|
||||
|
||||
export const GraphQLDefaultValue: FC<Props> = memo(({ field }) => {
|
||||
// Make Flow happy :/
|
||||
const fieldO: Record<string, any> = field;
|
||||
|
||||
if ('defaultValue' in fieldO && fieldO.defaultValue !== undefined) {
|
||||
|
||||
@@ -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"'
|
||||
Reference in New Issue
Block a user