Skip to content

Commit

Permalink
Enable @typescript-eslint/consistent-type-imports, auto-fix it
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen-ONeil committed Dec 22, 2021
1 parent b37f5d8 commit 0cc71da
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 40 deletions.
3 changes: 2 additions & 1 deletion client/.eslintrc.json
Expand Up @@ -69,7 +69,8 @@
}
}
}
]
],
"@typescript-eslint/consistent-type-imports": "error"
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion client/src/charts/legends/LegendList.tsx
Expand Up @@ -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";

Expand Down
3 changes: 2 additions & 1 deletion client/src/charts/legends/StandardLegend.tsx
Expand Up @@ -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";

Expand Down
2 changes: 1 addition & 1 deletion client/src/charts/legends/TabularLegend.tsx
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/AutoHeightVirtualList.tsx
Expand Up @@ -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<ListProps, "height"> {
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/DisplayTable/DisplayTable.tsx
Expand Up @@ -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";

Expand Down
3 changes: 2 additions & 1 deletion 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";

Expand Down
3 changes: 2 additions & 1 deletion 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";

Expand Down
16 changes: 4 additions & 12 deletions 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";
Expand Down
5 changes: 3 additions & 2 deletions 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";

Expand Down
3 changes: 2 additions & 1 deletion 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";

Expand Down
2 changes: 1 addition & 1 deletion 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 {
Expand Down
3 changes: 2 additions & 1 deletion 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";

Expand Down
6 changes: 2 additions & 4 deletions 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";

Expand Down
2 changes: 1 addition & 1 deletion client/src/models/footnotes/dynamic_footnotes.ts
Expand Up @@ -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";

Expand Down
3 changes: 2 additions & 1 deletion 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";

Expand Down
6 changes: 2 additions & 4 deletions 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";

Expand Down
2 changes: 1 addition & 1 deletion 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 = <SubjectDef extends { id: string }>(
subject_type: string,
Expand Down
6 changes: 2 additions & 4 deletions 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";

Expand Down

0 comments on commit 0cc71da

Please sign in to comment.