style: fix organize-imports to work with tailwindcss prettier plugin (#2957) [skip ci]

pull/2962/head
Ryan Cohen 2 years ago committed by GitHub
parent 6c0fd40877
commit 4b855b8114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,5 @@
module.exports = {
plugins: [require('./merged-prettier-plugin.js')],
singleQuote: true,
trailingComma: 'es5',
};

@ -0,0 +1,21 @@
/* eslint-disable */
const tailwind = require('prettier-plugin-tailwindcss');
const organizeImports = require('prettier-plugin-organize-imports');
const combinedFormatter = {
...tailwind,
parsers: {
...tailwind.parsers,
...Object.keys(organizeImports.parsers).reduce((acc, key) => {
acc[key] = {
...tailwind.parsers[key],
preprocess(code, options) {
return organizeImports.parsers[key].preprocess(code, options);
},
};
return acc;
}, {}),
},
};
module.exports = combinedFormatter;

@ -180,10 +180,6 @@
"@commitlint/config-conventional" "@commitlint/config-conventional"
] ]
}, },
"prettier": {
"singleQuote": true,
"trailingComma": "es5"
},
"release": { "release": {
"plugins": [ "plugins": [
"@semantic-release/commit-analyzer", "@semantic-release/commit-analyzer",

@ -1,7 +1,7 @@
import axios from 'axios'; import axios from 'axios';
import xml2js from 'xml2js';
import fs, { promises as fsp } from 'fs'; import fs, { promises as fsp } from 'fs';
import path from 'path'; import path from 'path';
import xml2js from 'xml2js';
import logger from '../logger'; import logger from '../logger';
const UPDATE_INTERVAL_MSEC = 24 * 3600 * 1000; // how often to download new mapping in milliseconds const UPDATE_INTERVAL_MSEC = 24 * 3600 * 1000; // how often to download new mapping in milliseconds

@ -12,9 +12,9 @@ import {
import RadarrAPI from '../api/servarr/radarr'; import RadarrAPI from '../api/servarr/radarr';
import SonarrAPI from '../api/servarr/sonarr'; import SonarrAPI from '../api/servarr/sonarr';
import { MediaStatus, MediaType } from '../constants/media'; import { MediaStatus, MediaType } from '../constants/media';
import { getRepository } from '../datasource';
import type { DownloadingItem } from '../lib/downloadtracker'; import type { DownloadingItem } from '../lib/downloadtracker';
import downloadTracker from '../lib/downloadtracker'; import downloadTracker from '../lib/downloadtracker';
import { getRepository } from '../datasource';
import { getSettings } from '../lib/settings'; import { getSettings } from '../lib/settings';
import logger from '../logger'; import logger from '../logger';
import Issue from './Issue'; import Issue from './Issue';

@ -1,9 +1,9 @@
import { import {
Entity,
PrimaryGeneratedColumn,
Column, Column,
ManyToOne,
CreateDateColumn, CreateDateColumn,
Entity,
ManyToOne,
PrimaryGeneratedColumn,
UpdateDateColumn, UpdateDateColumn,
} from 'typeorm'; } from 'typeorm';
import { MediaStatus } from '../constants/media'; import { MediaStatus } from '../constants/media';

@ -1,10 +1,10 @@
import { import {
Entity,
PrimaryGeneratedColumn,
Column, Column,
CreateDateColumn, CreateDateColumn,
UpdateDateColumn, Entity,
ManyToOne, ManyToOne,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm'; } from 'typeorm';
import { MediaRequestStatus } from '../constants/media'; import { MediaRequestStatus } from '../constants/media';
import { MediaRequest } from './MediaRequest'; import { MediaRequest } from './MediaRequest';

@ -1,5 +1,5 @@
import type { ISession } from 'connect-typeorm'; import type { ISession } from 'connect-typeorm';
import { Index, Column, PrimaryColumn, Entity } from 'typeorm'; import { Column, Entity, Index, PrimaryColumn } from 'typeorm';
@Entity() @Entity()
export class Session implements ISession { export class Session implements ISession {

@ -1,6 +1,6 @@
import type { PaginatedResponse } from './common';
import type { MediaRequest } from '../../entity/MediaRequest';
import type { MediaType } from '../../constants/media'; import type { MediaType } from '../../constants/media';
import type { MediaRequest } from '../../entity/MediaRequest';
import type { PaginatedResponse } from './common';
export interface RequestResultsResponse extends PaginatedResponse { export interface RequestResultsResponse extends PaginatedResponse {
results: MediaRequest[]; results: MediaRequest[];

@ -1,9 +1,7 @@
import PlexTvAPI from '../api/plextv'; import PlexTvAPI from '../api/plextv';
import { User } from '../entity/User'; import { MediaStatus, MediaType } from '../constants/media';
import { getRepository } from '../datasource';
import Media from '../entity/Media'; import Media from '../entity/Media';
import logger from '../logger';
import { MediaType } from '../constants/media';
import { MediaStatus } from '../constants/media';
import { import {
DuplicateMediaRequestError, DuplicateMediaRequestError,
MediaRequest, MediaRequest,
@ -11,8 +9,9 @@ import {
QuotaRestrictedError, QuotaRestrictedError,
RequestPermissionError, RequestPermissionError,
} from '../entity/MediaRequest'; } from '../entity/MediaRequest';
import { User } from '../entity/User';
import logger from '../logger';
import { Permission } from './permissions'; import { Permission } from './permissions';
import { getRepository } from '../datasource';
class WatchlistSync { class WatchlistSync {
public async syncWatchlist() { public async syncWatchlist() {

@ -1,8 +1,8 @@
import { copyFileSync } from 'fs'; import { copyFileSync } from 'fs';
import { UserType } from '../constants/user';
import { User } from '../entity/User';
import path from 'path'; import path from 'path';
import { UserType } from '../constants/user';
import dataSource, { getRepository } from '../datasource'; import dataSource, { getRepository } from '../datasource';
import { User } from '../entity/User';
const prepareDb = async () => { const prepareDb = async () => {
// Copy over test settings.json // Copy over test settings.json

@ -1,5 +1,5 @@
import React from 'react';
import type { ForwardedRef } from 'react'; import type { ForwardedRef } from 'react';
import React from 'react';
export type ButtonType = export type ButtonType =
| 'default' | 'default'

@ -1,5 +1,5 @@
import useSettings from '../../../hooks/useSettings';
import Head from 'next/head'; import Head from 'next/head';
import useSettings from '../../../hooks/useSettings';
interface PageTitleProps { interface PageTitleProps {
title: string | (string | undefined)[]; title: string | (string | undefined)[];

@ -1,5 +1,5 @@
import { usePopperTooltip } from 'react-popper-tooltip';
import type { Config } from 'react-popper-tooltip'; import type { Config } from 'react-popper-tooltip';
import { usePopperTooltip } from 'react-popper-tooltip';
type TooltipProps = { type TooltipProps = {
content: React.ReactNode; content: React.ReactNode;

@ -1,12 +1,12 @@
import type { MovieResult } from '../../../../server/models/Search';
import ListView from '../../Common/ListView';
import { defineMessages, useIntl } from 'react-intl';
import Header from '../../Common/Header';
import PageTitle from '../../Common/PageTitle';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import globalMessages from '../../../i18n/globalMessages'; import { defineMessages, useIntl } from 'react-intl';
import type { MovieResult } from '../../../../server/models/Search';
import useDiscover from '../../../hooks/useDiscover'; import useDiscover from '../../../hooks/useDiscover';
import globalMessages from '../../../i18n/globalMessages';
import Error from '../../../pages/_error'; import Error from '../../../pages/_error';
import Header from '../../Common/Header';
import ListView from '../../Common/ListView';
import PageTitle from '../../Common/PageTitle';
const messages = defineMessages({ const messages = defineMessages({
genreMovies: '{genre} Movies', genreMovies: '{genre} Movies',

@ -1,12 +1,12 @@
import type { MovieResult } from '../../../../server/models/Search';
import ListView from '../../Common/ListView';
import { defineMessages, useIntl } from 'react-intl';
import Header from '../../Common/Header';
import PageTitle from '../../Common/PageTitle';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import globalMessages from '../../../i18n/globalMessages'; import { defineMessages, useIntl } from 'react-intl';
import type { MovieResult } from '../../../../server/models/Search';
import useDiscover from '../../../hooks/useDiscover'; import useDiscover from '../../../hooks/useDiscover';
import globalMessages from '../../../i18n/globalMessages';
import Error from '../../../pages/_error'; import Error from '../../../pages/_error';
import Header from '../../Common/Header';
import ListView from '../../Common/ListView';
import PageTitle from '../../Common/PageTitle';
const messages = defineMessages({ const messages = defineMessages({
languageMovies: '{language} Movies', languageMovies: '{language} Movies',

@ -1,10 +1,10 @@
import type { MovieResult } from '../../../server/models/Search';
import ListView from '../Common/ListView';
import { defineMessages, useIntl } from 'react-intl'; import { defineMessages, useIntl } from 'react-intl';
import Header from '../Common/Header'; import type { MovieResult } from '../../../server/models/Search';
import PageTitle from '../Common/PageTitle';
import useDiscover from '../../hooks/useDiscover'; import useDiscover from '../../hooks/useDiscover';
import Error from '../../pages/_error'; import Error from '../../pages/_error';
import Header from '../Common/Header';
import ListView from '../Common/ListView';
import PageTitle from '../Common/PageTitle';
const messages = defineMessages({ const messages = defineMessages({
discovermovies: 'Popular Movies', discovermovies: 'Popular Movies',

@ -1,13 +1,13 @@
import type { TvResult } from '../../../../server/models/Search';
import ListView from '../../Common/ListView';
import { defineMessages, useIntl } from 'react-intl';
import Header from '../../Common/Header';
import PageTitle from '../../Common/PageTitle';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import globalMessages from '../../../i18n/globalMessages'; import { defineMessages, useIntl } from 'react-intl';
import type { TvNetwork } from '../../../../server/models/common';
import type { TvResult } from '../../../../server/models/Search';
import useDiscover from '../../../hooks/useDiscover'; import useDiscover from '../../../hooks/useDiscover';
import globalMessages from '../../../i18n/globalMessages';
import Error from '../../../pages/_error'; import Error from '../../../pages/_error';
import type { TvNetwork } from '../../../../server/models/common'; import Header from '../../Common/Header';
import ListView from '../../Common/ListView';
import PageTitle from '../../Common/PageTitle';
const messages = defineMessages({ const messages = defineMessages({
networkSeries: '{network} Series', networkSeries: '{network} Series',

@ -1,13 +1,13 @@
import type { MovieResult } from '../../../../server/models/Search';
import ListView from '../../Common/ListView';
import { defineMessages, useIntl } from 'react-intl';
import Header from '../../Common/Header';
import PageTitle from '../../Common/PageTitle';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import globalMessages from '../../../i18n/globalMessages'; import { defineMessages, useIntl } from 'react-intl';
import type { ProductionCompany } from '../../../../server/models/common';
import type { MovieResult } from '../../../../server/models/Search';
import useDiscover from '../../../hooks/useDiscover'; import useDiscover from '../../../hooks/useDiscover';
import globalMessages from '../../../i18n/globalMessages';
import Error from '../../../pages/_error'; import Error from '../../../pages/_error';
import type { ProductionCompany } from '../../../../server/models/common'; import Header from '../../Common/Header';
import ListView from '../../Common/ListView';
import PageTitle from '../../Common/PageTitle';
const messages = defineMessages({ const messages = defineMessages({
studioMovies: '{studio} Movies', studioMovies: '{studio} Movies',

@ -1,10 +1,10 @@
import type { TvResult } from '../../../server/models/Search';
import ListView from '../Common/ListView';
import { defineMessages, useIntl } from 'react-intl'; import { defineMessages, useIntl } from 'react-intl';
import Header from '../Common/Header'; import type { TvResult } from '../../../server/models/Search';
import PageTitle from '../Common/PageTitle';
import useDiscover from '../../hooks/useDiscover'; import useDiscover from '../../hooks/useDiscover';
import Error from '../../pages/_error'; import Error from '../../pages/_error';
import Header from '../Common/Header';
import ListView from '../Common/ListView';
import PageTitle from '../Common/PageTitle';
const messages = defineMessages({ const messages = defineMessages({
discovertv: 'Popular Series', discovertv: 'Popular Series',

@ -1,12 +1,12 @@
import type { TvResult } from '../../../../server/models/Search';
import ListView from '../../Common/ListView';
import { defineMessages, useIntl } from 'react-intl';
import Header from '../../Common/Header';
import PageTitle from '../../Common/PageTitle';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import globalMessages from '../../../i18n/globalMessages'; import { defineMessages, useIntl } from 'react-intl';
import type { TvResult } from '../../../../server/models/Search';
import useDiscover from '../../../hooks/useDiscover'; import useDiscover from '../../../hooks/useDiscover';
import globalMessages from '../../../i18n/globalMessages';
import Error from '../../../pages/_error'; import Error from '../../../pages/_error';
import Header from '../../Common/Header';
import ListView from '../../Common/ListView';
import PageTitle from '../../Common/PageTitle';
const messages = defineMessages({ const messages = defineMessages({
genreSeries: '{genre} Series', genreSeries: '{genre} Series',

@ -1,12 +1,12 @@
import type { TvResult } from '../../../../server/models/Search';
import ListView from '../../Common/ListView';
import { defineMessages, useIntl } from 'react-intl';
import Header from '../../Common/Header';
import PageTitle from '../../Common/PageTitle';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import globalMessages from '../../../i18n/globalMessages'; import { defineMessages, useIntl } from 'react-intl';
import type { TvResult } from '../../../../server/models/Search';
import useDiscover from '../../../hooks/useDiscover'; import useDiscover from '../../../hooks/useDiscover';
import globalMessages from '../../../i18n/globalMessages';
import Error from '../../../pages/_error'; import Error from '../../../pages/_error';
import Header from '../../Common/Header';
import ListView from '../../Common/ListView';
import PageTitle from '../../Common/PageTitle';
const messages = defineMessages({ const messages = defineMessages({
languageSeries: '{language} Series', languageSeries: '{language} Series',

@ -1,10 +1,10 @@
import type { TvResult } from '../../../server/models/Search';
import ListView from '../Common/ListView';
import { defineMessages, useIntl } from 'react-intl'; import { defineMessages, useIntl } from 'react-intl';
import Header from '../Common/Header'; import type { TvResult } from '../../../server/models/Search';
import PageTitle from '../Common/PageTitle';
import useDiscover from '../../hooks/useDiscover'; import useDiscover from '../../hooks/useDiscover';
import Error from '../../pages/_error'; import Error from '../../pages/_error';
import Header from '../Common/Header';
import ListView from '../Common/ListView';
import PageTitle from '../Common/PageTitle';
const messages = defineMessages({ const messages = defineMessages({
upcomingtv: 'Upcoming Series', upcomingtv: 'Upcoming Series',

@ -1,10 +1,10 @@
import ListView from '../../Common/ListView';
import { defineMessages, useIntl } from 'react-intl'; import { defineMessages, useIntl } from 'react-intl';
import Header from '../../Common/Header'; import type { WatchlistItem } from '../../../../server/interfaces/api/discoverInterfaces';
import PageTitle from '../../Common/PageTitle';
import useDiscover from '../../../hooks/useDiscover'; import useDiscover from '../../../hooks/useDiscover';
import Error from '../../../pages/_error'; import Error from '../../../pages/_error';
import type { WatchlistItem } from '../../../../server/interfaces/api/discoverInterfaces'; import Header from '../../Common/Header';
import ListView from '../../Common/ListView';
import PageTitle from '../../Common/PageTitle';
const messages = defineMessages({ const messages = defineMessages({
discoverwatchlist: 'Your Plex Watchlist', discoverwatchlist: 'Your Plex Watchlist',

@ -1,6 +1,6 @@
import React from 'react';
import { ArrowCircleRightIcon } from '@heroicons/react/outline'; import { ArrowCircleRightIcon } from '@heroicons/react/outline';
import Link from 'next/link'; import Link from 'next/link';
import React from 'react';
import { defineMessages, useIntl } from 'react-intl'; import { defineMessages, useIntl } from 'react-intl';
import useSWR from 'swr'; import useSWR from 'swr';
import type { GenreSliderItem } from '../../../../server/interfaces/api/discoverInterfaces'; import type { GenreSliderItem } from '../../../../server/interfaces/api/discoverInterfaces';

@ -1,14 +1,14 @@
import { defineMessages, useIntl } from 'react-intl';
import type { import type {
MovieResult, MovieResult,
TvResult,
PersonResult, PersonResult,
TvResult,
} from '../../../server/models/Search'; } from '../../../server/models/Search';
import ListView from '../Common/ListView';
import { defineMessages, useIntl } from 'react-intl';
import Header from '../Common/Header';
import PageTitle from '../Common/PageTitle';
import useDiscover from '../../hooks/useDiscover'; import useDiscover from '../../hooks/useDiscover';
import Error from '../../pages/_error'; import Error from '../../pages/_error';
import Header from '../Common/Header';
import ListView from '../Common/ListView';
import PageTitle from '../Common/PageTitle';
const messages = defineMessages({ const messages = defineMessages({
trending: 'Trending', trending: 'Trending',

@ -1,6 +1,6 @@
import React from 'react';
import { ArrowCircleRightIcon } from '@heroicons/react/outline'; import { ArrowCircleRightIcon } from '@heroicons/react/outline';
import Link from 'next/link'; import Link from 'next/link';
import React from 'react';
import { defineMessages, useIntl } from 'react-intl'; import { defineMessages, useIntl } from 'react-intl';
import useSWR from 'swr'; import useSWR from 'swr';
import type { GenreSliderItem } from '../../../../server/interfaces/api/discoverInterfaces'; import type { GenreSliderItem } from '../../../../server/interfaces/api/discoverInterfaces';

@ -1,10 +1,10 @@
import type { MovieResult } from '../../../server/models/Search';
import ListView from '../Common/ListView';
import { defineMessages, useIntl } from 'react-intl'; import { defineMessages, useIntl } from 'react-intl';
import Header from '../Common/Header'; import type { MovieResult } from '../../../server/models/Search';
import PageTitle from '../Common/PageTitle';
import useDiscover from '../../hooks/useDiscover'; import useDiscover from '../../hooks/useDiscover';
import Error from '../../pages/_error'; import Error from '../../pages/_error';
import Header from '../Common/Header';
import ListView from '../Common/ListView';
import PageTitle from '../Common/PageTitle';
const messages = defineMessages({ const messages = defineMessages({
upcomingmovies: 'Upcoming Movies', upcomingmovies: 'Upcoming Movies',

@ -1,7 +1,7 @@
import type { HTMLAttributes } from 'react';
import AceEditor from 'react-ace';
import 'ace-builds/src-noconflict/mode-json'; import 'ace-builds/src-noconflict/mode-json';
import 'ace-builds/src-noconflict/theme-dracula'; import 'ace-builds/src-noconflict/theme-dracula';
import type { HTMLAttributes } from 'react';
import AceEditor from 'react-ace';
interface JSONEditorProps extends HTMLAttributes<HTMLDivElement> { interface JSONEditorProps extends HTMLAttributes<HTMLDivElement> {
name: string; name: string;

@ -1,7 +1,7 @@
import { NProgress } from '@tanem/react-nprogress'; import { NProgress } from '@tanem/react-nprogress';
import { useRouter } from 'next/router';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { useRouter } from 'next/router';
interface BarProps { interface BarProps {
progress: number; progress: number;

@ -1,15 +1,15 @@
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { defineMessages, useIntl } from 'react-intl';
import type { import type {
TvResult,
MovieResult, MovieResult,
PersonResult, PersonResult,
TvResult,
} from '../../../server/models/Search'; } from '../../../server/models/Search';
import ListView from '../Common/ListView'; import useDiscover from '../../hooks/useDiscover';
import { defineMessages, useIntl } from 'react-intl'; import Error from '../../pages/_error';
import Header from '../Common/Header'; import Header from '../Common/Header';
import ListView from '../Common/ListView';
import PageTitle from '../Common/PageTitle'; import PageTitle from '../Common/PageTitle';
import Error from '../../pages/_error';
import useDiscover from '../../hooks/useDiscover';
const messages = defineMessages({ const messages = defineMessages({
search: 'Search', search: 'Search',

@ -1,9 +1,9 @@
import { defineMessages, useIntl } from 'react-intl';
import globalMessages from '../../i18n/globalMessages';
import Button from '../Common/Button';
import { CheckIcon, TrashIcon } from '@heroicons/react/solid'; import { CheckIcon, TrashIcon } from '@heroicons/react/solid';
import axios from 'axios'; import axios from 'axios';
import { defineMessages, useIntl } from 'react-intl';
import { mutate } from 'swr'; import { mutate } from 'swr';
import globalMessages from '../../i18n/globalMessages';
import Button from '../Common/Button';
interface ErrorCardProps { interface ErrorCardProps {
id: number; id: number;

@ -14,8 +14,8 @@ import Button from '../Common/Button';
import CachedImage from '../Common/CachedImage'; import CachedImage from '../Common/CachedImage';
import RequestModal from '../RequestModal'; import RequestModal from '../RequestModal';
import Transition from '../Transition'; import Transition from '../Transition';
import Placeholder from './Placeholder';
import ErrorCard from './ErrorCard'; import ErrorCard from './ErrorCard';
import Placeholder from './Placeholder';
interface TitleCardProps { interface TitleCardProps {
id: number; id: number;

@ -1,5 +1,5 @@
import React, { useContext, useEffect, useRef } from 'react';
import { CSSTransition as ReactCSSTransition } from 'react-transition-group'; import { CSSTransition as ReactCSSTransition } from 'react-transition-group';
import React, { useRef, useEffect, useContext } from 'react';
interface CSSTransitionProps { interface CSSTransitionProps {
show?: boolean; show?: boolean;

@ -1,5 +1,5 @@
import type { Dispatch, SetStateAction } from 'react'; import type { Dispatch, SetStateAction } from 'react';
import { useState, useEffect } from 'react'; import { useEffect, useState } from 'react';
/** /**
* A hook to help with debouncing state * A hook to help with debouncing state

@ -1,4 +1,4 @@
import { useState, useEffect } from 'react'; import { useEffect, useState } from 'react';
export const INTERACTION_TYPE = { export const INTERACTION_TYPE = {
MOUSE: 'mouse', MOUSE: 'mouse',

@ -1,6 +1,6 @@
import type { MutableRefObject } from 'react';
import { useState, useEffect, useRef } from 'react';
import { debounce } from 'lodash'; import { debounce } from 'lodash';
import type { MutableRefObject } from 'react';
import { useEffect, useRef, useState } from 'react';
const IS_SCROLLING_CHECK_THROTTLE = 200; const IS_SCROLLING_CHECK_THROTTLE = 200;
const BUFFER_HEIGHT = 200; const BUFFER_HEIGHT = 200;

@ -1,6 +1,6 @@
import { shouldPolyfill as shouldPolyfillPluralrules } from '@formatjs/intl-pluralrules/should-polyfill';
import { shouldPolyfill as shouldPolyfillLocale } from '@formatjs/intl-locale/should-polyfill';
import { shouldPolyfill as shouldPolyfillDisplayNames } from '@formatjs/intl-displaynames/should-polyfill'; import { shouldPolyfill as shouldPolyfillDisplayNames } from '@formatjs/intl-displaynames/should-polyfill';
import { shouldPolyfill as shouldPolyfillLocale } from '@formatjs/intl-locale/should-polyfill';
import { shouldPolyfill as shouldPolyfillPluralrules } from '@formatjs/intl-pluralrules/should-polyfill';
const polyfillLocale = async () => { const polyfillLocale = async () => {
if (shouldPolyfillLocale()) { if (shouldPolyfillLocale()) {

Loading…
Cancel
Save