Skip to content

Commit

Permalink
[misc] better name for directory entities
Browse files Browse the repository at this point in the history
  • Loading branch information
grasword committed Oct 16, 2023
1 parent a190224 commit 7192f66
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/validator/source/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ export const loadRules = async (rulesToLoad?: string[]): Promise<Record<string,
const rulesDir = new URL('rules', import.meta.url)
debug('searching for rules in: %o', rulesDir.pathname)

const files = await readdir(rulesDir, {
const dirent = await readdir(rulesDir, {
withFileTypes: true
})

const rulePromises = files
const rulePromises = dirent
.filter(
(file) =>
file.isFile() && (file.name.endsWith('.js') || (file.name.endsWith('.ts') && !file.name.includes('.test.')))
(ent) => ent.isFile() && (ent.name.endsWith('.js') || (ent.name.endsWith('.ts') && !ent.name.includes('.test.')))
)
.map((file) => ({
ruleId: path.parse(file.name).name,
Expand Down

0 comments on commit 7192f66

Please sign in to comment.