Skip to content

Commit

Permalink
generate the capitalized versions
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Nov 7, 2024
1 parent e4d8c77 commit 1a87081
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
10 changes: 9 additions & 1 deletion wordLists/writeGoodComments.whitelist.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable @cspell/spellchecker */
function capitalize(lowercaseString) {
return lowercaseString.charAt(0).toUpperCase() + lowercaseString.slice(1);
}
const whitelistLowercase = ['only', 'validate'];
/**
* Words that will not be flagged by write-good-comments.
*/
export const whitelist = ['only', 'validate', 'Validate'];
export const whitelist = [...whitelistLowercase];
// List is case-sensitive, include words starting with capitals.
for (const word of whitelist) {
whitelist.push(capitalize(word));
}
export default whitelist;
15 changes: 14 additions & 1 deletion wordLists/writeGoodComments.whitelist.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
// eslint-disable-next-line @eslint-community/eslint-comments/disable-enable-pair
/* eslint-disable @cspell/spellchecker */

function capitalize(lowercaseString: string): string {
return lowercaseString.charAt(0).toUpperCase() + lowercaseString.slice(1)
}

const whitelistLowercase = ['only', 'validate'] satisfies Array<
Lowercase<string>
>

/**
* Words that will not be flagged by write-good-comments.
*/
export const whitelist = ['only', 'validate', 'Validate']
export const whitelist = [...whitelistLowercase] as string[]

// List is case-sensitive, include words starting with capitals.
for (const word of whitelist) {
whitelist.push(capitalize(word))
}

export default whitelist

0 comments on commit 1a87081

Please sign in to comment.