aotaduy / eslint-plugin-spellcheck

MIT License
182 stars 17 forks source link

Ignore words containing special characters #61

Open politician opened 4 years ago

politician commented 4 years ago

Spellcheck should ignore all words containing special characters. Except when:

Examples:

Current false positives example

example.js

// Edit .eslintrc.json
let myVar = '**/tests/**/*.[jt]s'
myVar = '@rollup/plugin-alias'
myVar = 'babel-preset-minify'
myVar = '.tsx'
myVar = 'myfile.json'

spellcheck output

  1:1   warning  You have a misspelled word: eslintrc on Comment  spellcheck/spell-checker
  2:13  warning  You have a misspelled word: jt on String         spellcheck/spell-checker
  3:9   warning  You have a misspelled word: rollup on String     spellcheck/spell-checker
  4:9   warning  You have a misspelled word: minify on String     spellcheck/spell-checker
  5:9   warning  You have a misspelled word: tsx on String        spellcheck/spell-checker
  6:9   warning  You have a misspelled word: myfile on String     spellcheck/spell-checker
aotaduy commented 4 years ago

Hi !

right now we are spellchecking each word and using the special char as a separator. I belive this is a correct behaviour so we are able to check things like class selectors, I dont think is a good idea ti just ignore a word for a special character,

maybe we can treat this special words as skip words or with some other mechanism.

Thanks for the issue anyway i will try to figure out a solution for this one. We are adding some js words as rollup, tsx and others to our dictionary maybe that is a better solution so we can keep checking ids and other words embedded into ids separators and variable names (snake case, camel case, hyphen, etc) .