Skip to content

Commit 76c0c54

Browse files
marksvcpmachapman
authored andcommitted
dev: enable rule warn no-floating-promises and no-misused-promises
The rules are not enabled for spec and stories files. It may also be useful to have the rules on in those files, but (1) calls to async methods in fakeAsync do not need awaited, and (2) the IDE understands toBe, toEqual, etc to return Promises. Ideally the rules would mark occurrences as errors, but there are many occurrences that first need to be cleaned up.
1 parent 4d3a87c commit 76c0c54

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/RealtimeServer/.eslintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
],
3636
"@typescript-eslint/naming-convention": ["error", { "selector": "enumMember", "format": ["PascalCase"] }],
3737
"@typescript-eslint/no-explicit-any": "off",
38+
"@typescript-eslint/no-floating-promises": "warn",
39+
"@typescript-eslint/no-misused-promises": "warn",
3840
"@typescript-eslint/no-non-null-assertion": "off",
3941
"@typescript-eslint/no-unused-vars": [
4042
"error",
@@ -63,6 +65,10 @@
6365
],
6466
"no-underscore-dangle": "off"
6567
}
68+
},
69+
{
70+
"files": ["*.spec.ts"],
71+
"rules": { "@typescript-eslint/no-floating-promises": "off", "@typescript-eslint/no-misused-promises": "off" }
6672
}
6773
]
6874
}

src/SIL.XForge.Scripture/ClientApp/.eslintrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353
"format": ["PascalCase"]
5454
}
5555
],
56+
"@typescript-eslint/no-floating-promises": "warn",
5657
"@typescript-eslint/no-inferrable-types": "off",
58+
"@typescript-eslint/no-misused-promises": "warn",
5759
"@typescript-eslint/no-non-null-assertion": "off",
5860
"@typescript-eslint/no-unused-vars": [
5961
"error",
@@ -106,6 +108,14 @@
106108
],
107109
"deprecation/deprecation": "warn"
108110
}
111+
},
112+
{
113+
"files": ["*.spec.ts"],
114+
"rules": { "@typescript-eslint/no-floating-promises": "off", "@typescript-eslint/no-misused-promises": "off" }
115+
},
116+
{
117+
"files": ["*.stories.ts"],
118+
"rules": { "@typescript-eslint/no-floating-promises": "off", "@typescript-eslint/no-misused-promises": "off" }
109119
}
110120
]
111121
}

0 commit comments

Comments
 (0)