diff --git a/static/js/apps/explore/debug_info.tsx b/static/js/apps/explore/debug_info.tsx index 44445f8713..a59e3a8a2c 100644 --- a/static/js/apps/explore/debug_info.tsx +++ b/static/js/apps/explore/debug_info.tsx @@ -57,8 +57,8 @@ const svToSentences = (
  • {sentence.sentence} (cosine: {sentence.score.toFixed(4)} - {sentence.rerank_score - ? " - rerank:" + sentence.rerank_score.toFixed(4) + {sentence.rerankScore + ? " - rerank:" + sentence.rerankScore.toFixed(4) : ""} )
  • diff --git a/static/js/apps/visualization/selector_wrapper.tsx b/static/js/apps/visualization/selector_wrapper.tsx index f68df5d54f..18abeadc55 100644 --- a/static/js/apps/visualization/selector_wrapper.tsx +++ b/static/js/apps/visualization/selector_wrapper.tsx @@ -18,7 +18,6 @@ * Wrapper for selectors used in the selector pane. */ -import _ from "lodash"; import React from "react"; interface SelectorWrapperPropType { diff --git a/static/js/apps/visualization/vis_type_configs/scatter_config.tsx b/static/js/apps/visualization/vis_type_configs/scatter_config.tsx index 3863f5aa03..316f04e783 100644 --- a/static/js/apps/visualization/vis_type_configs/scatter_config.tsx +++ b/static/js/apps/visualization/vis_type_configs/scatter_config.tsx @@ -76,7 +76,7 @@ function getDisplayInputs(appContext: AppContextType): InputInfo[] { return [ { isChecked: appContext.displayOptions.scatterQuadrants, - onUpdated: (isChecked: boolean) => { + onUpdated: (isChecked: boolean): void => { const newDisplayOptions = _.cloneDeep(appContext.displayOptions); newDisplayOptions.scatterQuadrants = isChecked; appContext.setDisplayOptions(newDisplayOptions); @@ -86,7 +86,7 @@ function getDisplayInputs(appContext: AppContextType): InputInfo[] { }, { isChecked: appContext.displayOptions.scatterPlaceLabels, - onUpdated: (isChecked: boolean) => { + onUpdated: (isChecked: boolean): void => { const newDisplayOptions = _.cloneDeep(appContext.displayOptions); newDisplayOptions.scatterPlaceLabels = isChecked; appContext.setDisplayOptions(newDisplayOptions); @@ -122,7 +122,7 @@ function getFacetSelector(appContext: AppContextType): JSX.Element { }; }); }); - const onSvFacetIdUpdated = (svFacetId: Record) => { + const onSvFacetIdUpdated = (svFacetId: Record): void => { const facetsChanged = statVars.filter( (sv) => sv.facetId !== svFacetId[sv.dcid] ); diff --git a/static/js/biomedical/landing/card.tsx b/static/js/biomedical/landing/card.tsx index 5feefa5e8f..14489354e2 100644 --- a/static/js/biomedical/landing/card.tsx +++ b/static/js/biomedical/landing/card.tsx @@ -43,7 +43,7 @@ const CardContainer = styled.a` `; const Text = styled.div` - color: ${(props) => props.theme.textColor || "#146C2E"}; + color: ${(props: CardProps): string => props.theme.textColor || "#146C2E"}; font-size: 24px; font-weight: 400; line-height: 32px; @@ -57,9 +57,11 @@ const Text = styled.div` const Tag = styled.div` align-items: center; - background-color: ${(props) => props.theme.tagBackgroundColor || "#C4EED0"}; + background-color: ${(props: CardProps): string => + props.theme.tagBackgroundColor || "#C4EED0"}; border-radius: 28px; - color: ${(props) => props.theme.tagLabelColor || "#072711"}; + color: ${(props: CardProps): string => + props.theme.tagLabelColor || "#072711"}; display: flex; font-size: 12px; font-weight: 500; diff --git a/static/js/shared/util.test.ts b/static/js/shared/util.test.ts index b5c893c456..57f1367193 100644 --- a/static/js/shared/util.test.ts +++ b/static/js/shared/util.test.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +/* eslint-disable camelcase */ + import { MAX_DATE, MAX_YEAR } from "./constants"; import { getCappedStatVarDate, isDateTooFar } from "./util"; diff --git a/static/js/tools/download/mock_functions.ts b/static/js/tools/download/mock_functions.ts index 1393b08539..521c17dcec 100644 --- a/static/js/tools/download/mock_functions.ts +++ b/static/js/tools/download/mock_functions.ts @@ -16,6 +16,8 @@ /* mocked axios calls for Page test for download tool. */ +/* eslint-disable camelcase */ + jest.mock("axios"); import axios from "axios"; import { when } from "jest-when"; diff --git a/static/js/tools/scatter/app.test.tsx b/static/js/tools/scatter/app.test.tsx index 0de44b8370..a5b30a7e09 100644 --- a/static/js/tools/scatter/app.test.tsx +++ b/static/js/tools/scatter/app.test.tsx @@ -14,6 +14,8 @@ * limitations under the License. */ +/* eslint-disable camelcase */ + jest.mock("axios"); import { act, waitFor } from "@testing-library/react"; diff --git a/static/js/tools/scatter/place_and_type_options.tsx b/static/js/tools/scatter/place_and_type_options.tsx index bfdaf96276..e5ccb964d5 100644 --- a/static/js/tools/scatter/place_and_type_options.tsx +++ b/static/js/tools/scatter/place_and_type_options.tsx @@ -107,7 +107,7 @@ function PlaceAndTypeOptions(props: PlaceAndTypeOptionsProps): JSX.Element { ? "selected-chart-option" : "chart-type-option" }`} - onClick={() => display.setChartType(ScatterChartType.SCATTER)} + onClick={(): void => display.setChartType(ScatterChartType.SCATTER)} > scatter_plot @@ -117,7 +117,7 @@ function PlaceAndTypeOptions(props: PlaceAndTypeOptionsProps): JSX.Element { ? "selected-chart-option" : "chart-type-option" }`} - onClick={() => display.setChartType(ScatterChartType.MAP)} + onClick={(): void => display.setChartType(ScatterChartType.MAP)} > public diff --git a/static/js/tools/scatter/plot_options.tsx b/static/js/tools/scatter/plot_options.tsx index dc786221f3..8c82820ea2 100644 --- a/static/js/tools/scatter/plot_options.tsx +++ b/static/js/tools/scatter/plot_options.tsx @@ -19,12 +19,10 @@ * lower and upper bounds for populations. */ -import _ from "lodash"; import React, { useContext, useState } from "react"; import { Button, Card, FormGroup, Input, Label } from "reactstrap"; import { Container } from "reactstrap"; -import { DENOM_INPUT_PLACEHOLDER } from "../../shared/constants"; import { GA_EVENT_TOOL_CHART_OPTION_CLICK, GA_PARAM_TOOL_CHART_OPTION, @@ -65,18 +63,6 @@ function swapAxes(x: AxisWrapper, y: AxisWrapper): void { y.set(xValue); } -/** - * Toggles whether to plot per capita values for an axis. - * @param axis - * @param event - */ -function checkPerCapita( - axis: AxisWrapper, - event: React.ChangeEvent -): void { - axis.setPerCapita(event.target.checked); -} - /** * Toggles whether to plot an axis on log scale. * @param axis @@ -178,8 +164,6 @@ function PlotOptions(): JSX.Element { const [upperBound, setUpperBound] = useState( place.value.upperBound.toString() ); - const [xDenomInput, setXDenomInput] = useState(x.value.denom); - const [yDenomInput, setYDenomInput] = useState(y.value.denom); const yAxisLabel = display.chartType === ScatterChartType.SCATTER ? "Y-axis" @@ -217,7 +201,7 @@ function PlotOptions(): JSX.Element { id="per-capita-y" type="checkbox" checked={y.value.perCapita} - onChange={(e) => { + onChange={(e): void => { y.setPerCapita(e.target.checked); if (!y.value.perCapita) { triggerGAEvent(GA_EVENT_TOOL_CHART_OPTION_CLICK, { @@ -237,7 +221,7 @@ function PlotOptions(): JSX.Element { id="log-y" type="checkbox" checked={y.value.log} - onChange={(e) => { + onChange={(e): void => { checkLog(y, e); if (!y.value.log) { triggerGAEvent(GA_EVENT_TOOL_CHART_OPTION_CLICK, { @@ -264,7 +248,7 @@ function PlotOptions(): JSX.Element { id="per-capita-x" type="checkbox" checked={x.value.perCapita} - onChange={(e) => { + onChange={(e): void => { x.setPerCapita(e.target.checked); if (!x.value.perCapita) { triggerGAEvent(GA_EVENT_TOOL_CHART_OPTION_CLICK, { @@ -284,7 +268,7 @@ function PlotOptions(): JSX.Element { id="log-x" type="checkbox" checked={x.value.log} - onChange={(e) => { + onChange={(e): void => { checkLog(x, e); if (!x.value.log) { triggerGAEvent(GA_EVENT_TOOL_CHART_OPTION_CLICK, { @@ -309,7 +293,7 @@ function PlotOptions(): JSX.Element { id="swap-axes" size="sm" color="light" - onClick={() => { + onClick={(): void => { swapAxes(x, y); triggerGAEvent(GA_EVENT_TOOL_CHART_OPTION_CLICK, { [GA_PARAM_TOOL_CHART_OPTION]: @@ -328,7 +312,7 @@ function PlotOptions(): JSX.Element { id="quadrants" type="checkbox" checked={display.showQuadrants} - onChange={(e) => { + onChange={(e): void => { checkQuadrants(display, e); if (!display.showQuadrants) { triggerGAEvent(GA_EVENT_TOOL_CHART_OPTION_CLICK, { @@ -349,7 +333,7 @@ function PlotOptions(): JSX.Element { id="quadrants" type="checkbox" checked={display.showLabels} - onChange={(e) => { + onChange={(e): void => { checkLabels(display, e); if (!display.showLabels) { triggerGAEvent(GA_EVENT_TOOL_CHART_OPTION_CLICK, { @@ -370,7 +354,7 @@ function PlotOptions(): JSX.Element { id="density" type="checkbox" checked={display.showDensity} - onChange={(e) => { + onChange={(e): void => { checkDensity(display, e); if (!display.showDensity) { triggerGAEvent(GA_EVENT_TOOL_CHART_OPTION_CLICK, { @@ -396,7 +380,7 @@ function PlotOptions(): JSX.Element { { + onChange={(e): void => { selectShowPopulation(display, e); if (display.showPopulation !== SHOW_POPULATION_OFF) { triggerGAEvent(GA_EVENT_TOOL_CHART_OPTION_CLICK, { @@ -416,7 +400,7 @@ function PlotOptions(): JSX.Element { display.showPopulation === SHOW_POPULATION_LINEAR } id="show-population-linear" - onChange={(e) => { + onChange={(e): void => { selectShowPopulation(display, e); if (display.showPopulation !== SHOW_POPULATION_LINEAR) { triggerGAEvent(GA_EVENT_TOOL_CHART_OPTION_CLICK, { @@ -434,7 +418,7 @@ function PlotOptions(): JSX.Element { { + onChange={(e): void => { selectShowPopulation(display, e); if (display.showPopulation !== SHOW_POPULATION_LOG) { triggerGAEvent(GA_EVENT_TOOL_CHART_OPTION_CLICK, { @@ -459,11 +443,11 @@ function PlotOptions(): JSX.Element { + onChange={(e): void => selectLowerBound(place, e, setLowerBound) } value={lowerBound} - onBlur={() => { + onBlur={(): void => { setLowerBound(place.value.lowerBound.toString()); triggerGAEvent(GA_EVENT_TOOL_CHART_OPTION_CLICK, { [GA_PARAM_TOOL_CHART_OPTION]: @@ -479,11 +463,11 @@ function PlotOptions(): JSX.Element { + onChange={(e): void => selectUpperBound(place, e, setUpperBound) } value={upperBound} - onBlur={() => { + onBlur={(): void => { setUpperBound(place.value.upperBound.toString()); triggerGAEvent(GA_EVENT_TOOL_CHART_OPTION_CLICK, { [GA_PARAM_TOOL_CHART_OPTION]: diff --git a/static/js/tools/scatter/statvar.tsx b/static/js/tools/scatter/statvar.tsx index c2ffd6abdf..5972da6d5e 100644 --- a/static/js/tools/scatter/statvar.tsx +++ b/static/js/tools/scatter/statvar.tsx @@ -90,7 +90,7 @@ export function StatVarChooser(props: StatVarChooserProps): JSX.Element { ); setSamplePlaces(samplePlaces); }, [place.value.enclosedPlaces]); - const closeModal = () => { + const closeModal = (): void => { setThirdStatVar(emptyStatVar); setModalOpen(false); }; @@ -155,13 +155,15 @@ export function StatVarChooser(props: StatVarChooserProps): JSX.Element { collapsible={true} svHierarchyType={StatVarHierarchyType.SCATTER} sampleEntities={samplePlaces} - deselectSVs={(svList: string[]) => + deselectSVs={(svList: string[]): void => svList.forEach((sv) => { removeStatVar(x, y, sv); }) } selectedSVs={selectedSvs} - selectSV={(sv) => addStatVar(x, y, sv, setThirdStatVar, setModalOpen)} + selectSV={(sv): void => + addStatVar(x, y, sv, setThirdStatVar, setModalOpen) + } /> {/* Modal for selecting 2 stat vars when a third is selected */} @@ -181,7 +183,9 @@ export function StatVarChooser(props: StatVarChooserProps): JSX.Element { type="radio" name="statvar" defaultChecked={modalSelected.x} - onClick={() => setModalSelected({ x: true, y: false })} + onClick={(): void => + setModalSelected({ x: true, y: false }) + } /> {xTitle} @@ -193,7 +197,9 @@ export function StatVarChooser(props: StatVarChooserProps): JSX.Element { type="radio" name="statvar" defaultChecked={modalSelected.y} - onClick={() => setModalSelected({ x: false, y: true })} + onClick={(): void => + setModalSelected({ x: false, y: true }) + } /> {yTitle} @@ -204,7 +210,7 @@ export function StatVarChooser(props: StatVarChooserProps): JSX.Element {