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

typescript #12

Closed
bradfordcondon opened this issue Jul 26, 2020 · 2 comments
Closed

typescript #12

bradfordcondon opened this issue Jul 26, 2020 · 2 comments
Assignees

Comments

@bradfordcondon
Copy link
Owner

bradfordcondon commented Jul 26, 2020

notes converting to typescript.

"compilerOptions": {
  "target": "es5",
  "module": "commonjs",

This leaves us with two errors

src/templates/blog-post.tsx:3:20 - error TS7016: Could not find a declaration file for module '../components/layout'. '/Users/bc/html/gatsby/bc/src/components/layout.js' implicitly has an 'any' type.

3 import Layout from '../components/layout'
                     ~~~~~~~~~~~~~~~~~~~~~~

src/templates/blog-post.tsx:5:19 - error TS7031: Binding element 'data' implicitly has an 'any' type.

5 export default ({ data }) => {
                    ~~~~



https://www.typescriptlang.org/docs/handbook/module-resolution.html

@bradfordcondon bradfordcondon self-assigned this Jul 26, 2020
@bradfordcondon
Copy link
Owner Author

Can add "noImplicitAny": false to our typescript config
Can explicitly declare data as any:
export default ({ data } :{data: any}) => {

export default ({ data }) => {

@bradfordcondon
Copy link
Owner Author

bradfordcondon commented Jul 27, 2020

after upgrading react/gatsby:

  119:18  error    Unknown argument "formatString" on field "date" of type "MarkdownRemarkFrontmatter"  graphql/template-strings

turns out the markdown header reader became pickier about the dates. 2017-7-8 now needs to be 2017-07-08

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