Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to ignore color codes like #efefef (error looks like "You have a misspelled word: efefef on String") #92

Open
ivan-code-care opened this issue Feb 7, 2023 · 1 comment

Comments

@ivan-code-care
Copy link

No description provided.

@rafael-graunke
Copy link

rafael-graunke commented Jun 1, 2023

I think you can skip this by using regex in the "skipIfMatch" directive. Follow the ".eslintrc" example on README:

"plugins": [
   "spellcheck"
],
"rules": {
   "spellcheck/spell-checker": [1,
       {
           "comments": true,
           "strings": true,
           "identifiers": true,
           "templates": true,
           "lang": "en_US",
           "skipWords": [
               "dict",
               "aff",
               "hunspellchecker",
               "hunspell",
               "utils"
           ],
           "skipIfMatch": [
               "http://[^s]*",
               "^[-\\w]+\/[-\\w\\.]+$",
               "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$" //This regex will match hex color, upper or lowercase, 3 or 6 digits.
           ],
           "skipWordIfMatch": [
               "^foobar.*$"
           ],
           "minLength": 3
        }
    ]
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants