From 3a52ce36475eacd59f4b79073ff065dfb26dd982 Mon Sep 17 00:00:00 2001 From: Chika Date: Sun, 8 May 2022 21:32:40 +0300 Subject: [PATCH] code-style: eslint fixes --- .eslintignore | 3 ++- UIKit/colors.js | 1 + apollo/client.js | 4 +++- apollo/hooks.js | 3 ++- pages/index.tsx | 2 +- services/user/index.ts | 1 + stores/calculation/statuses/index.ts | 2 +- 7 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.eslintignore b/.eslintignore index c1d7a54..1466810 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,4 +4,5 @@ node_modules yarn.lock package-lock.json **/*.test.js -coverage \ No newline at end of file +coverage +mocks \ No newline at end of file diff --git a/UIKit/colors.js b/UIKit/colors.js index 42febe0..853ac50 100644 --- a/UIKit/colors.js +++ b/UIKit/colors.js @@ -1,3 +1,4 @@ +/* eslint-disable import/prefer-default-export */ import { createGlobalStyle } from 'styled-components'; export const GlobalStyle = createGlobalStyle` diff --git a/apollo/client.js b/apollo/client.js index 27b68e8..5c5750c 100644 --- a/apollo/client.js +++ b/apollo/client.js @@ -1,3 +1,5 @@ +/* eslint-disable no-underscore-dangle */ +/* eslint-disable @typescript-eslint/naming-convention */ import { ApolloClient, InMemoryCache } from '@apollo/client'; /** @type {import('@apollo/client').ApolloClient} */ @@ -16,7 +18,7 @@ function createApolloClient() { }); } -export function initializeApollo(initialState = null) { +export default function initializeApollo(initialState = null) { const _apolloClient = apolloClient ?? createApolloClient(); // If your page has Next.js data fetching methods that use Apollo Client, the initial state diff --git a/apollo/hooks.js b/apollo/hooks.js index b2d092c..a3fc807 100644 --- a/apollo/hooks.js +++ b/apollo/hooks.js @@ -1,5 +1,6 @@ +/* eslint-disable import/prefer-default-export */ import { useMemo } from 'react'; -import { initializeApollo } from './client'; +import initializeApollo from './client'; export function useApollo(initialState) { const client = useMemo(() => initializeApollo(initialState), [initialState]); diff --git a/pages/index.tsx b/pages/index.tsx index ef6a353..8e60abd 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,4 +1,4 @@ -import { initializeApollo } from 'apollo/client'; +import initializeApollo from 'apollo/client'; import type { GetServerSideProps } from 'next'; import { fetchUser } from 'services/user'; import type { BasePageProps } from 'types/page'; diff --git a/services/user/index.ts b/services/user/index.ts index 1bac544..a38a71b 100644 --- a/services/user/index.ts +++ b/services/user/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/prefer-default-export */ import axios, { AxiosRequestConfig } from 'axios'; import type { User } from './types'; diff --git a/stores/calculation/statuses/index.ts b/stores/calculation/statuses/index.ts index 5fa7939..641553d 100644 --- a/stores/calculation/statuses/index.ts +++ b/stores/calculation/statuses/index.ts @@ -1,6 +1,6 @@ /* eslint-disable object-curly-newline */ /* eslint-disable import/no-cycle */ -import type { Elements } from 'Components/Calculation/types/elements'; +import type { Elements } from 'Components/Calculation/config/map'; import { makeAutoObservable } from 'mobx'; import RootStore from 'stores/root'; import type { CalculationStatuses, Status } from './types';