Skip to content

Commit 4cf7bb7

Browse files
reenable several @typescript-eslint rules (#1398)
* reenable @typescript-eslint/no-unused-vars * reenable @typescript-eslint/require-await @typescript-eslint/no-floating-promises @typescript-eslint/no-misused-promises --------- Co-authored-by: William French <wfrench@google.com>
1 parent 2b45e60 commit 4cf7bb7

127 files changed

Lines changed: 328 additions & 363 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eslint.config.mjs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export default defineConfig([
2727
'prefer-const': 'error',
2828
'spaced-comment': ['error', 'always'],
2929

30-
// temporarily disabled for historic reasons:
31-
'no-prototype-builtins': 'off',
30+
// temporarily downgraded to warn for historic reasons:
31+
'no-prototype-builtins': 'warn',
3232
},
3333
},
3434
{
@@ -40,13 +40,19 @@ export default defineConfig([
4040
},
4141
},
4242
rules: {
43+
'@typescript-eslint/no-misused-promises': [
44+
'error',
45+
{
46+
checksVoidReturn: {
47+
arguments: false,
48+
attributes: false,
49+
},
50+
},
51+
],
52+
4353
// temporarily downgraded to warn for historic reasons:
4454
'@typescript-eslint/no-unsafe-member-access': 'warn',
45-
'@typescript-eslint/no-unused-vars': 'warn',
4655
'@typescript-eslint/no-unsafe-assignment': 'warn',
47-
'@typescript-eslint/require-await': 'warn',
48-
'@typescript-eslint/no-floating-promises': 'warn',
49-
'@typescript-eslint/no-misused-promises': 'warn',
5056
'@typescript-eslint/no-unsafe-call': 'warn',
5157
'@typescript-eslint/no-explicit-any': 'warn',
5258
'@typescript-eslint/no-namespace': 'warn',

samples/3d-accessibility-features/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ async function initMap() {
8282
document.body.append(map);
8383
}
8484

85-
initMap();
85+
void initMap();
8686
// [END maps_3d_accessibility_features]

samples/3d-camera-boundary/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ async function initMap() {
1919
document.body.append(map);
2020
}
2121

22-
initMap();
22+
void initMap();
2323
// [END maps_3d_camera_boundary]

samples/3d-camera-center/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ async function initMap(): Promise<void> {
3636
});
3737
}
3838

39-
initMap();
39+
void initMap();
4040
// [END maps_3d_camera_center]

samples/3d-camera-to-around/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ async function init() {
6161
); // Stop animation after flying around.
6262

6363
// At any time stop the animation.
64-
map.addEventListener('gmp-click', (event) => {
64+
map.addEventListener('gmp-click', () => {
6565
map.stopCameraAnimation();
6666
});
6767
}
6868

69-
init();
69+
void init();
7070
// [END maps_3d_camera_to_around]

samples/3d-clamp-mode/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ async function init() {
4848
document.body.append(map);
4949
}
5050

51-
init();
51+
void init();
5252

5353
// Dropdown event listener
5454
const dropdown = document.getElementById(

samples/3d-coverage-map/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ async function initMap() {
5353
}
5454
);
5555
}
56-
initMap();
56+
void initMap();
5757
// [END maps_3d_coverage_map]

samples/3d-label-toggle/index.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,6 @@ async function init() {
2525

2626
document.body.append(map);
2727

28-
const locationCamera = {
29-
center: {
30-
lat: 21.263523536467105,
31-
lng: -157.80663691939296,
32-
altitude: 80.28936069489404,
33-
},
34-
range: 1500.8202963253427,
35-
tilt: 76.9173260789542,
36-
heading: -44.59196007522445,
37-
};
38-
3928
// Get the button element by its ID
4029
const toggleButton = document.getElementById('toggleButton')!;
4130
toggleButton.addEventListener('click', function () {
@@ -52,5 +41,5 @@ async function init() {
5241
});
5342
}
5443

55-
init();
44+
void init();
5645
// [END maps_3d_label_toggle]

samples/3d-localization/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ async function initMap() {
2626
document.body.append(map);
2727
}
2828

29-
initMap();
29+
void initMap();
3030
// [END maps_3d_localization]

samples/3d-map-45-degree/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ async function init() {
2121
document.body.append(map);
2222
}
2323

24-
init();
24+
void init();
2525
// [END maps_3d_45_degree]

0 commit comments

Comments
 (0)