diff --git a/CHANGELOG.md b/CHANGELOG.md index 747cd31145..65ddd16e27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ Our versioning strategy is as follows: * `[templates/nextjs]` Next config header plugin for CORS. ([#1597](https://github.com/Sitecore/jss/pull/1597)) * `[templates/nextjs]` Ensure dictionary data is only fetched when layout data is present for a route ([#1608](https://github.com/Sitecore/jss/pull/1608)) * `[sitecore-jss-react-forms]` Form should be blocked while submit is in progress to avoid submit spam ([#1611](https://github.com/Sitecore/jss/pull/1611)) +* `[templates/nextjs]` Fix linting errors, fix type error by upgrading @react/types to v18.2.22 ([#1613](https://github.com/Sitecore/jss/pull/1613)) ### 🛠 Breaking Changes diff --git a/packages/create-sitecore-jss/src/templates/nextjs/.eslintrc b/packages/create-sitecore-jss/src/templates/nextjs/.eslintrc index 2ed500119b..b49939ea40 100644 --- a/packages/create-sitecore-jss/src/templates/nextjs/.eslintrc +++ b/packages/create-sitecore-jss/src/templates/nextjs/.eslintrc @@ -11,7 +11,8 @@ "plugins": [ "@typescript-eslint", "prettier", - "yaml" + "yaml", + "react" ], "ignorePatterns": [".generated/**/*", "**/*.d.ts", "**/*.js"], "rules": { diff --git a/packages/create-sitecore-jss/src/templates/nextjs/package.json b/packages/create-sitecore-jss/src/templates/nextjs/package.json index 5e0212ba29..218672994f 100644 --- a/packages/create-sitecore-jss/src/templates/nextjs/package.json +++ b/packages/create-sitecore-jss/src/templates/nextjs/package.json @@ -63,6 +63,7 @@ "eslint-config-next": "^13.1.5", "eslint-config-prettier": "^8.6.0", "eslint-plugin-prettier": "^4.2.1", + "eslint-plugin-react": "^7.32.1", "eslint-plugin-yaml": "^0.5.0", "graphql-let": "^0.18.6", "npm-run-all": "~4.1.5", diff --git a/packages/create-sitecore-jss/src/templates/nextjs/tsconfig.json b/packages/create-sitecore-jss/src/templates/nextjs/tsconfig.json index 1fd97001e1..93f1a3e753 100644 --- a/packages/create-sitecore-jss/src/templates/nextjs/tsconfig.json +++ b/packages/create-sitecore-jss/src/templates/nextjs/tsconfig.json @@ -6,7 +6,8 @@ "lib/*": ["src/lib/*"], "temp/*": ["src/temp/*"], "assets/*": ["src/assets/*"], - "graphql-types": ["node_modules/@types/graphql-let/__generated__/__types__"] + "graphql-types": ["node_modules/@types/graphql-let/__generated__/__types__"], + "react": ["node_modules/@types/react"] }, "target": "es5", "lib": ["dom", "dom.iterable", "esnext"], diff --git a/packages/sitecore-jss-nextjs/package.json b/packages/sitecore-jss-nextjs/package.json index 6a6d627eaf..99c5781dc9 100644 --- a/packages/sitecore-jss-nextjs/package.json +++ b/packages/sitecore-jss-nextjs/package.json @@ -37,7 +37,7 @@ "@types/mocha": "^10.0.1", "@types/node": "~18.11.18", "@types/prop-types": "^15.7.5", - "@types/react": "^18.0.27", + "@types/react": "^18.2.22", "@types/react-dom": "^18.0.10", "@types/sinon": "^10.0.13", "@types/sinon-chai": "^3.2.9", diff --git a/packages/sitecore-jss-react/package.json b/packages/sitecore-jss-react/package.json index 05cbe82a11..8996d3f1a6 100644 --- a/packages/sitecore-jss-react/package.json +++ b/packages/sitecore-jss-react/package.json @@ -35,7 +35,7 @@ "@types/mocha": "^10.0.1", "@types/node": "18.11.10", "@types/prop-types": "^15.7.5", - "@types/react": "^18.0.27", + "@types/react": "^18.2.22", "@types/react-dom": "^18.0.10", "@types/sinon": "^10.0.13", "@types/sinon-chai": "^3.2.9", diff --git a/yarn.lock b/yarn.lock index e83e6a89ee..63b4c487df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6641,7 +6641,7 @@ __metadata: "@types/mocha": ^10.0.1 "@types/node": ~18.11.18 "@types/prop-types": ^15.7.5 - "@types/react": ^18.0.27 + "@types/react": ^18.2.22 "@types/react-dom": ^18.0.10 "@types/sinon": ^10.0.13 "@types/sinon-chai": ^3.2.9 @@ -6788,7 +6788,7 @@ __metadata: "@types/mocha": ^10.0.1 "@types/node": 18.11.10 "@types/prop-types": ^15.7.5 - "@types/react": ^18.0.27 + "@types/react": ^18.2.22 "@types/react-dom": ^18.0.10 "@types/sinon": ^10.0.13 "@types/sinon-chai": ^3.2.9 @@ -7843,14 +7843,14 @@ __metadata: languageName: node linkType: hard -"@types/react@npm:^18.0.27": - version: 18.0.27 - resolution: "@types/react@npm:18.0.27" +"@types/react@npm:^18.2.22": + version: 18.2.22 + resolution: "@types/react@npm:18.2.22" dependencies: "@types/prop-types": "*" "@types/scheduler": "*" csstype: ^3.0.2 - checksum: 600fdbc39a92ea4a77047db3e12f05f67776a710f5918248c0189a59ac2a38900c9db5a5d2e433a16df528a3ecab1aa114b322cacea573bb1ca2fc0b094c52d1 + checksum: 44289523dabaadcd3fd85689abb98f9ebcc8492d7e978348d1c986138acef4801030b279e89a19e38a6319e294bcea77559e37e0c803e4bacf2b8ae3a56ba587 languageName: node linkType: hard