Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

💡: Add grammar check exclusion options #6643

Open
1 task done
CarlosEGuerraSilva opened this issue Dec 6, 2024 · 1 comment
Open
1 task done

💡: Add grammar check exclusion options #6643

CarlosEGuerraSilva opened this issue Dec 6, 2024 · 1 comment

Comments

@CarlosEGuerraSilva
Copy link

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

  • I agree to follow this project's Code of Conduct
@Jason3S
Copy link
Collaborator

Jason3S commented Dec 7, 2024

@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 Jason3S removed the new issue label Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants