diff --git a/client/.eslintrc.json b/client/.eslintrc.json index ca803607a2..d6430072ce 100644 --- a/client/.eslintrc.json +++ b/client/.eslintrc.json @@ -69,7 +69,8 @@ } } } - ] + ], + "@typescript-eslint/consistent-type-imports": "error" } } ], diff --git a/client/src/charts/legends/LegendList.tsx b/client/src/charts/legends/LegendList.tsx index 63b4aa0844..0282e78e02 100644 --- a/client/src/charts/legends/LegendList.tsx +++ b/client/src/charts/legends/LegendList.tsx @@ -6,7 +6,7 @@ import { CheckBox } from "src/components/CheckBox/CheckBox"; import { is_a11y_mode } from "src/core/injected_build_constants"; -import { ComponentProps } from "src/types/util_types.d"; +import type { ComponentProps } from "src/types/util_types.d"; import type { LegendItemType } from "./LegendItemType"; diff --git a/client/src/charts/legends/StandardLegend.tsx b/client/src/charts/legends/StandardLegend.tsx index 30766a094a..0b01692b27 100644 --- a/client/src/charts/legends/StandardLegend.tsx +++ b/client/src/charts/legends/StandardLegend.tsx @@ -2,7 +2,8 @@ import React from "react"; import { LegendContainer } from "./LegendContainer"; -import { LegendList, LegendListProps } from "./LegendList"; +import type { LegendListProps } from "./LegendList"; +import { LegendList } from "./LegendList"; import "./StandardLegend.scss"; diff --git a/client/src/charts/legends/TabularLegend.tsx b/client/src/charts/legends/TabularLegend.tsx index 3c0be30bf1..e3cab89189 100644 --- a/client/src/charts/legends/TabularLegend.tsx +++ b/client/src/charts/legends/TabularLegend.tsx @@ -3,7 +3,7 @@ import React from "react"; import { CheckBox } from "src/components/index"; -import { StaticLegendItemType } from "./LegendItemType"; +import type { StaticLegendItemType } from "./LegendItemType"; import "./TabularLegend.scss"; interface TabularLegendProps { diff --git a/client/src/components/AutoHeightVirtualList.tsx b/client/src/components/AutoHeightVirtualList.tsx index 39b5214f8f..c5c9f6cd08 100644 --- a/client/src/components/AutoHeightVirtualList.tsx +++ b/client/src/components/AutoHeightVirtualList.tsx @@ -2,7 +2,7 @@ import React from "react"; import { List } from "react-virtualized"; import type { ListProps } from "react-virtualized"; -import { SafeOmit } from "src/types/util_types.d"; +import type { SafeOmit } from "src/types/util_types.d"; interface AutoHeightVirtualListProps extends SafeOmit { /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ diff --git a/client/src/components/DisplayTable/DisplayTable.tsx b/client/src/components/DisplayTable/DisplayTable.tsx index 4a9f789e9e..de15742afb 100644 --- a/client/src/components/DisplayTable/DisplayTable.tsx +++ b/client/src/components/DisplayTable/DisplayTable.tsx @@ -11,7 +11,7 @@ import { } from "src/components/misc_util_components"; import { SortDirections } from "src/components/SortDirection/SortDirection"; -import { FormatKey } from "src/core/format"; +import type { FormatKey } from "src/core/format"; import { LegendList } from "src/charts/legends/LegendList"; diff --git a/client/src/components/DropdownMenu/DropdownMenu.tsx b/client/src/components/DropdownMenu/DropdownMenu.tsx index ce2394fce9..dd4045648a 100644 --- a/client/src/components/DropdownMenu/DropdownMenu.tsx +++ b/client/src/components/DropdownMenu/DropdownMenu.tsx @@ -1,6 +1,7 @@ import classNames from "classnames"; import _ from "lodash"; -import React, { BaseSyntheticEvent } from "react"; +import type { BaseSyntheticEvent } from "react"; +import React from "react"; import { trivial_text_maker } from "src/models/text"; diff --git a/client/src/components/PageDetails.tsx b/client/src/components/PageDetails.tsx index 23593fbfea..a0ae7b0798 100644 --- a/client/src/components/PageDetails.tsx +++ b/client/src/components/PageDetails.tsx @@ -1,6 +1,7 @@ import _ from "lodash"; import React from "react"; -import { withRouter, RouteComponentProps } from "react-router"; +import type { RouteComponentProps } from "react-router"; +import { withRouter } from "react-router"; import { create_text_maker } from "src/models/text"; diff --git a/client/src/components/Typeahead/Typeahead.tsx b/client/src/components/Typeahead/Typeahead.tsx index ce9ebb8b29..dcf2a50f72 100644 --- a/client/src/components/Typeahead/Typeahead.tsx +++ b/client/src/components/Typeahead/Typeahead.tsx @@ -1,19 +1,11 @@ import classNames from "classnames"; import _ from "lodash"; -import React, { - ChangeEvent, - KeyboardEvent, - Fragment, - ReactElement, -} from "react"; +import type { ChangeEvent, KeyboardEvent, ReactElement } from "react"; +import React, { Fragment } from "react"; import ReactResizeDetector from "react-resize-detector/build/withPolyfill"; -import { - AutoSizer, - CellMeasurer, - CellMeasurerCache, - List, -} from "react-virtualized"; +import type { List } from "react-virtualized"; +import { AutoSizer, CellMeasurer, CellMeasurerCache } from "react-virtualized"; import { AutoHeightVirtualList } from "src/components/AutoHeightVirtualList"; import { LeafSpinner } from "src/components/LeafSpinner/LeafSpinner"; diff --git a/client/src/components/Typeahead/TypeaheadA11yStatus.tsx b/client/src/components/Typeahead/TypeaheadA11yStatus.tsx index 80c407d127..bfa223839c 100644 --- a/client/src/components/Typeahead/TypeaheadA11yStatus.tsx +++ b/client/src/components/Typeahead/TypeaheadA11yStatus.tsx @@ -1,9 +1,10 @@ import _ from "lodash"; -import React, { ReactNode } from "react"; +import type { ReactNode } from "react"; +import React from "react"; import { create_text_maker } from "src/models/text"; -import { ResultProps } from "./Typeahead"; +import type { ResultProps } from "./Typeahead"; import text from "./Typeahead.yaml"; diff --git a/client/src/components/modals_and_popovers/ModalButton.tsx b/client/src/components/modals_and_popovers/ModalButton.tsx index 16326b9167..b067353bc3 100644 --- a/client/src/components/modals_and_popovers/ModalButton.tsx +++ b/client/src/components/modals_and_popovers/ModalButton.tsx @@ -1,6 +1,7 @@ import React, { Fragment } from "react"; -import { withRouter, RouteComponentProps } from "react-router-dom"; +import type { RouteComponentProps } from "react-router-dom"; +import { withRouter } from "react-router-dom"; import { SafeJSURL } from "src/general_utils"; diff --git a/client/src/core/reactAdapter.ts b/client/src/core/reactAdapter.ts index 94c5352fd6..1389e260a7 100644 --- a/client/src/core/reactAdapter.ts +++ b/client/src/core/reactAdapter.ts @@ -1,5 +1,5 @@ import _ from "lodash"; -import React from "react"; +import type React from "react"; import ReactDOM from "react-dom"; class ReactContentRenderer { diff --git a/client/src/home/CardImage/CardImage.tsx b/client/src/home/CardImage/CardImage.tsx index cdb893cc67..48bd1cd37f 100644 --- a/client/src/home/CardImage/CardImage.tsx +++ b/client/src/home/CardImage/CardImage.tsx @@ -1,6 +1,7 @@ import React from "react"; -import { TM, TMProps } from "src/components/TextMaker"; +import type { TMProps } from "src/components/TextMaker"; +import { TM } from "src/components/TextMaker"; import "./CardImage.scss"; diff --git a/client/src/models/faq/populate_faq.ts b/client/src/models/faq/populate_faq.ts index 1154b8d774..451d19f1f0 100644 --- a/client/src/models/faq/populate_faq.ts +++ b/client/src/models/faq/populate_faq.ts @@ -1,9 +1,7 @@ import _ from "lodash"; -import { - ParsedCsvWithUndefineds, - enforced_required_fields, -} from "src/models/utils/populate_utils"; +import type { ParsedCsvWithUndefineds } from "src/models/utils/populate_utils"; +import { enforced_required_fields } from "src/models/utils/populate_utils"; import { lang } from "src/core/injected_build_constants"; diff --git a/client/src/models/footnotes/dynamic_footnotes.ts b/client/src/models/footnotes/dynamic_footnotes.ts index 37ed5b5158..47033e0ef8 100644 --- a/client/src/models/footnotes/dynamic_footnotes.ts +++ b/client/src/models/footnotes/dynamic_footnotes.ts @@ -8,7 +8,7 @@ import { fiscal_year_to_year, } from "src/models/years"; -import { FootNoteDef } from "./footnotes"; +import type { FootNoteDef } from "./footnotes"; import text from "./dynamic_footnotes.yaml"; diff --git a/client/src/models/footnotes/populate_footnotes.ts b/client/src/models/footnotes/populate_footnotes.ts index 5cf81a2fd8..8239fac275 100644 --- a/client/src/models/footnotes/populate_footnotes.ts +++ b/client/src/models/footnotes/populate_footnotes.ts @@ -1,7 +1,8 @@ import { csvParse } from "d3-dsv"; import _ from "lodash"; -import { Dept, CRSO, Program, SubjectInstance } from "src/models/subjects"; +import type { SubjectInstance } from "src/models/subjects"; +import { Dept, CRSO, Program } from "src/models/subjects"; import { run_template } from "src/models/text"; import { fiscal_year_to_year } from "src/models/years"; diff --git a/client/src/models/glossary/populate_glossary.ts b/client/src/models/glossary/populate_glossary.ts index af00de5d42..84f646c08b 100644 --- a/client/src/models/glossary/populate_glossary.ts +++ b/client/src/models/glossary/populate_glossary.ts @@ -1,9 +1,7 @@ import _ from "lodash"; -import { - ParsedCsvWithUndefineds, - enforced_required_fields, -} from "src/models/utils/populate_utils"; +import type { ParsedCsvWithUndefineds } from "src/models/utils/populate_utils"; +import { enforced_required_fields } from "src/models/utils/populate_utils"; import { lang } from "src/core/injected_build_constants"; diff --git a/client/src/models/subjects/BaseSubjectFactory.ts b/client/src/models/subjects/BaseSubjectFactory.ts index 2c62671500..21a232598d 100644 --- a/client/src/models/subjects/BaseSubjectFactory.ts +++ b/client/src/models/subjects/BaseSubjectFactory.ts @@ -1,6 +1,6 @@ import _ from "lodash"; -import { Store } from "src/models/utils/make_store"; +import type { Store } from "src/models/utils/make_store"; export const BaseSubjectFactory = ( subject_type: string, diff --git a/client/src/models/subjects/populate_subjects.ts b/client/src/models/subjects/populate_subjects.ts index c40369093a..eff8edc471 100644 --- a/client/src/models/subjects/populate_subjects.ts +++ b/client/src/models/subjects/populate_subjects.ts @@ -1,9 +1,7 @@ import _ from "lodash"; -import { - ParsedCsvWithUndefineds, - enforced_required_fields, -} from "src/models/utils/populate_utils"; +import type { ParsedCsvWithUndefineds } from "src/models/utils/populate_utils"; +import { enforced_required_fields } from "src/models/utils/populate_utils"; import { lang } from "src/core/injected_build_constants";