Skip to content

Commit

Permalink
Fix broken data fetching links in docs (#33766)
Browse files Browse the repository at this point in the history
* Fix broken links for Data Fetching

* Fix link data fetching doc

* Improve link file paths

* Update errors/large-page-data.md

Co-authored-by: Steven <steven@ceriously.com>

* Update links

* Fix linting

* Lint tests

* Lint tests

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
  • Loading branch information
3 people committed Apr 22, 2022
1 parent 0e02f20 commit 60488e6
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 31 deletions.
36 changes: 18 additions & 18 deletions docs/basic-features/eslint.md
Expand Up @@ -80,24 +80,24 @@ This will take precedence over the configuration from `next.config.js`.

Next.js provides an ESLint plugin, [`eslint-plugin-next`](https://www.npmjs.com/package/@next/eslint-plugin-next), already bundled within the base configuration that makes it possible to catch common issues and problems in a Next.js application. The full set of rules is as follows:

| | Rule | Description |
| :-: | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| ✔️ | [next/google-font-display](https://nextjs.org/docs/messages/google-font-display) | Enforce optional or swap font-display behavior with Google Fonts |
| ✔️ | [next/google-font-preconnect](https://nextjs.org/docs/messages/google-font-preconnect) | Enforce preconnect usage with Google Fonts |
| ✔️ | [next/link-passhref](https://nextjs.org/docs/messages/link-passhref) | Enforce passHref prop usage with custom Link components |
| ✔️ | [next/no-css-tags](https://nextjs.org/docs/messages/no-css-tags) | Prevent manual stylesheet tags |
| ✔️ | [next/no-document-import-in-page](https://nextjs.org/docs/messages/no-document-import-in-page) | Disallow importing next/document outside of pages/document.js |
| ✔️ | [next/no-head-import-in-document](https://nextjs.org/docs/messages/no-head-import-in-document) | Disallow importing next/head in pages/document.js |
| ✔️ | [next/no-html-link-for-pages](https://nextjs.org/docs/messages/no-html-link-for-pages) | Prohibit HTML anchor links to pages without a Link component |
| ✔️ | [next/no-img-element](https://nextjs.org/docs/messages/no-img-element) | Prohibit usage of HTML &lt;img&gt; element |
| ✔️ | [next/no-head-element](https://nextjs.org/docs/messages/no-head-element) | Prohibit usage of HTML &lt;head&gt; element |
| ✔️ | [next/no-page-custom-font](https://nextjs.org/docs/messages/no-page-custom-font) | Prevent page-only custom fonts |
| ✔️ | [next/no-sync-scripts](https://nextjs.org/docs/messages/no-sync-scripts) | Forbid synchronous scripts |
| ✔️ | [next/no-title-in-document-head](https://nextjs.org/docs/messages/no-title-in-document-head) | Disallow using &lt;title&gt; with Head from next/document |
| ✔️ | [next/no-unwanted-polyfillio](https://nextjs.org/docs/messages/no-unwanted-polyfillio) | Prevent duplicate polyfills from Polyfill.io |
| ✔️ | [next/inline-script-id](https://nextjs.org/docs/messages/inline-script-id) | Enforce id attribute on next/script components with inline content |
| ✔️ | next/no-typos | Ensure no typos were made declaring [Next.js's data fetching function](https://nextjs.org/docs/basic-features/data-fetching) |
| ✔️ | [next/next-script-for-ga](https://nextjs.org/docs/messages/next-script-for-ga) | Use the Script component to defer loading of the script until necessary. |
| | Rule | Description |
| :-: | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| ✔️ | [next/google-font-display](/docs/messages/google-font-display.md) | Enforce optional or swap font-display behavior with Google Fonts |
| ✔️ | [next/google-font-preconnect](/docs/messages/google-font-preconnect.md) | Enforce preconnect usage with Google Fonts |
| ✔️ | [next/link-passhref](/docs/messages/link-passhref.md) | Enforce passHref prop usage with custom Link components |
| ✔️ | [next/no-css-tags](/docs/messages/no-css-tags.md) | Prevent manual stylesheet tags |
| ✔️ | [next/no-document-import-in-page](/docs/messages/no-document-import-in-page.md) | Disallow importing next/document outside of pages/document.js |
| ✔️ | [next/no-head-import-in-document](/docs/messages/no-head-import-in-document.md) | Disallow importing next/head in pages/document.js |
| ✔️ | [next/no-html-link-for-pages](/docs/messages/no-html-link-for-pages.md) | Prohibit HTML anchor links to pages without a Link component |
| ✔️ | [next/no-img-element](/docs/messages/no-img-element.md) | Prohibit usage of HTML &lt;img&gt; element |
| ✔️ | [next/no-head-element](/docs/messages/no-head-element.md) | Prohibit usage of HTML &lt;head&gt; element |
| ✔️ | [next/no-page-custom-font](/docs/messages/no-page-custom-font.md) | Prevent page-only custom fonts |
| ✔️ | [next/no-sync-scripts](/docs/messages/no-sync-scripts.md) | Forbid synchronous scripts |
| ✔️ | [next/no-title-in-document-head](/docs/messages/no-title-in-document-head.md) | Disallow using &lt;title&gt; with Head from next/document |
| ✔️ | [next/no-unwanted-polyfillio](/docs/messages/no-unwanted-polyfillio.md) | Prevent duplicate polyfills from Polyfill.io |
| ✔️ | [next/inline-script-id](/docs/messages/inline-script-id.md) | Enforce id attribute on next/script components with inline content |
| ✔️ | next/no-typos | Ensure no typos were made declaring [Next.js's data fetching function](/docs/basic-features/data-fetching/overview.md) |
| ✔️ | [next/next-script-for-ga](/docs/messages/next-script-for-ga.md) | Use the Script component to defer loading of the script until necessary. |

- ✔: Enabled in the recommended configuration

Expand Down
2 changes: 1 addition & 1 deletion errors/conflicting-ssg-paths.md
Expand Up @@ -65,4 +65,4 @@ export default function CatchAll() {

### Useful Links

- [`getStaticPaths` Documentation](https://nextjs.org/docs/api-reference/data-fetching/get-static-paths)
- [`getStaticPaths` Documentation](https://nextjs.org/docs/basic-features/data-fetching/get-static-paths)
2 changes: 1 addition & 1 deletion errors/gsp-redirect-during-prerender.md
Expand Up @@ -10,4 +10,4 @@ Remove any paths that result in a redirect from being prerendered in `getStaticP

### Useful Links

- [Data Fetching Documentation](/docs/basic-features/data-fetching/get-static-props.md)
- [Data Fetching Documentation](https://nextjs.org/docs/basic-features/data-fetching/get-static-props)
6 changes: 3 additions & 3 deletions errors/gssp-export.md
Expand Up @@ -33,6 +33,6 @@ The `getServerSideProps` lifecycle is not compatible with `next export`, so you'
### Useful Links

- [Automatic Static Optimization](/docs/advanced-features/automatic-static-optimization.md)
- [`getStaticProps` documentation](/docs/basic-features/data-fetching/get-static-props.md)
- [`exportPathMap` documentation](/docs/api-reference/next.config.js/exportPathMap.md)
- [Automatic Static Optimization](https://nextjs.org/docs/advanced-features/automatic-static-optimization)
- [`getStaticProps` documentation](https://nextjs.org/docs/basic-features/data-fetching/get-static-props)
- [`exportPathMap` documentation](https://nextjs.org/docs/api-reference/next.config.js/exportPathMap)
4 changes: 2 additions & 2 deletions errors/gssp-mixed-not-found-redirect.md
Expand Up @@ -12,5 +12,5 @@ Make sure only `notFound` **or** `redirect` is being returned on your page's `ge

### Useful Links

- [`getStaticProps` Documentation](/docs/basic-features/data-fetching/get-static-props.md)
- [`getServerSideProps` Documentation](/docs/basic-features/data-fetching/get-server-side-props.md)
- [`getStaticProps` Documentation](https://nextjs.org/docs/basic-features/data-fetching/get-static-props)
- [`getServerSideProps` Documentation](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props)
2 changes: 1 addition & 1 deletion errors/gssp-no-mutating-res.md
Expand Up @@ -16,4 +16,4 @@ If you’re using a custom server and running into this problem due to session m

### Useful Links

- [Data Fetching Docs](https://nextjs.org/docs/basic-features/data-fetching)
- [Data Fetching Docs](https://nextjs.org/docs/basic-features/data-fetching/index)
2 changes: 1 addition & 1 deletion errors/invalid-redirect-gssp.md
Expand Up @@ -29,4 +29,4 @@ export const getStaticProps = ({ params }) => {

### Useful Links

- [Data Fetching Documentation](/docs/basic-features/data-fetching/get-static-props.md)
- [Data Fetching Documentation](https://nextjs.org/docs/basic-features/data-fetching/get-static-props)
2 changes: 1 addition & 1 deletion errors/large-page-data.md
Expand Up @@ -10,4 +10,4 @@ Reduce the amount of data returned from `getStaticProps`, `getServerSideProps`,

### Useful Links

- [Data Fetching Documentation](https://nextjs.org/docs/basic-features/data-fetching)
- [Data Fetching Documentation](https://nextjs.org/docs/basic-features/data-fetching/overview)
3 changes: 2 additions & 1 deletion errors/page-data-collection-timeout.md
Expand Up @@ -15,4 +15,5 @@ When restarted it will retry all uncompleted jobs, but if a job was unsuccessful

### Useful Links

- [`getStaticPaths`](/docs/basic-features/data-fetching/get-static-paths.md)
- [`getStaticPaths`](https://nextjs.org/docs/basic-features/data-fetching/get-static-paths)
- [`getStaticProps`](https://nextjs.org/docs/basic-features/data-fetching/get-static-props)
2 changes: 1 addition & 1 deletion errors/prerender-error.md
Expand Up @@ -11,4 +11,4 @@ While prerendering a page an error occurred. This can occur for many reasons fro
- Set default values for all dynamic pages' props (avoid `undefined`, use `null` instead so it can be serialized)
- Check for any out of date modules that you might be relying on
- Make sure your component handles `fallback` if it is enabled in `getStaticPaths`. [Fallback docs](https://nextjs.org/docs/api-reference/data-fetching/get-static-paths#fallback-false)
- Make sure you are not trying to export (`next export`) pages that have server-side rendering enabled [(getServerSideProps)](/docs/basic-features/data-fetching/get-server-side-props.md)
- Make sure you are not trying to export (`next export`) pages that have server-side rendering enabled [(getServerSideProps)](https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props)
2 changes: 1 addition & 1 deletion errors/ssg-fallback-true-export.md
Expand Up @@ -11,4 +11,4 @@ If you would like the `fallback: true` behavior, `next export` should not be use
### Useful Links

- [deployment documentation](https://nextjs.org/docs/deployment#vercel-recommended)
- [`fallback: true` documentation](https://nextjs.org/docs/basic-features/data-fetching#fallback-true)
- [`fallback: true` documentation](https://nextjs.org/docs/api-reference/data-fetching/get-static-paths#fallback-true)

0 comments on commit 60488e6

Please sign in to comment.