Skip to content

Commit

Permalink
Merge branch 'canary' into update-patternfly
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Sep 20, 2020
2 parents 5730773 + 571f8be commit 4735f8c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/api-reference/next.config.js/exportPathMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
```

Expand Down
2 changes: 2 additions & 0 deletions docs/basic-features/static-file-serving.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <http://err.sh/next.js/conflicting-public-file-page>
> **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.
3 changes: 1 addition & 2 deletions errors/invalid-href-passed.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 11 additions & 4 deletions packages/eslint-plugin-next/lib/rules/no-html-link-for-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
)
}

Expand Down

0 comments on commit 4735f8c

Please sign in to comment.