eslint-plugin-spellcheck icon indicating copy to clipboard operation
eslint-plugin-spellcheck copied to clipboard

How to ignore "IPv4" in comments

Open c7hm4r opened this issue 2 years ago • 2 comments

This code:

// IPv4

… produces this warning:

You have a misspelled word: Pv4 on Comment

… even with following config:

      {
        skipWords: [/*…*/],
        minLength: 3,
        skipIfMatch: ["^IPv[46]$"],
      }

What am I understanding wrong here and how to accept "IPv6" / "IPv4"?

Thanks in advance

c7hm4r avatar Jun 06 '22 13:06 c7hm4r

There's a note in the readme for skipping words that end in a number. Short answer is skipWords: ["IPv"].

erikbrinkman avatar Jun 06 '22 16:06 erikbrinkman

Thanks, but that does not work. What works is skipWords: ["pv"]. skipWords: ["ipv"] does also not work.

I wonder why "pv" is even spell-checked because minLength: 3.

Another solution which seems to work is to remove the anchors from the regex, i.e.: skipIfMatch: "IPv[46]". That behavior seems hard to understand because the example in the README also uses the regex anchors ^ and $.

c7hm4r avatar Jun 06 '22 17:06 c7hm4r