From 5c6c3851006a2fd43a8ec9518c1be7f723bbf2e3 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Wed, 26 Jan 2022 13:41:14 +0100 Subject: [PATCH] Use relative path for example (#33565) The paths starting with slashes in the ESLint config examples are absolute, which are almost never the correct configuration for a project. Using a relative path is a much more common configuration, and leads to much less debugging why these examples don't work. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint` --- docs/basic-features/eslint.md | 4 ++-- errors/no-html-link-for-pages.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/basic-features/eslint.md b/docs/basic-features/eslint.md index 1ce00e9cdaf00..fd342db4c80f2 100644 --- a/docs/basic-features/eslint.md +++ b/docs/basic-features/eslint.md @@ -114,13 +114,13 @@ If you're using `eslint-plugin-next` in a project where Next.js isn't installed "extends": "next", "settings": { "next": { - "rootDir": "/packages/my-app/" + "rootDir": "packages/my-app/" } } } ``` -`rootDir` can be a path (relative or absolute), a glob (i.e. `"/packages/*/"`), or an array of paths and/or globs. +`rootDir` can be a path (relative or absolute), a glob (i.e. `"packages/*/"`), or an array of paths and/or globs. ## Linting Custom Directories and Files diff --git a/errors/no-html-link-for-pages.md b/errors/no-html-link-for-pages.md index 0fe1449d69a9a..38457ae4a46ab 100644 --- a/errors/no-html-link-for-pages.md +++ b/errors/no-html-link-for-pages.md @@ -53,7 +53,7 @@ In some cases, you may also need to configure this rule directly by providing a ```json { "rules": { - "@next/next/no-html-link-for-pages": ["error", "/my-app/pages/"] + "@next/next/no-html-link-for-pages": ["error", "packages/my-app/pages/"] } } ```