-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Automatic file validation for components in src/pages #3045
Comments
I believe they can export a string too and still be valid. |
Hey if no one is assigned to this, can I take over? |
@ppatel221 sure go ahead! be sure to update this issue and/or reference it in your PR as you make progress |
thanks @ppatel221! |
@calcsam : If @ppatel221 isnt planning to do this, I would like to give it a shot |
@salmanmanekia yeah! Give it a shot. This would be super helpful for gatsby newbs. This bug created an issue for me in the beginning. Keep in mind that non-js files should be okay. (ie, data.json or styles.css that live within |
Thanks @benjaminhoffman. I will start with this. In the meanwhile can you please explain what do you meant by
Also, any hints on where to start looking to fix this problem. I am new to gatsby. |
My apologies, I may have been mistaken. The official error I get is So I guess you want to check for either a react element or @calcsam may know where to start looking to fix this. |
Add regex validation to make sure files in
src/pages
export React components. Throw error otherwise. Programmatically enforce language in the docs: #3011A cheap way of doing this is to make sure files contain at least two statements:
(1) an uppercase
React
(2)
export default
ormodule.exports
The text was updated successfully, but these errors were encountered: