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 filename-snake-case rule #67

Merged
merged 3 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/readme-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ const content = readFileSync(fileLocation, { encoding: 'utf-8' })
const errors: Array<string> = []

rules.forEach((rule) => {
// Look for the rule in the index
const indexIndex = content.indexOf(`[${rule}](#${rule})`)
if (indexIndex === -1) {
errors.push(`\u001b[91mCould not find rule ${rule} in README index\u001b[0m`)
}

const smallWords = ['at', 'in']
const largeWords = ['eof']

Expand All @@ -33,6 +27,12 @@ rules.forEach((rule) => {
})
.join(' ')

// Look for the rule in the table
const tableIndex = content.indexOf(`[${ruleTitlized}](#${rule})`)
if (tableIndex === -1) {
errors.push(`\u001b[91mCould not find rule ${rule} in README index\u001b[0m`)
}

const index = content.indexOf(`### ${ruleTitlized}`)
if (index === -1) {
errors.push(`\u001b[91mCould not find entry for ${ruleTitlized} in README\u001b[0m`)
Expand Down
Loading