Skip to content

Commit 9613805

Browse files
authored
Make TODOCS placeholder case-insensitive (#33205)
1 parent 62fe074 commit 9613805

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/linting/lint-files.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const languageCodes = Object.keys(languages)
4242
// This is a string that contributors can use in markdown and yaml files as a placeholder.
4343
// If any placeholders slip through, this test will flag them.
4444
const placeholder = 'TODOCS'
45-
const placeholderRegex = new RegExp(`\\b${placeholder}\\b`, 'g')
45+
const placeholderRegex = new RegExp(`\\b${placeholder}\\b`, 'gi')
4646

4747
// WARNING: Complicated RegExp below!
4848
//
@@ -480,8 +480,11 @@ describe('lint markdown content', () => {
480480

481481
test('placeholder string is not present in any markdown files', async () => {
482482
const matches = rawContent.match(placeholderRegex) || []
483+
const placeholderStr = matches.length === 1 ? 'placeholder' : 'placeholders'
483484
const errorMessage = `
484-
Found ${matches.length} placeholder string '${placeholder}' in this file! Please update all placeholders.
485+
Found ${matches.length} ${placeholderStr} '${matches.join(
486+
', '
487+
)}' in this file! Please update all placeholders.
485488
`
486489
expect(matches.length, errorMessage).toBe(0)
487490
})

0 commit comments

Comments
 (0)