From c51cd2640c1a368ed054964bedc55139e8193875 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Mon, 31 Aug 2026 18:13:40 +0200 Subject: [PATCH 1/3] docs: document flagWords case-sensitivity behavior flagWords/forbidden-word matching is case-sensitive per entry: an all-lowercase entry flags any casing of the word, while an entry with any uppercase letter only flags that exact casing (plus the all-caps form). This wasn't documented anywhere, so it's easy to be surprised by it. Co-Authored-By: Claude Sonnet 5 --- cspell.schema.json | 28 +++++++++---------- .../src/generated/schema.cts | 8 +++--- packages/cspell-types/api/index.d.mts | 8 ++++++ packages/cspell-types/cspell.schema.json | 28 +++++++++---------- packages/cspell-types/src/InlineDictionary.ts | 10 ++++++- website/docs/forbidden-words.md | 12 ++++++++ 6 files changed, 61 insertions(+), 33 deletions(-) diff --git a/cspell.schema.json b/cspell.schema.json index 4ab46089d869..85eadb4be582 100644 --- a/cspell.schema.json +++ b/cspell.schema.json @@ -575,11 +575,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "ignoreWords": { @@ -633,11 +633,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "ignoreWords": { @@ -691,11 +691,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "ignoreWords": { @@ -749,11 +749,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "ignoreWords": { @@ -1231,11 +1231,11 @@ "type": "boolean" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "id": { @@ -1473,11 +1473,11 @@ "markdownDescription": "Glob pattern or patterns to match against." }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "id": { @@ -2131,11 +2131,11 @@ "type": "array" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "gitignoreRoot": { diff --git a/packages/cspell-eslint-plugin/src/generated/schema.cts b/packages/cspell-eslint-plugin/src/generated/schema.cts index 694ff7d88f6e..ec3acc3f8f70 100644 --- a/packages/cspell-eslint-plugin/src/generated/schema.cts +++ b/packages/cspell-eslint-plugin/src/generated/schema.cts @@ -152,11 +152,11 @@ export const optionsSchema: Rule.RuleMetaData['schema'] = { "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "ignoreWords": { @@ -210,11 +210,11 @@ export const optionsSchema: Rule.RuleMetaData['schema'] = { "type": "boolean" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "ignoreRegExpList": { diff --git a/packages/cspell-types/api/index.d.mts b/packages/cspell-types/api/index.d.mts index 48eced80ba48..ca28febcad3c 100644 --- a/packages/cspell-types/api/index.d.mts +++ b/packages/cspell-types/api/index.d.mts @@ -718,6 +718,14 @@ interface InlineDictionary { * "cancelled->canceled" * ] * ``` + * + * Case Sensitivity: + * + * Matching against `flagWords` is case-sensitive based on how each entry is written: + * - An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the + * document — `avocado`, `Avocado`, and `AVOCADO` are all flagged. + * - An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the + * all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants. */ flagWords?: string[]; /** diff --git a/packages/cspell-types/cspell.schema.json b/packages/cspell-types/cspell.schema.json index 4ab46089d869..85eadb4be582 100644 --- a/packages/cspell-types/cspell.schema.json +++ b/packages/cspell-types/cspell.schema.json @@ -575,11 +575,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "ignoreWords": { @@ -633,11 +633,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "ignoreWords": { @@ -691,11 +691,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "ignoreWords": { @@ -749,11 +749,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "ignoreWords": { @@ -1231,11 +1231,11 @@ "type": "boolean" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "id": { @@ -1473,11 +1473,11 @@ "markdownDescription": "Glob pattern or patterns to match against." }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "id": { @@ -2131,11 +2131,11 @@ "type": "array" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", "type": "array" }, "gitignoreRoot": { diff --git a/packages/cspell-types/src/InlineDictionary.ts b/packages/cspell-types/src/InlineDictionary.ts index 7f2b38e81fb7..f726412b8623 100644 --- a/packages/cspell-types/src/InlineDictionary.ts +++ b/packages/cspell-types/src/InlineDictionary.ts @@ -4,7 +4,7 @@ export interface InlineDictionary { */ words?: string[]; - // cspell:ignore colour color canot incase + // cspell:ignore colour color canot incase avocado Avocado /** * List of words to always be considered incorrect. Words found in `flagWords` override `words`. * @@ -21,6 +21,14 @@ export interface InlineDictionary { * "cancelled->canceled" * ] * ``` + * + * Case Sensitivity: + * + * Matching against `flagWords` is case-sensitive based on how each entry is written: + * - An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the + * document — `avocado`, `Avocado`, and `AVOCADO` are all flagged. + * - An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the + * all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants. */ flagWords?: string[]; diff --git a/website/docs/forbidden-words.md b/website/docs/forbidden-words.md index b5f6f3e1023c..587b678c251b 100644 --- a/website/docs/forbidden-words.md +++ b/website/docs/forbidden-words.md @@ -37,6 +37,18 @@ There are several ways to mark a word as forbidden: "flagWords": ["forbiddenWord"] ``` +## Case Sensitivity + +Matching against `flagWords` (and `!`-prefixed forbidden words) is case-sensitive based on how each word +is written: + +- A word written in **all lowercase** (e.g. `avocado`) is flagged in any casing found in the document — + `avocado`, `Avocado`, and `AVOCADO` are all flagged. +- A word containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the + all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants. + + + ## Overriding Forbidden words Sometimes it is necessary to allow a word even if it is forbidden. From e4d0a95c594abbc656a548e7f2f54e2c1126ae29 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Mon, 31 Aug 2026 19:21:36 +0200 Subject: [PATCH 2/3] Update FlagWordsDictionary.test.ts --- .../FlagWordsDictionary.test.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/cspell-dictionary/src/SpellingDictionary/FlagWordsDictionary.test.ts b/packages/cspell-dictionary/src/SpellingDictionary/FlagWordsDictionary.test.ts index faf8fcfeae32..f7f48ba6ab55 100644 --- a/packages/cspell-dictionary/src/SpellingDictionary/FlagWordsDictionary.test.ts +++ b/packages/cspell-dictionary/src/SpellingDictionary/FlagWordsDictionary.test.ts @@ -8,13 +8,20 @@ import { createTyposDictionary } from './TyposDictionary.js'; // const oc = (obj: T) => expect.objectContaining(obj); describe('ForbiddenWordsDictionary', () => { - const dictWords = [' english', '!English', 'grumpy', 'Avocado', 'avocadoS', '!avocado']; + const dictWords = [' english', '!English', 'grumpy', 'Avocado', 'avocadoS', '!avocado', 'Apple', 'orange']; const dict = createFlagWordsDictionary(dictWords, 'flag_words', 'test'); test('flag dictionary entries', () => { - expect(dict.isForbidden('english')).toBe(true); - expect(dict.isForbidden('English')).toBe(false); - expect(dict.isForbidden('grumpy')).toBe(true); + expect(dict.isForbidden('english'), 'english should be forbidden').toBe(true); + expect(dict.isForbidden('English'), 'English should not be forbidden').toBe(false); + expect(dict.isForbidden('grumpy'), 'grumpy should be forbidden').toBe(true); + expect(dict.isForbidden('Apple'), 'Apple should be forbidden').toBe(true); + expect(dict.isForbidden('APPLE'), 'APPLE should not be forbidden').toBe(false); + expect(dict.isForbidden('apple'), 'apple should not be forbidden').toBe(false); + expect(dict.isForbidden('orange'), 'orange should be forbidden').toBe(true); + expect(dict.isForbidden('Orange'), 'Orange should be forbidden').toBe(true); + expect(dict.isForbidden('ORANGE'), 'ORANGE should be forbidden').toBe(true); + expect(dict.isForbidden('OraNge'), 'OraNge should be forbidden').toBe(true); expect(dict.has('English')).toBe(false); }); From 32d834104704fdeceb12a617500b4c40fd7a8f18 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Mon, 31 Aug 2026 19:32:43 +0200 Subject: [PATCH 3/3] docs: correct flagWords case-sensitivity claim The earlier docs claimed a mixed-case entry (e.g. "Avocado") also flags the word's all-uppercase form ("AVOCADO"). The FlagWordsDictionary.test.ts tests added in the previous commit disprove this (Apple flags Apple but not APPLE or apple). Plain flagWords entries route through TyposDictionary, whose lookup only checks the word itself and its lowercased form against the entry list - never an uppercased form. So an entry only matches exactly as written, unless it's written in all lowercase, in which case any casing of the word matches. Co-Authored-By: Claude Sonnet 5 --- cspell.schema.json | 28 +++++++++---------- .../src/generated/schema.cts | 8 +++--- packages/cspell-types/api/index.d.mts | 7 +++-- packages/cspell-types/cspell.schema.json | 28 +++++++++---------- packages/cspell-types/src/InlineDictionary.ts | 7 +++-- website/docs/forbidden-words.md | 8 +++--- 6 files changed, 44 insertions(+), 42 deletions(-) diff --git a/cspell.schema.json b/cspell.schema.json index 85eadb4be582..9217afb992a7 100644 --- a/cspell.schema.json +++ b/cspell.schema.json @@ -575,11 +575,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "ignoreWords": { @@ -633,11 +633,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "ignoreWords": { @@ -691,11 +691,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "ignoreWords": { @@ -749,11 +749,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "ignoreWords": { @@ -1231,11 +1231,11 @@ "type": "boolean" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "id": { @@ -1473,11 +1473,11 @@ "markdownDescription": "Glob pattern or patterns to match against." }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "id": { @@ -2131,11 +2131,11 @@ "type": "array" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "gitignoreRoot": { diff --git a/packages/cspell-eslint-plugin/src/generated/schema.cts b/packages/cspell-eslint-plugin/src/generated/schema.cts index ec3acc3f8f70..74a66e88f2b8 100644 --- a/packages/cspell-eslint-plugin/src/generated/schema.cts +++ b/packages/cspell-eslint-plugin/src/generated/schema.cts @@ -152,11 +152,11 @@ export const optionsSchema: Rule.RuleMetaData['schema'] = { "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "ignoreWords": { @@ -210,11 +210,11 @@ export const optionsSchema: Rule.RuleMetaData['schema'] = { "type": "boolean" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "ignoreRegExpList": { diff --git a/packages/cspell-types/api/index.d.mts b/packages/cspell-types/api/index.d.mts index ca28febcad3c..e8d14bbf92b0 100644 --- a/packages/cspell-types/api/index.d.mts +++ b/packages/cspell-types/api/index.d.mts @@ -721,11 +721,12 @@ interface InlineDictionary { * * Case Sensitivity: * - * Matching against `flagWords` is case-sensitive based on how each entry is written: + * A word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. + * In practice this means: * - An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the * document — `avocado`, `Avocado`, and `AVOCADO` are all flagged. - * - An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the - * all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants. + * - An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — + * `avocado` and `AVOCADO` are not flagged. */ flagWords?: string[]; /** diff --git a/packages/cspell-types/cspell.schema.json b/packages/cspell-types/cspell.schema.json index 85eadb4be582..9217afb992a7 100644 --- a/packages/cspell-types/cspell.schema.json +++ b/packages/cspell-types/cspell.schema.json @@ -575,11 +575,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "ignoreWords": { @@ -633,11 +633,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "ignoreWords": { @@ -691,11 +691,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "ignoreWords": { @@ -749,11 +749,11 @@ "type": "string" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "ignoreWords": { @@ -1231,11 +1231,11 @@ "type": "boolean" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "id": { @@ -1473,11 +1473,11 @@ "markdownDescription": "Glob pattern or patterns to match against." }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "id": { @@ -2131,11 +2131,11 @@ "type": "array" }, "flagWords": { - "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "description": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample: ```ts \"flagWords\": [ \"color: colour\", \"incase: in case, encase\", \"canot->cannot\", \"cancelled->canceled\" ] ```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. In practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — `avocado` and `AVOCADO` are not flagged.", "items": { "type": "string" }, - "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nMatching against `flagWords` is case-sensitive based on how each entry is written:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the\n all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants.", + "markdownDescription": "List of words to always be considered incorrect. Words found in `flagWords` override `words`.\n\nFormat of `flagWords`\n- single word entry - `word`\n- with suggestions - `word:suggestion` or `word->suggestion, suggestions`\n\nExample:\n```ts\n\"flagWords\": [\n \"color: colour\",\n \"incase: in case, encase\",\n \"canot->cannot\",\n \"cancelled->canceled\"\n]\n```\n\nCase Sensitivity:\n\nA word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry.\nIn practice this means:\n- An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the\n document — `avocado`, `Avocado`, and `AVOCADO` are all flagged.\n- An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing —\n `avocado` and `AVOCADO` are not flagged.", "type": "array" }, "gitignoreRoot": { diff --git a/packages/cspell-types/src/InlineDictionary.ts b/packages/cspell-types/src/InlineDictionary.ts index f726412b8623..d2c7b5fdb8c4 100644 --- a/packages/cspell-types/src/InlineDictionary.ts +++ b/packages/cspell-types/src/InlineDictionary.ts @@ -24,11 +24,12 @@ export interface InlineDictionary { * * Case Sensitivity: * - * Matching against `flagWords` is case-sensitive based on how each entry is written: + * A word is flagged if it exactly matches an entry, or if its lowercased form exactly matches an entry. + * In practice this means: * - An entry written in **all lowercase** (e.g. `avocado`) flags that word in any casing found in the * document — `avocado`, `Avocado`, and `AVOCADO` are all flagged. - * - An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the - * all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants. + * - An entry containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — + * `avocado` and `AVOCADO` are not flagged. */ flagWords?: string[]; diff --git a/website/docs/forbidden-words.md b/website/docs/forbidden-words.md index 587b678c251b..703c7a9bf6f0 100644 --- a/website/docs/forbidden-words.md +++ b/website/docs/forbidden-words.md @@ -39,13 +39,13 @@ There are several ways to mark a word as forbidden: ## Case Sensitivity -Matching against `flagWords` (and `!`-prefixed forbidden words) is case-sensitive based on how each word -is written: +A document word is flagged if it exactly matches a `flagWords` (or `!`-prefixed forbidden word) entry, or if +its lowercased form exactly matches an entry. In practice this means: - A word written in **all lowercase** (e.g. `avocado`) is flagged in any casing found in the document — `avocado`, `Avocado`, and `AVOCADO` are all flagged. -- A word containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing, plus the - all-uppercase form of the word (`AVOCADO`) — it does not flag `avocado` or other mixed-case variants. +- A word containing **any uppercase letter** (e.g. `Avocado`) only flags that exact casing — + `avocado` and `AVOCADO` are not flagged.