cspell icon indicating copy to clipboard operation
cspell copied to clipboard

💡: Add grammar check exclusion options

Open CarlosEGuerraSilva opened this issue 1 year ago • 1 comments

Problem

I don't think this is a problem, but to better understand why I think this is important, I'll give an example.

In Spanish, accents or characters such as Ñ are used, although nowadays character encoding is not a problem, it is not a recommended practice to use Ñ or accents in class names, namespaces or variables. Occasionally some languages ​​or compilers may not accept these characters.

Currently the only options available are to add unaccented words to the dictionary, but this may not be appropriate since in places such as texts for the user it is important to show the accented word, but in case of forgetting the accent the unknown word warning will not be displayed.

Solution

It would be good to include an option to avoid checking the spelling of certain statements, or instead, that in certain statements a word that does not contain accents but is correctly spelled is considered valid, for example: "Restricción" > "Restriccion", "Transmisión" > "Transmision"

Alternatives

In addition to the correct spelling solution ignoring accents, you could also add it to the dictionary in a category like "Add to class name dictionary"

Additional Context

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

CarlosEGuerraSilva avatar Dec 06 '24 20:12 CarlosEGuerraSilva

@CarlosEGuerraSilva,

The spell checker supports ignoring case and accents at a file level.

The Spanish dictionary enables accent checking by default. To turn it off in code, you would need something like:

cspell.config.yaml

languageSettings:
  - locale: 'es,es-ES'
    languageId: javascript,typescript
    caseSensitive: false
overrides:
  - filename: '**/src/**'
    languageSettings:
      - caseSensitive: false
        languageId: '*'

This would turn off case sensitive (and accent) checking for all JavaScript and TypeScript files. The overrides would turn off case sensitive checking for all files inside of **/src.

Jason3S avatar Dec 07 '24 09:12 Jason3S