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

Road map and plans for Flowtype support? #12

Closed
stereobooster opened this issue Oct 2, 2016 · 5 comments
Closed

Road map and plans for Flowtype support? #12

stereobooster opened this issue Oct 2, 2016 · 5 comments

Comments

@stereobooster
Copy link

Hi. This is a great project. Thanks for creating it.

Do you have roadmap? And do you have plans to add FlowType support?

Want to replace propTypes with Flow.

Also looking for something similar to typed-css-modules for Flow and CSSModules.

@kitze
Copy link
Owner

kitze commented Oct 3, 2016

Flow already works.

I've never used typed-css-modules but from what i read in the readme, it's not integrated with webpack or babel in any way, right? So it should work too.

@kitze
Copy link
Owner

kitze commented Oct 3, 2016

Here's a sample .flowconfig file:

[ignore]
.*/node_modules/fbjs/.*
.*/node_modules/react-event-listener/.*

[options]
module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=src
module.name_mapper.extension='scss' -> '<PROJECT_ROOT>/file-stub.js'
module.name_mapper.extension='css' -> '<PROJECT_ROOT>/file-stub.js'
module.name_mapper.extension='less' -> '<PROJECT_ROOT>/file-stub.js'
module.name_mapper.extension='png' -> '<PROJECT_ROOT>/file-stub.js'
module.name_mapper.extension='jpg' -> '<PROJECT_ROOT>/file-stub.js'

It will work with absolute imports and it will ignore scss, less, css, png, jpg files.

You also need to have a file-stub.js file in the root of the project. The content of that file is:declare export default void;

Please let me know if this works for you.

@kitze
Copy link
Owner

kitze commented Oct 3, 2016

Final config is here. It supports every feature that `custom-react-scripts`` supports. I will add it to the readme later.

@kitze kitze closed this as completed Oct 3, 2016
@stereobooster
Copy link
Author

Just an idea add generate_flow_config command which wlil add this config to repo (like eject).

@kitze
Copy link
Owner

kitze commented Oct 6, 2016

@stereobooster yeah I thought about it too but every line of that .flowconfig 👆 depends if a feature is turned on/off in .env. So if decorator support is toggled in .env, I should check if esproposal.decorators=ignore is in .flowconfig etc. etc.

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

No branches or pull requests

2 participants