Closed gajus closed 2 years ago
0.3 isn't a valid value for version. It looks like it's only in the en-gb dictionary if you run cspell trace reimagining
. It's likely because may be more commonly hyphenated as re-imagining
@gajus,
As Nick said, cspell trace reimagining
will show you which dictionaries have the word. Looks like it is only in the en-gb dictionary.
Please be careful with ignoreRegExpList
is applies to all the lines in a document. /.*[0-9].*/
will ignore any LINE that has a number.
See image: Dark gray is ignored.
You can use cspell check <filename>
to see how ignoreRegExp
impacts a file.
All very valuable insights. Shared summary with the team. Thank you
Please be careful with ignoreRegExpList is applies to all the lines in a document. /.[0-9]./ will ignore any LINE that has a number.
What is the best way to ignore gibberish keywords?
Example, in this code example:
export const CollaborationRequestProfessionalRolesLoader =
createConnectionLoaderClass<
PortfolioProjectCollaboratorProfessionalRole & ProfessionalRole
>({
query: sql.type(
ProfessionalRoleShape.merge(
PortfolioProjectCollaboratorProfessionalRoleShape
)
)`
WITH role_cte AS (${query})
SELECT
rc1.*,
ppcpr1.collaborator_id,
ppcpr1.sort_order
FROM role_cte rc1
INNER JOIN portfolio_project_collaborator_professional_role ppcpr1 ON
rc1.id = ppcpr1.professional_role_id
`,
});
without the ignoreRegExpList
, cspell flags ppcpr1
as a misspelled word.
Closing as the original question has been addressed.
without the ignoreRegExpList, cspell flags ppcpr1 as a misspelled word.
I suggest using regex101 to try it out first.
@Jason3S probably a separate problem, but regex does not seem to work all the time, e.g.
This is my configuration:
allowCompoundWords: true
dictionaries:
- en_us
- en-gb
- typescript
- companies
# contains various useful programming terms such as 'stringifiable'
- cpp
ignoreRegExpList:
# https://regex101.com/r/mqoody/1
- "\b[a-zA-Z0-9]*[0-9]+[a-zA-Z0-9]*\b"
- "'data-[a-z]*'"
language: en
minWordLength: 5
This is a test case:
https://regex101.com/r/mP6jYG/1
and it still highlights these words:
[..]/__tests__/ResourceDetails.test.tsx:22:27 - Unknown word (fezizlowdugqsvtss)
[..]/__tests__/ResourceDetails.test.tsx:27:27 - Unknown word (sholysbvuitn)
[..]/__tests__/ResourceDetails.test.tsx:46:20 - Unknown word (koyzugldpfbki)
[..]/__tests__/ResourceDetails.test.tsx:52:27 - Unknown word (bculqi)
There are two things going on:
\b
needs to be \\b
.This one is better: https://regex101.com/r/Xp1iuJ/1
Try this:
allowCompoundWords: false # Not a good idea to make this `true` it will hide a LOT of errors.
dictionaries:
- en_us
- en-gb
- typescript
- companies
# contains various useful programming terms such as 'stringifiable'
- cpp
ignoreRegExpList:
# https://regex101.com/r/mqoody/1
- "/\\b[a-z]*([0-9]+[a-z]*)+\\b/gi"
- "/'data-[a-z]+'/gi"
language: en
minWordLength: 5
It is being flagged using this configuration: