Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Type-check flow plugin #495

Merged
merged 2 commits into from Apr 27, 2017
Merged

Type-check flow plugin #495

merged 2 commits into from Apr 27, 2017

Conversation

ghost
Copy link

@ghost ghost commented Apr 26, 2017

Q A
Bug fix? no
Breaking change? no
New feature? no
Deprecations? no
Spec compliancy? no
Tests added/pass? Tests pass
Fixed tickets
License MIT

Enables type-checking in the file and adds type annotations.
This isn't a very strict check since the spec for the node types isn't done.

@codecov
Copy link

codecov bot commented Apr 26, 2017

Codecov Report

Merging #495 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #495      +/-   ##
==========================================
+ Coverage    98.2%   98.26%   +0.05%     
==========================================
  Files          21       21              
  Lines        3517     3516       -1     
  Branches      974      973       -1     
==========================================
+ Hits         3454     3455       +1     
+ Misses         24       22       -2     
  Partials       39       39
Flag Coverage Δ
#babel 80.94% <93.33%> (+0.05%) ⬆️
#babylon 97.09% <100%> (+0.05%) ⬆️
Impacted Files Coverage Δ
src/plugins/flow.js 98.37% <100%> (+0.22%) ⬆️
src/index.js 100% <0%> (ø) ⬆️
src/util/location.js 100% <0%> (ø) ⬆️
src/parser/lval.js 97.94% <0%> (ø) ⬆️
src/plugins/estree.js 99.16% <0%> (ø) ⬆️
src/util/whitespace.js 100% <0%> (ø) ⬆️
src/util/identifier.js 100% <0%> (ø) ⬆️
src/options.js 100% <0%> (ø) ⬆️
src/tokenizer/index.js 98.36% <0%> (ø) ⬆️

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 7627c5a...46b6cf2. Read the comment docs.

@@ -1018,8 +1035,8 @@ export default (superClass) => class extends superClass {
}
}

// declares, interfaces and type aliases
parseExpressionStatement(node, expr) {
// declares, interfaces and tNype aliases
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: typo

node.default = false;
delete node.exportKind;
}

// $FlowIgnore
node.type = "Declare" + node.type;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well stuff like this isn't fun

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type systems don't handle objects changing type very well. There are similar problems in the estree plugin.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's just not a good way to handle the types, dynamically adding the strings

@hzoo hzoo merged commit e81b5f8 into babel:master Apr 27, 2017
@ghost ghost deleted the flow branch April 27, 2017 16:50
@ghost ghost mentioned this pull request May 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants