Skip to content

upgrade next and react #598

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .babelrc

This file was deleted.

7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,12 @@ module.exports = {
'react-hooks/exhaustive-deps': 0,

semi: ['error', 'never'],
// mac / windows end of line
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
},
}
1 change: 0 additions & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
Expand Down
23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
"homepage": "https://www.davidcsally.com",
"dependencies": {
"border-box.css": "^1.0.0",
"framer-motion": "^4.1.17",
"next": "^11.1.2",
"framer-motion": "^7.2.1",
"next": "^12.2.5",
"normalize.css": "^8.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-modal": "^3.14.3",
"styled-components": "^5.3.3"
"styled-components": "^5.3.5"
},
"devDependencies": {
"@next/eslint-plugin-next": "^11.1.2",
"@next/eslint-plugin-next": "^12.2.5",
"@storybook/addon-actions": "^6.3.12",
"@storybook/addon-links": "^6.3.12",
"@storybook/addons": "^6.3.12",
Expand All @@ -45,15 +45,14 @@
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.0.2",
"@types/react": "^17.0.30",
"@types/react-dom": "^17.0.10",
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@types/react-modal": "^3.13.1",
"@types/styled-components": "^5.1.15",
"@types/styled-components": "^5.1.26",
"@typescript-eslint/eslint-plugin": "^5.19.0",
"@typescript-eslint/parser": "^5.19.0",
"babel-plugin-styled-components": "^1.13.3",
"cypress": "^9.5.4",
"eslint": "^8.12.0",
"eslint": "^8.22.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-cypress": "^2.12.1",
Expand All @@ -65,6 +64,6 @@
"jest": "^27.3.1",
"prettier": "^2.4.1",
"start-server-and-test": "^1.14.0",
"typescript": "^4.3.5"
"typescript": "^4.7.0"
}
}
5 changes: 4 additions & 1 deletion pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ export default class MyDocument extends Document {
<body>
<Main />
<NextScript />
<style dangerouslySetInnerHTML={{ __html: fonts }} />
<style
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: fonts }}
/>
</body>
</Html>
)
Expand Down
4 changes: 3 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ const Home = () => (
/>
</Head>
<App />
<Script strategy="afterInteractive">{GA}</Script>
<Script id="ga-script" strategy="afterInteractive">
{GA}
</Script>
</>
)

Expand Down
5 changes: 3 additions & 2 deletions src/components/modules/App/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react'

import GlobalStyles from 'styles/global'
import { GlobalStyle } from 'styles/global'

import HeroBlock from '../HeroBlock'
import Chatbot from '../Chatbot'
Expand Down Expand Up @@ -49,7 +49,8 @@ const App = () => {

return (
<div data-testid="app">
<GlobalStyles />
{/* @ts-expect-error Idk something is wrong with the types */}
<GlobalStyle />
<main>
<HeroBlock />
<AboutMe />
Expand Down
2 changes: 1 addition & 1 deletion src/styles/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createGlobalStyle } from 'styled-components'

import { palette } from './colors'

export default createGlobalStyle`
export const GlobalStyle = createGlobalStyle`
${palette}

body {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"incremental": true
},
"include": [
"src"
Expand Down
Loading