aotaduy / eslint-plugin-spellcheck

MIT License
183 stars 17 forks source link

How to ignore "IPv4" in comments #82

Closed c7hm4r closed 1 year ago

c7hm4r commented 2 years ago

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

erikbrinkman commented 2 years ago

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

c7hm4r commented 2 years ago

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 $.