Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flowtype errors in babel-plugin-emotion #293

Merged
merged 2 commits into from Sep 5, 2017
Merged

Fix flowtype errors in babel-plugin-emotion #293

merged 2 commits into from Sep 5, 2017

Conversation

bigslycat
Copy link
Contributor

What:

I received this errors using Flow version 0.54.0:

Error: packages/babel-plugin-emotion/src/index.js:121
121:         moduleName = JSON.parse(packageJsonContent).name
                                     ^^^^^^^^^^^^^^^^^^ Buffer. This type is incompatible with the expected param type of
485:     static parse(text: string, reviver?: (key: any, value: any) => any): any;
                            ^^^^^^ string. See lib: /tmp/flow/flowlib_2d62ca57/core.js:485

Error: packages/babel-plugin-emotion/src/parser.js:97
 97: export function parse(css, opts) {
                           ^^^ parameter `css`. Missing annotation

Error: packages/babel-plugin-emotion/src/parser.js:97
 97: export function parse(css, opts) {
                                ^^^^ parameter `opts`. Missing annotation

Why:

If we use Flow, we must not ignore this error reports.

How:

The type of the variable is explicitly converted to string. Function parse in parser.js is annotated.

Checklist:

  • Documentation
  • Tests
  • Code complete

@codecov-io
Copy link

codecov-io commented Sep 5, 2017

Codecov Report

Merging #293 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #293   +/-   ##
=======================================
  Coverage   90.37%   90.37%           
=======================================
  Files          21       21           
  Lines         966      966           
  Branches      260      260           
=======================================
  Hits          873      873           
  Misses         75       75           
  Partials       18       18
Impacted Files Coverage Δ
packages/babel-plugin-emotion/src/parser.js 95.12% <ø> (ø) ⬆️
packages/babel-plugin-emotion/src/index.js 97.74% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aba1262...a50fc60. Read the comment docs.

@tkh44 tkh44 merged commit e3ea045 into emotion-js:master Sep 5, 2017
@tkh44
Copy link
Member

tkh44 commented Sep 5, 2017

Released in 7.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants