Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

Commit

Permalink
Update dependency eslint-plugin-import to v2.25.2 (#1555)
Browse files Browse the repository at this point in the history
* Update dependency eslint-plugin-import to v2.25.2

Signed-off-by: Renovate Bot <bot@renovateapp.com>
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Make type imports more explicit

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

* Enforce use of type imports

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
  • Loading branch information
3 people committed Oct 17, 2021
1 parent fc3a3fa commit 2abe40e
Show file tree
Hide file tree
Showing 264 changed files with 567 additions and 504 deletions.
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"emoji-picker-element": "1.8.2",
"emoji-picker-element-data": "1.2.0",
"eslint-config-react-app": "6.0.0",
"eslint-plugin-import": "2.24.2",
"eslint-plugin-import": "2.25.2",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "5.1.0",
Expand Down Expand Up @@ -134,7 +134,14 @@
"rules": {
"no-use-before-define": "off",
"no-debugger": "warn",
"default-param-last": "off"
"default-param-last": "off",
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports",
"disallowTypeAnnotations": false
}
]
},
"plugins": [
"@typescript-eslint"
Expand Down Expand Up @@ -193,7 +200,6 @@
},
"resolutions": {
"cypress": "7.7.0",
"katex": "0.13.18",
"eslint-plugin-import": "2.24.2"
"katex": "0.13.18"
}
}
2 changes: 1 addition & 1 deletion src/api/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { Config } from './types'
import type { Config } from './types'

