Skip to content

Commit 22e3630

Browse files
authored
chore: Synced file(s) with googlemaps/.github (#392)
* chore: Synced local '.eslintrc.json' with remote 'sync-files/js/.eslintrc.json' * style: fix eslint
1 parent fb42dcc commit 22e3630

File tree

4 files changed

+43
-22
lines changed

4 files changed

+43
-22
lines changed

.eslintrc.json

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,27 @@
1515
"prefer-arrow-callback": 2,
1616
"@typescript-eslint/ban-ts-comment": 0,
1717
"@typescript-eslint/ban-types": 1,
18-
"@typescript-eslint/no-empty-function": 1
19-
},
18+
"@typescript-eslint/no-empty-function": 1,
19+
// disable the rule for all files
20+
"@typescript-eslint/explicit-member-accessibility": "off"
21+
},
22+
"overrides": [
23+
{
24+
// enable the rule specifically for TypeScript files
25+
"files": ["*.ts", "*.tsx"],
26+
"rules": {
27+
"@typescript-eslint/explicit-member-accessibility": [
28+
"error", {
29+
"accessibility": "explicit",
30+
"overrides": {
31+
"accessors": "explicit",
32+
"constructors": "no-public",
33+
"methods": "explicit",
34+
"properties": "explicit",
35+
"parameterProperties": "explicit"
36+
}}]
37+
}
38+
}],
2039
"env": {
2140
"browser": true,
2241
"node": true,

e2e/selenium.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
16+
/* eslint @typescript-eslint/ban-ts-ignore: 0 */
1717
import path from "path";
1818
import webdriver from "selenium-webdriver";
1919

@@ -54,8 +54,10 @@ it("loader should load map and getCenter", async () => {
5454

5555
await expect(
5656
driver.executeAsyncScript((apiKey: string) => {
57+
/* eslint-disable no-undef */
5758
// @ts-ignore-next-line
5859
const callback = arguments[arguments.length - 1];
60+
/* eslint-enable no-undef */
5961

6062
// @ts-ignore-next-line
6163
const { expect } = window.jestLite.core;

src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
16+
/* eslint @typescript-eslint/no-explicit-any: 0 */
1717
import { DEFAULT_ID, Loader, LoaderOptions } from ".";
1818

1919
jest.useFakeTimers();

src/index.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -188,56 +188,56 @@ export class Loader {
188188
/**
189189
* See [[LoaderOptions.version]]
190190
*/
191-
version: string;
191+
public readonly version: string;
192192
/**
193193
* See [[LoaderOptions.apiKey]]
194194
*/
195-
apiKey: string;
195+
public readonly apiKey: string;
196196
/**
197197
* See [[LoaderOptions.channel]]
198198
*/
199-
channel: string;
199+
public readonly channel: string;
200200
/**
201201
* See [[LoaderOptions.client]]
202202
*/
203-
client: string;
203+
public readonly client: string;
204204
/**
205205
* See [[LoaderOptions.id]]
206206
*/
207-
id: string;
207+
public readonly id: string;
208208
/**
209209
* See [[LoaderOptions.libraries]]
210210
*/
211-
libraries: Libraries;
211+
public readonly libraries: Libraries;
212212
/**
213213
* See [[LoaderOptions.language]]
214214
*/
215-
language: string;
215+
public readonly language: string;
216216

217217
/**
218218
* See [[LoaderOptions.region]]
219219
*/
220-
region: string;
220+
public readonly region: string;
221221

222222
/**
223223
* See [[LoaderOptions.mapIds]]
224224
*/
225-
mapIds: string[];
225+
public readonly mapIds: string[];
226226

227227
/**
228228
* See [[LoaderOptions.nonce]]
229229
*/
230-
nonce: string | null;
230+
public readonly nonce: string | null;
231231

232232
/**
233233
* See [[LoaderOptions.retries]]
234234
*/
235-
retries: number;
235+
public readonly retries: number;
236236

237237
/**
238238
* See [[LoaderOptions.url]]
239239
*/
240-
url: string;
240+
public readonly url: string;
241241

242242
private CALLBACK = "__googleMapsCallback";
243243
private callbacks: ((e: ErrorEvent) => void)[] = [];
@@ -298,7 +298,7 @@ export class Loader {
298298
Loader.instance = this;
299299
}
300300

301-
get options(): LoaderOptions {
301+
public get options(): LoaderOptions {
302302
return {
303303
version: this.version,
304304
apiKey: this.apiKey,
@@ -323,7 +323,7 @@ export class Loader {
323323
*
324324
* @ignore
325325
*/
326-
createUrl(): string {
326+
public createUrl(): string {
327327
let url = this.url;
328328

329329
url += `?callback=${this.CALLBACK}`;
@@ -366,7 +366,7 @@ export class Loader {
366366
/**
367367
* Load the Google Maps JavaScript API script and return a Promise.
368368
*/
369-
load(): Promise<typeof google> {
369+
public load(): Promise<typeof google> {
370370
return this.loadPromise();
371371
}
372372

@@ -375,7 +375,7 @@ export class Loader {
375375
*
376376
* @ignore
377377
*/
378-
loadPromise(): Promise<typeof google> {
378+
public loadPromise(): Promise<typeof google> {
379379
return new Promise((resolve, reject) => {
380380
this.loadCallback((err: ErrorEvent) => {
381381
if (!err) {
@@ -390,7 +390,7 @@ export class Loader {
390390
/**
391391
* Load the Google Maps JavaScript API script with a callback.
392392
*/
393-
loadCallback(fn: (e: ErrorEvent) => void): void {
393+
public loadCallback(fn: (e: ErrorEvent) => void): void {
394394
this.callbacks.push(fn);
395395
this.execute();
396396
}
@@ -421,7 +421,7 @@ export class Loader {
421421
document.head.appendChild(script);
422422
}
423423

424-
deleteScript(): void {
424+
public deleteScript(): void {
425425
const script = document.getElementById(this.id);
426426
if (script) {
427427
script.remove();

0 commit comments

Comments
 (0)