Closed jc3lee closed 5 months ago
Name | Link |
---|---|
Latest commit | a251db2fc184c0b3ba81eb96e8a516c98059185f |
Latest deploy log | https://app.netlify.com/sites/goodeworkers/deploys/660e727012b3dc0008bab7c1 |
Deploy Preview | https://deploy-preview-25--goodeworkers.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Fixed the deploy preview issue: because of the cache from gatsby-adapter-netlify, even running gatsby clean
doesn't clean netlify's cache. Instead I had to revert gatsby-config.ts
back to gatsby-config.js
Summary of changes:
typescript, @types/node, @types/react, @types/react-dom
tsconfig.json
following the gatsby minimal ts examplegatsby-browser.js
&gatsby-config.js
togatsby-browser.ts
&gatsby-config.ts
globals.d.ts
. It's a declaration of types file to handle imports (svg, images, etc) following the create react app exampleAnd with that, typescript has been successfully integrated π.
That took 10% of the time, the remaining 90% was on figuring out how to add eslint typescript. The hardest part was making eslint work on react js, jsx files while using typescript linting only on ts and tsx files. It's my first time setting eslint if you've found issues or have suggestions, I'm all ears π. I've annoted the changes but please tell me if you have any questions. Here are the edits I did on eslintrc:
"plugin:@typescript-eslint/recommended"
to"extends"
"parser": "@typescript-eslint/parser"
"@typescript-eslint"
to"plugins"
"react/prop-types": "off"
and"react/require-default-props": "off",
since we can handle type check with ts"plugin:import/errors", "plugin:import/warnings"
to"extends"
"import/resolver"
to"settings"
"import/extensions"
to"rules"
"react/jsx-filename-extension"
to"rules"
And with that, we've got linting on both javascript and typescript files!