export const getConfig = async (): Promise<Config> => {
const response = await fetch(getApiUrl() + 'config', {
Expand Down
5 changes: 3 additions & 2 deletions src/api/history/dto-methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { HistoryEntry, HistoryEntryOrigin } from '../../redux/history/types'
import { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'
import type { HistoryEntry } from '../../redux/history/types'
import { HistoryEntryOrigin } from '../../redux/history/types'
import type { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'

export const historyEntryDtoToHistoryEntry = (entryDto: HistoryEntryDto): HistoryEntry => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/api/history/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'
import type { HistoryEntryDto, HistoryEntryPutDto, HistoryEntryUpdateDto } from './types'

export const getHistory = async (): Promise<HistoryEntryDto[]> => {
const response = await fetch(getApiUrl() + 'me/history')
Expand Down
2 changes: 1 addition & 1 deletion src/api/me/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { UserResponse } from '../users/types'
import type { UserResponse } from '../users/types'
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { isMockMode } from '../../utils/test-modes'

Expand Down
2 changes: 1 addition & 1 deletion src/api/media/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { ImageProxyResponse } from '../../components/markdown-renderer/replace-components/image/types'
import type { ImageProxyResponse } from '../../components/markdown-renderer/replace-components/image/types'
import { isMockMode } from '../../utils/test-modes'
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'

Expand Down
2 changes: 1 addition & 1 deletion src/api/notes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { NoteDto } from './types'
import type { NoteDto } from './types'
import { isMockMode } from '../../utils/test-modes'

export const getNote = async (noteId: string): Promise<NoteDto> => {
Expand Down
4 changes: 2 additions & 2 deletions src/api/notes/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { UserInfoDto } from '../users/types'
import { GroupInfoDto } from '../group/types'
import type { UserInfoDto } from '../users/types'
import type { GroupInfoDto } from '../group/types'

export interface NoteDto {
content: string
Expand Down
2 changes: 1 addition & 1 deletion src/api/revisions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { Cache } from '../../components/common/cache/cache'
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { Revision, RevisionListEntry } from './types'
import type { Revision, RevisionListEntry } from './types'

const revisionCache = new Cache<string, Revision>(3600)

Expand Down
2 changes: 1 addition & 1 deletion src/api/tokens/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { AccessToken, AccessTokenSecret } from './types'
import type { AccessToken, AccessTokenSecret } from './types'

export const getAccessTokenList = async (): Promise<AccessToken[]> => {
const response = await fetch(`${getApiUrl()}tokens`, {
Expand Down
2 changes: 1 addition & 1 deletion src/api/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { Cache } from '../../components/common/cache/cache'
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
import { UserResponse } from './types'
import type { UserResponse } from './types'

const cache = new Cache<string, UserResponse>(600)

Expand Down
2 changes: 1 addition & 1 deletion src/api/users/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { LoginProvider } from '../../redux/user/types'
import type { LoginProvider } from '../../redux/user/types'

export interface UserResponse {
id: string
Expand Down
3 changes: 2 additions & 1 deletion src/components/application-loader/application-loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import React, { Suspense, useCallback, useEffect, useState } from 'react'
import { useBackendBaseUrl } from '../../hooks/common/use-backend-base-url'
import './application-loader.scss'
import { createSetUpTaskList, InitTask } from './initializers'
import type { InitTask } from './initializers'
import { createSetUpTaskList } from './initializers'
import { LoadingScreen } from './loading-screen'
import { useCustomizeAssetsUrl } from '../../hooks/common/use-customize-assets-url'
import { useFrontendAssetsUrl } from '../../hooks/common/use-frontend-assets-url'
Expand Down
3 changes: 2 additions & 1 deletion src/components/application-loader/initializers/i18n/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import i18n, { ResourceKey } from 'i18next'
import type { ResourceKey } from 'i18next'
import i18n from 'i18next'
import LanguageDetector from 'i18next-browser-languagedetector'
import resourcesToBackend from 'i18next-resources-to-backend'
import { Settings } from 'luxon'
Expand Down
3 changes: 2 additions & 1 deletion src/components/common/copyable/copy-overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
SPDX-License-Identifier: AGPL-3.0-only
*/

import React, { RefObject, useCallback, useEffect, useState } from 'react'
import type { RefObject } from 'react'
import React, { useCallback, useEffect, useState } from 'react'
import { Overlay, Tooltip } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next'
import { v4 as uuid } from 'uuid'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React, { Fragment, useRef } from 'react'
import { Button } from 'react-bootstrap'
import { Variant } from 'react-bootstrap/types'
import type { Variant } from 'react-bootstrap/types'
import { useTranslation } from 'react-i18next'
import { ForkAwesomeIcon } from '../../fork-awesome/fork-awesome-icon'
import { CopyOverlay } from '../copy-overlay'
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/fork-awesome/fork-awesome-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import React from 'react'
import { IconName, IconSize } from './types'
import type { IconName, IconSize } from './types'

export interface ForkAwesomeIconProps {
icon: IconName
Expand Down
8 changes: 5 additions & 3 deletions src/components/common/fork-awesome/fork-awesome-stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
SPDX-License-Identifier: AGPL-3.0-only
*/

import React, { ReactElement } from 'react'
import { ForkAwesomeIcon, ForkAwesomeIconProps } from './fork-awesome-icon'
import { IconSize } from './types'
import type { ReactElement } from 'react'
import React from 'react'
import type { ForkAwesomeIconProps } from './fork-awesome-icon'
import { ForkAwesomeIcon } from './fork-awesome-icon'
import type { IconSize } from './types'

export interface ForkAwesomeStackProps {
size?: IconSize
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/fork-awesome/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { ForkAwesomeIcons } from './fork-awesome-icons'
import type { ForkAwesomeIcons } from './fork-awesome-icons'

export type IconName = typeof ForkAwesomeIcons[number]
export type IconSize = '2x' | '3x' | '4x' | '5x'
5 changes: 3 additions & 2 deletions src/components/common/icon-button/icon-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
*/

import React from 'react'
import { Button, ButtonProps } from 'react-bootstrap'
import type { ButtonProps } from 'react-bootstrap'
import { Button } from 'react-bootstrap'
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
import { IconName } from '../fork-awesome/types'
import type { IconName } from '../fork-awesome/types'
import { ShowIf } from '../show-if/show-if'
import './icon-button.scss'

Expand Down
3 changes: 2 additions & 1 deletion src/components/common/icon-button/translated-icon-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

import React from 'react'
import { Trans } from 'react-i18next'
import { IconButton, IconButtonProps } from './icon-button'
import type { IconButtonProps } from './icon-button'
import { IconButton } from './icon-button'

export interface TranslatedIconButtonProps extends IconButtonProps {
i18nKey: string
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/links/external-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import React from 'react'
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
import { IconName } from '../fork-awesome/types'
import type { IconName } from '../fork-awesome/types'
import { ShowIf } from '../show-if/show-if'
import { LinkWithTextProps } from './types'
import type { LinkWithTextProps } from './types'

export const ExternalLink: React.FC<LinkWithTextProps> = ({
href,
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/links/internal-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import React from 'react'
import { Link } from 'react-router-dom'
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
import { IconName } from '../fork-awesome/types'
import type { IconName } from '../fork-awesome/types'
import { ShowIf } from '../show-if/show-if'
import { LinkWithTextProps } from './types'
import type { LinkWithTextProps } from './types'

export const InternalLink: React.FC<LinkWithTextProps> = ({
href,
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/links/translated-external-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react'
import { useTranslation } from 'react-i18next'
import { ExternalLink } from './external-link'
import { TranslatedLinkProps } from './types'
import type { TranslatedLinkProps } from './types'

export const TranslatedExternalLink: React.FC<TranslatedLinkProps> = ({ i18nKey, i18nOption, ...props }) => {
const { t } = useTranslation()
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/links/translated-internal-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react'
import { useTranslation } from 'react-i18next'
import { InternalLink } from './internal-link'
import { TranslatedLinkProps } from './types'
import type { TranslatedLinkProps } from './types'

export const TranslatedInternalLink: React.FC<TranslatedLinkProps> = ({ i18nKey, i18nOption, ...props }) => {
const { t } = useTranslation()
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/links/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { StringMap, TOptionsBase } from 'i18next'
import { IconName } from '../fork-awesome/fork-awesome-icon'
import type { StringMap, TOptionsBase } from 'i18next'
import type { IconName } from '../fork-awesome/fork-awesome-icon'

interface GeneralLinkProp {
href: string
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/modals/common-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React from 'react'
import { Modal } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next'
import { ForkAwesomeIcon } from '../fork-awesome/fork-awesome-icon'
import { IconName } from '../fork-awesome/types'
import type { IconName } from '../fork-awesome/types'
import { ShowIf } from '../show-if/show-if'

export interface CommonModalProps {
Expand Down
3 changes: 2 additions & 1 deletion src/components/common/modals/deletion-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import React from 'react'
import { Button, Modal } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next'
import { CommonModal, CommonModalProps } from './common-modal'
import type { CommonModalProps } from './common-modal'
import { CommonModal } from './common-modal'

export interface DeletionModalProps extends CommonModalProps {
onConfirm: () => void
Expand Down
3 changes: 2 additions & 1 deletion src/components/common/modals/error-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

import React from 'react'
import { Modal } from 'react-bootstrap'
import { CommonModal, CommonModalProps } from './common-modal'
import type { CommonModalProps } from './common-modal'
import { CommonModal } from './common-modal'

export const ErrorModal: React.FC<CommonModalProps> = ({ show, onHide, titleI18nKey, icon, children }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { extractFrontmatter } from './extract-frontmatter'
import { PresentFrontmatterExtractionResult } from './types'
import type { PresentFrontmatterExtractionResult } from './types'

describe('frontmatter extraction', () => {
describe('isPresent property', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { FrontmatterExtractionResult } from './types'
import type { FrontmatterExtractionResult } from './types'

const FRONTMATTER_BEGIN_REGEX = /^-{3,}$/
const FRONTMATTER_END_REGEX = /^(?:-{3,}|\.{3,})$/
Expand Down
3 changes: 2 additions & 1 deletion src/components/common/note-frontmatter/note-frontmatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

// import { RevealOptions } from 'reveal.js'
import { load } from 'js-yaml'
import { ISO6391, NoteTextDirection, NoteType, RawNoteFrontmatter, SlideOptions } from './types'
import type { RawNoteFrontmatter, SlideOptions } from './types'
import { ISO6391, NoteTextDirection, NoteType } from './types'
import { initialSlideOptions } from '../../../redux/note-details/initial-state'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/note-frontmatter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { RevealOptions } from 'reveal.js'
import type { RevealOptions } from 'reveal.js'

export type FrontmatterExtractionResult = PresentFrontmatterExtractionResult | NonPresentFrontmatterExtractionResult

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Redirect } from 'react-router'
import { useParams } from 'react-router-dom'
import { getNote } from '../../../api/notes'
import { NotFoundErrorScreen } from './not-found-error-screen'
import { NoteDto } from '../../../api/notes/types'
import type { NoteDto } from '../../../api/notes/types'

interface RouteParameters {
id: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React from 'react'
import { Alert } from 'react-bootstrap'
import { Trans, useTranslation } from 'react-i18next'
import { ShowIf } from '../common/show-if/show-if'
import { SimpleAlertProps } from '../common/simple-alert/simple-alert-props'
import type { SimpleAlertProps } from '../common/simple-alert/simple-alert-props'

export const ErrorWhileLoadingNoteAlert: React.FC<SimpleAlertProps> = ({ show }) => {
useTranslation()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React from 'react'
import { Alert } from 'react-bootstrap'
import { Trans } from 'react-i18next'
import { ShowIf } from '../common/show-if/show-if'
import { SimpleAlertProps } from '../common/simple-alert/simple-alert-props'
import type { SimpleAlertProps } from '../common/simple-alert/simple-alert-props'

export const LoadingNoteAlert: React.FC<SimpleAlertProps> = ({ show }) => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/

import { DateTime } from 'luxon'
import type { DateTime } from 'luxon'
import React from 'react'
import { Trans, useTranslation } from 'react-i18next'
import { InternalLink } from '../common/links/internal-link'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
import { Link } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
import { useParams } from 'react-router'
import { EditorPagePathParams } from '../editor-page'
import type { EditorPagePathParams } from '../editor-page'

export const ReadOnlyModeButton: React.FC = () => {
const { t } = useTranslation()
Expand Down

0 comments on commit 2abe40e

Please sign in to comment.