Skip to content

Commit 634f84d

Browse files
authored
Set typescript strict option to true for functions and testing (#1915)
Enable typescript script option
1 parent 1b1827c commit 634f84d

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

packages/firebase/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"compilerOptions": {
44
"outDir": "dist",
55
"declaration": false,
6-
"allowSyntheticDefaultImports": true
6+
"allowSyntheticDefaultImports": true,
7+
"strict": true
78
},
89
"exclude": [
910
"dist/**/*"

packages/functions/src/api/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class Service implements FirebaseFunctions, FirebaseService {
7171
private readonly serializer = new Serializer();
7272
private emulatorOrigin: string | null = null;
7373
private cancelAllRequests: Promise<void>;
74-
private deleteService: Function;
74+
private deleteService!: Function;
7575

7676
/**
7777
* Creates a new Functions service for the given app and (optional) region.

packages/functions/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"extends": "../../config/tsconfig.base.json",
33
"compilerOptions": {
4-
"outDir": "dist"
4+
"outDir": "dist",
5+
"strict": true
56
},
67
"exclude": [
78
"dist/**/*"

packages/testing/test/database.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,17 @@ describe('Testing Module Tests', function() {
8787
});
8888

8989
it('loadDatabaseRules() throws if no databaseName or rules', async function() {
90-
await expect(firebase.loadDatabaseRules.bind(null, {})).to.throw(
90+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
91+
await expect((firebase as any).loadDatabaseRules.bind(null, {})).to.throw(
9192
/databaseName not specified/
9293
);
93-
await expect(firebase.loadDatabaseRules.bind(null, {
94+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
95+
await expect((firebase as any).loadDatabaseRules.bind(null, {
9496
databaseName: 'foo'
9597
}) as Promise<void>).to.throw(/must provide rules/);
9698
await expect(
97-
firebase.loadDatabaseRules.bind(null, { rules: '{}' })
99+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
100+
(firebase as any).loadDatabaseRules.bind(null, { rules: '{}' })
98101
).to.throw(/databaseName not specified/);
99102
});
100103

packages/testing/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"extends": "../../config/tsconfig.base.json",
33
"compilerOptions": {
4-
"outDir": "dist"
4+
"outDir": "dist",
5+
"strict": true
56
},
67
"exclude": [
78
"dist/**/*"

0 commit comments

Comments
 (0)