Skip to content

Commit

Permalink
Add flow to package.
Browse files Browse the repository at this point in the history
There is a purposely malformed `package.json` file in one of the
dependencies (for testing purposes). See issue:
facebook/flow#2364.
  • Loading branch information
StevenXL committed Apr 8, 2022
1 parent 3047a80 commit 3fa4152
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[ignore]
.*/node_modules/resolve/test/resolver/malformed_package_json/package.json


[include]

[libs]

[lints]

[options]

[strict]
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"babel": {
"presets": [
"@babel/preset-env"
"@babel/preset-env",
"@babel/preset-flow"
]
},
"repository": "[email protected]:freckle/react-hooks.git",
Expand All @@ -22,6 +23,8 @@
"@babel/cli": "^7.17.6",
"@babel/core": "^7.17.9",
"@babel/preset-env": "^7.16.11",
"@babel/preset-flow": "^7.16.7",
"flow-bin": "^0.175.1",
"jest": "^27.5.1",
"watch": "^1.0.2"
}
Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const helloWord = () => "Hello, World!";
// @flow

const helloWord = (): string => "Hello, World!";

export { helloWord };
29 changes: 29 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,13 @@
dependencies:
"@babel/helper-plugin-utils" "^7.8.3"

"@babel/plugin-syntax-flow@^7.16.7":
version "7.16.7"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.16.7.tgz#202b147e5892b8452bbb0bb269c7ed2539ab8832"
integrity sha512-UDo3YGQO0jH6ytzVwgSLv9i/CzMcUjbKenL67dTrAZPPv6GFAtDhe6jqnvmoKzC/7htNTohhos+onPtDMqJwaQ==
dependencies:
"@babel/helper-plugin-utils" "^7.16.7"

"@babel/plugin-syntax-import-meta@^7.8.3":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51"
Expand Down Expand Up @@ -625,6 +632,14 @@
"@babel/helper-builder-binary-assignment-operator-visitor" "^7.16.7"
"@babel/helper-plugin-utils" "^7.16.7"

"@babel/plugin-transform-flow-strip-types@^7.16.7":
version "7.16.7"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.16.7.tgz#291fb140c78dabbf87f2427e7c7c332b126964b8"
integrity sha512-mzmCq3cNsDpZZu9FADYYyfZJIOrSONmHcop2XEKPdBNMa4PDC4eEvcOvzZaCNcjKu72v0XQlA5y1g58aLRXdYg==
dependencies:
"@babel/helper-plugin-utils" "^7.16.7"
"@babel/plugin-syntax-flow" "^7.16.7"

"@babel/plugin-transform-for-of@^7.16.7":
version "7.16.7"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz#649d639d4617dff502a9a158c479b3b556728d8c"
Expand Down Expand Up @@ -874,6 +889,15 @@
core-js-compat "^3.20.2"
semver "^6.3.0"

"@babel/preset-flow@^7.16.7":
version "7.16.7"
resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.16.7.tgz#7fd831323ab25eeba6e4b77a589f680e30581cbd"
integrity sha512-6ceP7IyZdUYQ3wUVqyRSQXztd1YmFHWI4Xv11MIqAlE4WqxBSd/FZ61V9k+TS5Gd4mkHOtQtPp9ymRpxH4y1Ug==
dependencies:
"@babel/helper-plugin-utils" "^7.16.7"
"@babel/helper-validator-option" "^7.16.7"
"@babel/plugin-transform-flow-strip-types" "^7.16.7"

"@babel/preset-modules@^0.1.5":
version "0.1.5"
resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9"
Expand Down Expand Up @@ -1848,6 +1872,11 @@ find-up@^4.0.0, find-up@^4.1.0:
locate-path "^5.0.0"
path-exists "^4.0.0"

flow-bin@^0.175.1:
version "0.175.1"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.175.1.tgz#72237070ba4f293f9e04113481e18929c1de50df"
integrity sha512-zMCP0BPa9BrfBSR7QTcyT/XBwzUbyLdNG0eXvBuNxfHCbMRkUzSceRoOaEZIw+R+GH0UHjVfUvPJ30hXxz1Nfw==

form-data@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f"
Expand Down

0 comments on commit 3fa4152

Please sign in to comment.