Skip to content

Commit

Permalink
chore: upgrade eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
rot1024 committed Apr 4, 2023
1 parent c57839a commit d557958
Show file tree
Hide file tree
Showing 12 changed files with 493 additions and 199 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
"c8": "7.12.0",
"del-cli": "5.0.0",
"dotenv": "16.0.3",
"eslint": "8.31.0",
"eslint-config-reearth": "0.2.1",
"eslint-plugin-playwright": "0.11.2",
"eslint": "8.37.0",
"eslint-config-reearth": "0.2.2",
"eslint-plugin-playwright": "0.12.0",
"husky": "8.0.3",
"i18next-parser": "7.2.0",
"jsdom": "21.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ export default function Indicator({ className, property }: Props): JSX.Element |
if (viewer.isDestroyed()) return;
const selected = viewer.selectedEntity;
if (
!selected ||
!selected.isShowing ||
!selected?.isShowing ||
!selected.isAvailable(viewer.clock.currentTime) ||
!selected.position
) {
Expand Down
3 changes: 2 additions & 1 deletion src/components/molecules/Visualizer/Plugin/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ export function Provider({
builtinPrimitives,
engineName,
ev,
clientStorage,
getLayers,
getSceneProperty,
getInEditor,
getBuilt,
getTags,
getCamera,
getClock,
Expand Down Expand Up @@ -288,6 +288,7 @@ export function Provider({
emit,
moveWidget,
pluginInstances,
clientStorage,
],
);

Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/EarthEditor/CanvasArea/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const convertWidgets = (
ownBuiltinWidgets: { [K in keyof BuiltinWidgets<boolean>]?: BuiltinWidgets<boolean>[K] };
}
| undefined => {
if (!data || !data.node || data.node.__typename !== "Scene" || !data.node.widgetAlignSystem) {
if (!data?.node || data.node.__typename !== "Scene" || !data.node.widgetAlignSystem) {
return undefined;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const processDatasets = (
const processDataset = (fields: DatasetFragmentFragment["fields"]): { [key: string]: string } => {
const datasetFields = fields
.map((f): [string, string] | undefined => {
if (!f || !f.field) return undefined;
if (!f?.field) return undefined;
return [
f.field.name,
String(typeof f.value === "object" && "lat" in f.value ? Object.values(f.value) : f.value),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export const convert = (
property: PropertyFragmentFragment | null | undefined,
merged?: MergedPropertyFragmentFragment | null,
) => {
if (!property || !property.schema) return;
if (!property?.schema) return;
const {
items,
schema: { groups: schemaGroups },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export const convertWidgets = (
ownBuiltinWidgets: (keyof BuiltinWidgets)[];
}
| undefined => {
if (!data || !data.node || data.node.__typename !== "Scene" || !data.node.widgetAlignSystem) {
if (!data?.node || data.node.__typename !== "Scene" || !data.node.widgetAlignSystem) {
return undefined;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/Published/core/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default (alias?: string) => {
}
| undefined
>(() => {
if (!data || !data.widgets) return undefined;
if (!data?.widgets) return undefined;

const widgetsInWas = new Set<string>();
if (data.widgetAlignSystem) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/Published/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default (alias?: string) => {
const widgets = useMemo<
{ floatingWidgets: Widget[]; alignSystem: WidgetAlignSystem | undefined } | undefined
>(() => {
if (!data || !data.widgets) return undefined;
if (!data?.widgets) return undefined;

const widgetsInWas = new Set<string>();
if (data.widgetAlignSystem) {
Expand Down
39 changes: 20 additions & 19 deletions src/core/Crust/Plugins/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ export default function ({
getLayers,
getSceneProperty,
getInEditor,
getBuilt,
getTags,
getCamera,
getClock,
Expand All @@ -334,37 +335,37 @@ export default function ({
getSelectedLayer,
getSelectedFeature,
getLayerSelectionReason,
showLayer,
hideLayer,
addLayer,
selectLayer,
overrideLayerProperty,
overrideScenePropertyCommon,
lookAt,
layersInViewport,
pluginInstances,
clientStorage,
overrideSceneProperty,
addLayer,
flyTo,
lookAt,
zoomIn,
zoomOut,
cameraViewport,
rotateRight,
orbit,
captureScreen,
enableScreenSpaceCameraController,
flyTo,
flyToGround,
getLocationFromScreen,
sampleTerrainHeight,
hideLayer,
enableScreenSpaceCameraController,
lookHorizontal,
lookVertical,
moveForward,
moveBackward,
moveUp,
moveDown,
moveForward,
moveLeft,
moveOverTerrain,
moveRight,
moveUp,
orbit,
overrideLayerProperty,
rotateRight,
selectLayer,
showLayer,
zoomIn,
zoomOut,
moveOverTerrain,
flyToGround,
overrideSceneProperty,
pluginInstances,
clientStorage,
],
);

Expand Down
3 changes: 1 addition & 2 deletions src/core/engines/Cesium/core/Indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ export default function Indicator({ className, property }: Props): JSX.Element |
if (viewer.isDestroyed()) return;
const selected = viewer.selectedEntity;
if (
!selected ||
!selected.isShowing ||
!selected?.isShowing ||
!selected.isAvailable(viewer.clock.currentTime) ||
!selected.position
) {
Expand Down
Loading

0 comments on commit d557958

Please sign in to comment.