From f6e9a1dca2317bb303ae27cb00b46da1c1822fa4 Mon Sep 17 00:00:00 2001 From: Gaurav Nelson <23069445+gaurav-nelson@users.noreply.github.com> Date: Mon, 24 Jun 2024 09:31:48 +1000 Subject: [PATCH] Added configuration values table --- README.md | 15 +++++++++++++++ index.test.js | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fe2200d..8fc1657 100644 --- a/README.md +++ b/README.md @@ -83,8 +83,23 @@ dirs: useGitIgnore: true ``` +If you are defining a custom configuration, you must include the `dirs` or `files` section in the configuration file. + Following are the available configuration options: +| Option| Description| Required | +|---|---|---| +| [`files`](#files-to-check) | The list of Markdown files to check for broken links. | Yes, if `dirs` is not specified. | +| [`dirs`](#directories-to-search) | The list of directories to search for Markdown files. | Yes, if `files` is not specified. | +| [`excludedFiles`](#excluded-files) | The list of Markdown files to exclude from the link checking process. | No | +| [`excludedDirs`](#excluded-directories) | The list of directories to exclude from the link checking process. | No | +| [`baseUrl`](#base-url) | The base URL to use when checking relative links in Markdown files. | No | +| [`ignorePatterns`](#ignore-patterns) | The list of regular expressions that match URLs to be ignored during link checking. | No | +| [`replacementPatterns`](#replacement-patterns) | The list of regular expressions and replacement strings to modify URLs during link checking. | No | +| [`aliveStatusCodes`](#alive-status-codes) | The list of HTTP status codes that are considered as "alive" links. | No | +| [`useGitIgnore`](#use-gitignore) | Indicates whether to use the rules defined in the `.gitignore` file to exclude files and directories. | No | +| [`modifiedFilesOnly`](#check-modified-files-only) | Indicates whether to check only the files that have been modified in the last git commit. | No | + ### Files to Check The `files` section specifies the Markdown files that Linkspector should check for broken links. You can add the file paths you want to include in this list. For example: diff --git a/index.test.js b/index.test.js index 55e273a..1b5de6d 100644 --- a/index.test.js +++ b/index.test.js @@ -110,7 +110,7 @@ test('linkspector should check top-level relative links in Markdown file', async } expect(hasErrorLinks).toBe(false) - expect(results.length).toBe(7) + expect(results.length).toBe(17) }) test('linkspector should add back the removed duplicates when returning the results', async () => {