File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -144,9 +144,10 @@ export class Dok06 extends BaseRuleset {
144144 then = [
145145 {
146146 function : ( targetVal : string , _opts : string , paths : string [ ] ) => {
147- const lowerCaseTargetVal = targetVal . toLowerCase ( ) ;
148- const containsEnglish = commonEnglishWords . some ( ( word ) => new RegExp ( `\\b${ word } \\b` ) . test ( lowerCaseTargetVal ) ) ;
149- const containsSwedish = commonSwedishWords . some ( ( word ) => new RegExp ( `\\b${ word } \\b` ) . test ( lowerCaseTargetVal ) ) ;
147+ const lowerCaseDescriptionList = targetVal . toLowerCase ( ) . match ( / [ a - z å ä ö ] + / gi) || [ ] ;
148+
149+ const containsEnglish = lowerCaseDescriptionList . some ( ( word ) => commonEnglishWords . includes ( word ) ) ;
150+ const containsSwedish = lowerCaseDescriptionList . some ( ( word ) => commonSwedishWords . includes ( word ) ) ;
150151
151152 if ( ! containsEnglish || ! containsSwedish ) {
152153 return [
You can’t perform that action at this time.
0 commit comments