Skip to content

Commit

Permalink
Simplify duplicate checks
Browse files Browse the repository at this point in the history
  • Loading branch information
illright committed Jan 18, 2025
1 parent b8daa15 commit 6645ffc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/steiger-plugin-fsd/src/inconsistent-naming/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ const inconsistentNaming = {
}

const message = 'Inconsistent pluralization of entity names'
if (
pluralNames.length > singularNames.length &&
singularNames.some(([name]) => !duplicates.singular.includes(name))
) {
if (pluralNames.length > singularNames.length && singularNames.length > duplicates.singular.length) {
diagnostics.push({
message: `${message}. Prefer all plural names.`,
fixes: singularNames
Expand All @@ -64,7 +61,7 @@ const inconsistentNaming = {
})),
location: { path: join(entities.path, groupPrefix) },
})
} else if (pluralNames.some(([name]) => !duplicates.plural.includes(name))) {
} else if (pluralNames.length > duplicates.plural.length) {
diagnostics.push({
message: `${message}. Prefer all singular names.`,
fixes: pluralNames
Expand Down

0 comments on commit 6645ffc

Please sign in to comment.