diff --git a/docs/api-reference/next.config.js/exportPathMap.md b/docs/api-reference/next.config.js/exportPathMap.md index 8ba5acdd108dd..e5bc850070f15 100644 --- a/docs/api-reference/next.config.js/exportPathMap.md +++ b/docs/api-reference/next.config.js/exportPathMap.md @@ -63,7 +63,7 @@ To switch back and add a trailing slash, open `next.config.js` and enable the `e ```js module.exports = { - exportTrailingSlash: true, + trailingSlash: true, } ``` diff --git a/docs/basic-features/static-file-serving.md b/docs/basic-features/static-file-serving.md index ffc0525641e82..25cac8b8aa9e8 100644 --- a/docs/basic-features/static-file-serving.md +++ b/docs/basic-features/static-file-serving.md @@ -23,3 +23,5 @@ This folder is also useful for `robots.txt`, Google Site Verification, and any o > **Note**: Be sure to not have a static file with the same name as a file in the `pages/` directory, as this will result in an error. > > Read more: + +> **Note**: Only assets that are in the `public` directory at [build time](/docs/api-reference/cli.md#build) will be served by Next.js. Files added at runtime won't be available. We recommend using a third party service like [AWS S3](https://aws.amazon.com/s3/) for persistent file storage. diff --git a/errors/invalid-href-passed.md b/errors/invalid-href-passed.md index 4f0c161bfcc5e..9d84c9da006d0 100644 --- a/errors/invalid-href-passed.md +++ b/errors/invalid-href-passed.md @@ -7,8 +7,7 @@ When using any of these, it is expected they are only used for internal navigati Either you passed a non-internal `href` to a `next/link` component or you called `Router#push` or `Router#replace` with one. -Invalid `href`s include external sites (https://google.com) and `mailto:` links. In the past, usage of these invalid `href`s could have gone unnoticed but since they can cause unexpected behavior. -We now show a warning in development for them. +Invalid `href`s include external sites (https://google.com) and `mailto:` links. In the past, usage of these invalid `href`s could have gone unnoticed, but since they can cause unexpected behavior we now show a warning in development for them. #### Possible Ways to Fix It diff --git a/packages/eslint-plugin-next/lib/rules/no-html-link-for-pages.js b/packages/eslint-plugin-next/lib/rules/no-html-link-for-pages.js index 75cf68c103de0..947850a6f5afe 100644 --- a/packages/eslint-plugin-next/lib/rules/no-html-link-for-pages.js +++ b/packages/eslint-plugin-next/lib/rules/no-html-link-for-pages.js @@ -17,11 +17,18 @@ module.exports = { }, create: function (context) { - const [pagesDirectory] = context.options - const pagesDir = pagesDirectory || path.join(context.getCwd(), 'pages') - if (!fs.existsSync(pagesDir)) { + const [customPagesDirectory] = context.options + const pagesDirs = customPagesDirectory + ? [customPagesDirectory] + : [ + path.join(context.getCwd(), 'pages'), + path.join(context.getCwd(), 'src', 'pages'), + ] + const pagesDir = pagesDirs.find((dir) => fs.existsSync(dir)) + if (!pagesDir) { throw new Error( - `Pages directory cannot be found at ${pagesDir}, if using a custom path, please configure with the no-html-link-for-pages rule` + `Pages directory cannot be found at ${pagesDirs.join(' or ')}. ` + + `If using a custom path, please configure with the no-html-link-for-pages rule` ) }