Skip to content

Commit 7d65144

Browse files
committed
Merge branch 'error-revamp' into je-prefix
2 parents 3aa68ff + a464475 commit 7d65144

32 files changed

Lines changed: 925 additions & 1212 deletions

.eslintrc.js

Lines changed: 0 additions & 135 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
node-version: [18.x, 20.x, 22.x, 24.x]
12+
node-version: [22.x, 24.x, 26.x]
1313

1414
steps:
1515
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
1616
- name: Set up Node.js ${{ matrix.node-version }}
1717
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1818
with:
1919
node-version: ${{ matrix.node-version }}
20+
# Java 21 is required by firebase-tools to run emulator-based integration tests
21+
- name: Set up Java
22+
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
23+
with:
24+
distribution: 'temurin'
25+
java-version: '21'
2026
- name: Install and build
2127
run: |
2228
npm ci
@@ -28,6 +34,6 @@ jobs:
2834
run: npm run api-extractor
2935
- name: Run emulator-based integration tests
3036
run: |
31-
npm install -g firebase-tools@11.30.0
37+
npm install -g firebase-tools@15.17.0
3238
firebase emulators:exec --project fake-project-id --only auth,database,firestore \
3339
'npx mocha test/integration/auth.spec.ts test/integration/database.spec.ts test/integration/firestore.spec.ts --slow 5000 --timeout 20000 --require ts-node/register'

.github/workflows/nightly.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ jobs:
3636
- name: Set up Node.js
3737
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3838
with:
39-
node-version: 18.x
39+
node-version: 22.x
40+
41+
# Java 21 is required by firebase-tools to run emulator-based integration tests
42+
- name: Set up Java
43+
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
44+
with:
45+
distribution: 'temurin'
46+
java-version: '21'
4047

4148
- name: Install and build
4249
run: |
@@ -52,7 +59,7 @@ jobs:
5259

5360
- name: Run emulator-based integration tests
5461
run: |
55-
npm install -g firebase-tools@11.30.0
62+
npm install -g firebase-tools@15.17.0
5663
firebase emulators:exec --project fake-project-id --only auth,database,firestore \
5764
'npx mocha test/integration/auth.spec.ts test/integration/database.spec.ts test/integration/firestore.spec.ts --slow 5000 --timeout 20000 --require ts-node/register'
5865

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Set up Node.js
5252
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
5353
with:
54-
node-version: 18.x
54+
node-version: 22.x
5555

5656
- name: Install and build
5757
run: |
@@ -122,7 +122,7 @@ jobs:
122122
- name: Set up Node.js
123123
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
124124
with:
125-
node-version: 18.x
125+
node-version: 22.x
126126

127127
- name: Publish preflight check
128128
id: preflight

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ requests, code review feedback, and also pull requests.
5959

6060
## Supported Environments
6161

62-
We currently support Node.js 18 and higher, but support for Node.js 18 and Node.js 20 is deprecated. We strongly encourage
63-
you to use Node.js 22 or higher as we will drop support for Node.js 18 and Node.js 20 in the next major version.
62+
We currently support Node.js 22 and higher.
6463

6564
Please also note that the Admin SDK should only
6665
be used in server-side/back-end environments controlled by the app developer.

eslint.config.mjs

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
/*!
2+
* Copyright 2026 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { defineConfig } from 'eslint/config';
18+
import eslint from '@eslint/js';
19+
import tseslint from 'typescript-eslint';
20+
import globals from 'globals';
21+
22+
export default defineConfig([
23+
eslint.configs.recommended,
24+
...tseslint.configs.recommended,
25+
{
26+
files: ['src/**/*.ts', 'test/**/*.ts'],
27+
languageOptions: {
28+
globals: {
29+
...globals.node,
30+
},
31+
},
32+
rules: {
33+
// Following checks are temporarily disabled. We shall incrementally enable them in the
34+
// future, fixing any violations as we go.
35+
'@typescript-eslint/no-non-null-assertion': 0,
36+
37+
// Disabled checks
38+
'@typescript-eslint/no-explicit-any': 0,
39+
'@typescript-eslint/no-use-before-define': 0,
40+
'@typescript-eslint/no-var-requires': 0,
41+
'@typescript-eslint/no-require-imports': 0,
42+
'@typescript-eslint/no-unused-expressions': 0,
43+
44+
// Required checks
45+
'indent': ['error', 2],
46+
'keyword-spacing': ['error'],
47+
'max-len': [
48+
'error',
49+
{
50+
'code': 120,
51+
'ignoreUrls': true
52+
}
53+
],
54+
'object-curly-spacing': [2, 'always'],
55+
'@typescript-eslint/explicit-function-return-type': [
56+
'error',
57+
{
58+
'allowExpressions': true,
59+
'allowTypedFunctionExpressions': true,
60+
'allowHigherOrderFunctions': true
61+
}
62+
],
63+
'no-unused-vars': 'off', // Must be disabled to enable the next rule
64+
'@typescript-eslint/no-unused-vars': [
65+
'error',
66+
{
67+
'varsIgnorePattern': '^_',
68+
'argsIgnorePattern': '^_',
69+
'caughtErrors': 'none'
70+
}
71+
],
72+
'quotes': ['error', 'single', {'avoidEscape': true}],
73+
'@typescript-eslint/naming-convention': [
74+
'error',
75+
{
76+
"selector": "variable",
77+
"format": ["camelCase", "UPPER_CASE"]
78+
},
79+
{
80+
"selector": "variable",
81+
"modifiers": ["const"],
82+
"format": ["PascalCase", "camelCase", "UPPER_CASE"],
83+
"filter": {
84+
"regex": "ErrorCode$", // Matches only if it ends exactly with ErrorCode
85+
"match": true,
86+
},
87+
},
88+
{
89+
"selector": "parameter",
90+
"format": ["camelCase"],
91+
"leadingUnderscore": "allow"
92+
},
93+
94+
{
95+
"selector": "memberLike",
96+
"format": ["camelCase"]
97+
},
98+
99+
{
100+
"selector": "typeLike",
101+
"format": ["PascalCase"]
102+
},
103+
104+
// Ignore properties that require quotes (HTTP headers, names that include spaces or dashes etc.).
105+
{
106+
"selector": [
107+
"classProperty",
108+
"objectLiteralProperty",
109+
"typeProperty",
110+
"classMethod",
111+
"objectLiteralMethod",
112+
"typeMethod",
113+
"accessor",
114+
"enumMember"
115+
],
116+
"format": null,
117+
"modifiers": ["requiresQuotes"]
118+
},
119+
120+
// Ignore destructured property names.
121+
{
122+
"selector": "variable",
123+
"modifiers": ["destructured"],
124+
"format": null
125+
},
126+
127+
// Following types are temporarily disabled. We shall incrementally enable them in the
128+
// future, fixing any violations as we go.
129+
{
130+
"selector": [
131+
"classProperty",
132+
"objectLiteralProperty",
133+
"typeProperty",
134+
"enumMember"
135+
],
136+
"format": null
137+
}
138+
],
139+
}
140+
},
141+
{
142+
files: ['test/**/*.ts'],
143+
languageOptions: {
144+
globals: {
145+
...globals.mocha,
146+
},
147+
},
148+
},
149+
{
150+
ignores: [
151+
'lib/',
152+
'node_modules/',
153+
'temp/',
154+
'docgen/',
155+
'dist/',
156+
'coverage/',
157+
'**/*.d.ts',
158+
'**/*.js',
159+
'firebase-admin-*.tgz'
160+
]
161+
}
162+
]);

0 commit comments

Comments
 (0)