Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organize imports with prettier #1168

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
"prettier --write"
]
},
"prettier":{
"plugins": [
"prettier-plugin-organize-imports"]
},
"devDependencies": {
"@mui/types": "7.2.20",
"@testing-library/react": "14.3.1",
Expand All @@ -82,6 +86,7 @@
"jsdom": "25.0.1",
"lint-staged": "15.2.11",
"prettier": "3.4.2",
"prettier-plugin-organize-imports": "4.1.0",
"redux-devtools": "3.7.0",
"source-map-explorer": "2.5.3",
"typescript": "5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion src/actions/AssessmentActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and
limitations under the Licence. */

import * as types from "./Types";
import * as limitations from "../models/Limitations";
import { createThunk } from "./";
import * as types from "./Types";

var AssessmentActions = {};

Expand Down
2 changes: 1 addition & 1 deletion src/actions/EquipmentActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and
limitations under the Licence. */

import * as types from "./Types";
import { createThunk } from "./";
import * as types from "./Types";

var EquipmentActions = {};

Expand Down
9 changes: 4 additions & 5 deletions src/actions/StopPlaceActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and
limitations under the Licence. */

import * as types from "./Types";
import { getCentroid } from "../utils/mapUtils";
import { UserActions } from ".";
import { createThunk, UserActions } from ".";
import { Entities } from "../models/Entities";
import { getIn } from "../utils";
import { getCentroid } from "../utils/mapUtils";
import { updateURLWithId } from "../utils/URLhelpers";
import { createThunk } from ".";
import { Entities } from "../models/Entities";
import * as types from "./Types";

var StopPlaceActions = {};

Expand Down
7 changes: 3 additions & 4 deletions src/actions/StopPlacesGroupActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@
See the Licence for the specific language governing permissions and
limitations under the Licence. */

import * as types from "./Types";
import { createThunk } from "./";
import {
getStopPlaceById,
getAddStopPlaceInfo,
getStopPlaceById,
} from "../actions/TiamatActions";
import { UserActions } from "./";
import Routes from "../routes/";
import { createThunk, UserActions } from "./";
import * as types from "./Types";

var StopPlacesGroupActions = {};

Expand Down
52 changes: 26 additions & 26 deletions src/actions/TiamatActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,54 +13,54 @@ See the Licence for the specific language governing permissions and
limitations under the Licence. */

import {
deleteGroupMutation,
deleteParkingMutation,
mutateAddToMultiModalStopPlace,
mutateCreateMultiModalStopPlace,
mutateCreateTag,
mutateDeleteQuay,
mutateDeleteStopPlace,
mutateGroupOfStopPlaces,
mutateMergeQuays,
mutateMergeStopPlaces,
mutateMoveQuaysToStop,
mutateMoveQuaysToNewStop,
mutateMoveQuaysToStop,
mutateParentStopPlace,
mutateAddToMultiModalStopPlace,
mutateCreateMultiModalStopPlace,
removeStopPlaceFromParent,
mutateStopPlace,
updateChildOfParentStop,
mutateParking,
mutatePathLink,
mutateRemoveTag,
mutateCreateTag,
mutateStopPlace,
mutateTerminateStopPlace,
mutateGroupOfStopPlaces,
deleteGroupMutation,
deleteParkingMutation,
mutatePathLink,
mutateParking,
removeStopPlaceFromParent,
updateChildOfParentStop,
} from "../graphql/Tiamat/mutations";
import {
allVersionsOfStopPlace,
allEntities,
stopPlaceBBQuery,
getMergeInfoStopPlace,
topopGraphicalPlacesQuery,
allVersionsOfStopPlace,
findStop,
getStopPlacesById,
getPolygons as getPolygonsQuery,
getTagsQuery,
findStopForReport as findStopForReportQuery,
findTagByNameQuery,
getStopById,
getGroupOfStopPlaceQuery,
getMergeInfoStopPlace,
getParkingForMultipleStopPlaces as getParkingForMultipleStopPlacesQuery,
getPolygons as getPolygonsQuery,
getQueryTopographicPlaces,
getStopById,
getStopPlacesById,
getTagsByNameQuery,
getGroupOfStopPlaceQuery,
getTagsQuery,
neighbourStopPlaceQuays,
stopPlaceAndPathLinkByVersion,
findStopForReport as findStopForReportQuery,
getParkingForMultipleStopPlaces as getParkingForMultipleStopPlacesQuery,
stopPlaceBBQuery,
topopGraphicalPlacesQuery,
topopGraphicalPlacesReportQuery,
neighbourStopPlaceQuays,
} from "../graphql/Tiamat/queries";
import mapToMutationVariables from "../modelUtils/mapToQueryVariables";

import { createApolloErrorThunk, createApolloThunk } from ".";
import * as types from "./Types";
import { v4 as uuidv4 } from "uuid";
import { createApolloErrorThunk, createApolloThunk } from ".";
import { getTiamatClient } from "../graphql/clients";
import * as types from "./Types";

export const getContext = async (auth) => {
let token;
Expand Down
16 changes: 8 additions & 8 deletions src/actions/UserActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and
limitations under the Licence. */

import * as types from "./Types";
import configureLocalization from "../localization/localization";
import FavoriteManager from "../singletons/FavoriteManager";
import SettingsManager from "../singletons/SettingsManager";
import { push } from "redux-first-history";
import {
getMergeInfoForStops,
getAddStopPlaceInfo,
getMergeInfoForStops,
} from "../actions/TiamatActions";
import { getIn } from "../utils/";
import { checkQuayUsage, checkStopPlaceUsage } from "../graphql/OTP/actions";
import configureLocalization from "../localization/localization";
import ParentStopPlace from "../models/ParentStopPlace";
import Routes from "../routes/";
import FavoriteManager from "../singletons/FavoriteManager";
import SettingsManager from "../singletons/SettingsManager";
import { getIn } from "../utils/";
import { createThunk } from "./";
import { checkStopPlaceUsage, checkQuayUsage } from "../graphql/OTP/actions";
import { push } from "redux-first-history";
import * as types from "./Types";

var UserActions = {};

Expand Down
10 changes: 5 additions & 5 deletions src/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and
limitations under the Licence. */

import StopPlaceActions from "./StopPlaceActions";
import UserActions from "./UserActions";
import { getOperationAST } from "graphql";
import AssessmentActions from "./AssessmentActions";
import EquipmentActions from "./EquipmentActions";
import StopPlaceActions from "./StopPlaceActions";
import StopPlacesGroupActions from "./StopPlacesGroupActions";
import { getOperationAST } from "graphql";
import UserActions from "./UserActions";

export {
StopPlaceActions,
UserActions,
AssessmentActions,
EquipmentActions,
StopPlaceActions,
StopPlacesGroupActions,
UserActions,
};

export const createThunk = (type: string, payload: any) => ({
Expand Down
4 changes: 2 additions & 2 deletions src/auth/auth.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { renderHook } from "@testing-library/react";

import { useAuth } from "./auth";
import { ConfigContext } from "../config/ConfigContext";
import { useAuth } from "./auth";

import { describe, test, expect, vi } from "vitest";
import { describe, expect, test, vi } from "vitest";

vi.mock("react-oidc-context", async () => {
return {
Expand Down
3 changes: 1 addition & 2 deletions src/auth/auth.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useCallback, useEffect } from "react";
import { useCallback } from "react";
import {
AuthProvider as OidcAuthProvider,
hasAuthParams,
useAuth as useOidcAuth,
} from "react-oidc-context";
import { useConfig } from "../config/ConfigContext";
Expand Down
10 changes: 5 additions & 5 deletions src/components/Dialogs/AddAdjacentStopsDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and
limitations under the Licence. */

import React from "react";
import PropTypes from "prop-types";
import { injectIntl } from "react-intl";
import { connect } from "react-redux";
import AddStopPlaceSuggestionListItem from "./AddStopPlaceSuggestionListItem";
import {
Box,
Button,
Expand All @@ -25,6 +20,11 @@ import {
DialogContent,
DialogTitle,
} from "@mui/material";
import PropTypes from "prop-types";
import React from "react";
import { injectIntl } from "react-intl";
import { connect } from "react-redux";
import AddStopPlaceSuggestionListItem from "./AddStopPlaceSuggestionListItem";

class AddAdjacentStopDialog extends React.Component {
constructor(props) {
Expand Down
12 changes: 6 additions & 6 deletions src/components/Dialogs/AddMemberToGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
See the Licence for the specific language governing permissions and
limitations under the Licence. */

import React, { Component } from "react";
import { injectIntl } from "react-intl";
import PropTypes from "prop-types";
import { connect } from "react-redux";
import { getGroupMemberSuggestions } from "../../modelUtils/leafletUtils";
import AddStopPlaceSuggestionList from "./AddStopPlaceSuggestionList";
import {
Box,
Button,
Expand All @@ -26,6 +20,12 @@ import {
DialogContent,
DialogTitle,
} from "@mui/material";
import PropTypes from "prop-types";
import { Component } from "react";
import { injectIntl } from "react-intl";
import { connect } from "react-redux";
import { getGroupMemberSuggestions } from "../../modelUtils/leafletUtils";
import AddStopPlaceSuggestionList from "./AddStopPlaceSuggestionList";

class AddMemberToGroup extends Component {
constructor(props) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialogs/AddStopPlaceSuggestionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and
limitations under the Licence. */

import React, { Component } from "react";
import PropTypes from "prop-types";
import { Component } from "react";
import AddStopPlaceSuggestionListItem from "./AddStopPlaceSuggestionListItem";

class AddStopPlaceSuggestionList extends Component {
Expand Down
8 changes: 4 additions & 4 deletions src/components/Dialogs/AddStopPlaceSuggestionListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and
limitations under the Licence. */

import React, { Component } from "react";
import PropTypes from "prop-types";
import { FormControlLabel } from "@mui/material";
import Checkbox from "@mui/material/Checkbox";
import ModalityIconImg from "../MainPage/ModalityIconImg";
import PropTypes from "prop-types";
import { Component } from "react";
import { injectIntl } from "react-intl";
import HasExpiredInfo from "../MainPage/HasExpiredInfo";
import { FormControlLabel } from "@mui/material";
import ModalityIconImg from "../MainPage/ModalityIconImg";

class AddStopPlaceSuggestionListItem extends Component {
render() {
Expand Down
12 changes: 6 additions & 6 deletions src/components/Dialogs/AddStopPlaceToParent.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and
limitations under the Licence. */

import React, { Component } from "react";
import { injectIntl } from "react-intl";
import PropTypes from "prop-types";
import { connect } from "react-redux";
import { getChildStopPlaceSuggestions } from "../../modelUtils/leafletUtils";
import AddStopPlaceSuggestionList from "./AddStopPlaceSuggestionList";
import {
Box,
Button,
Expand All @@ -27,6 +21,12 @@ import {
DialogContent,
DialogTitle,
} from "@mui/material";
import PropTypes from "prop-types";
import { Component } from "react";
import { injectIntl } from "react-intl";
import { connect } from "react-redux";
import { getChildStopPlaceSuggestions } from "../../modelUtils/leafletUtils";
import AddStopPlaceSuggestionList from "./AddStopPlaceSuggestionList";

class AddStopPlaceToParent extends Component {
constructor(props) {
Expand Down
12 changes: 6 additions & 6 deletions src/components/Dialogs/AltNamesDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and
limitations under the Licence. */

import React from "react";
import { connect } from "react-redux";
import MdDelete from "@mui/icons-material/Delete";
import * as altNameConfig from "../../config/altNamesConfig";
import MdEdit from "@mui/icons-material/ModeEdit";
import IconButton from "@mui/material/IconButton";
import React from "react";
import { connect } from "react-redux";
import { StopPlaceActions } from "../../actions/";
import ConfirmDialog from "./ConfirmDialog";
import * as altNameConfig from "../../config/altNamesConfig";
import { getPrimaryColor } from "../../config/themeConfig";
import NewAltName from "./NewAltName";
import EditAltName from "./EditAltName";
import ConfirmDialog from "./ConfirmDialog";
import DialogHeader from "./DialogHeader";
import EditAltName from "./EditAltName";
import NewAltName from "./NewAltName";

class AltNamesDialog extends React.Component {
constructor(props) {
Expand Down
Loading
Loading