Skip to content

Commit c3b9cb5

Browse files
committed
Add constrints to restricted syntax concerns.
1 parent b9c1f4a commit c3b9cb5

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

eslint.config.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ const cwd = dirname(fileURLToPath(import.meta.url));
1212
const ezDir = join(cwd, "express-zod-api");
1313
const migrationDir = join(cwd, "migration");
1414

15-
const importConcerns = [
15+
interface RestrictedSyntax {
16+
selector: string;
17+
message: string;
18+
}
19+
20+
const importConcerns: RestrictedSyntax[] = [
1621
{
1722
selector:
1823
"ImportDeclaration[source.value='ramda'] > ImportSpecifier, " +
@@ -29,7 +34,7 @@ const importConcerns = [
2934
})),
3035
];
3136

32-
const performanceConcerns = [
37+
const performanceConcerns: RestrictedSyntax[] = [
3338
{
3439
selector: "ImportDeclaration[source.value=/assert/]", // #2169
3540
message: "assert is slow, use throw",
@@ -58,7 +63,7 @@ const performanceConcerns = [
5863
},
5964
];
6065

61-
const tsFactoryConcerns = [
66+
const tsFactoryConcerns: RestrictedSyntax[] = [
6267
{
6368
selector: "Identifier[name='createConditionalExpression']",
6469
message: "use makeTernary() helper",

0 commit comments

Comments
 (0)