code-style: eslint autofix

This commit is contained in:
Chika 2022-05-08 15:31:17 +03:00
parent 8c7ce90b4d
commit 11504e0f65
12 changed files with 70 additions and 51 deletions

View File

@ -1,18 +1,18 @@
{
"endOfLine": "auto",
"arrowParens": "always",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "ignore",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
"endOfLine": "auto",
"arrowParens": "always",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "ignore",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}

View File

@ -37,7 +37,7 @@ const Logout = styled.a`
}
`;
const Auth = () => {
function Auth() {
return (
<Flex
flexDirection="column"
@ -50,6 +50,6 @@ const Auth = () => {
<Logout href="/logout">Выход</Logout>
</Flex>
);
};
}
export default Auth;

View File

@ -29,13 +29,15 @@ const Wrapper = styled.header`
z-index: 999999;
`;
const Header = () => (
<Wrapper>
<HeaderContent>
<Logo />
<Auth />
</HeaderContent>
</Wrapper>
);
function Header() {
return (
<Wrapper>
<HeaderContent>
<Logo />
<Auth />
</HeaderContent>
</Wrapper>
);
}
export default Header;

View File

@ -23,17 +23,19 @@ const LogoText = styled.h3`
}
`;
const Logo = () => (
<Flex
flexDirection="column"
alignItems="flex-start"
justifyContent="space-between"
>
<ImageWrapper>
<Image alt="logo" src={logo} layout="responsive" objectFit="contain" />
</ImageWrapper>
<LogoText>Лизинговый Калькулятор</LogoText>
</Flex>
);
function Logo() {
return (
<Flex
flexDirection="column"
alignItems="flex-start"
justifyContent="space-between"
>
<ImageWrapper>
<Image alt="logo" src={logo} layout="responsive" objectFit="contain" />
</ImageWrapper>
<LogoText>Лизинговый Калькулятор</LogoText>
</Flex>
);
}
export default Logo;

View File

@ -1,3 +1,4 @@
/* eslint-disable react/prop-types */
import styled from 'styled-components';
import { Flex } from 'UIKit/grid';
import { min } from 'UIKit/mq';

View File

@ -3,5 +3,12 @@ import { Spin } from 'antd';
export default Spin;
const loadingOutlined = <LoadingOutlined style={{ fontSize: 24 }} spin />;
const loadingOutlined = (
<LoadingOutlined
style={{
fontSize: 24
}}
spin
/>
);
export const Outlined = <Spin indicator={loadingOutlined} />;

View File

@ -5,7 +5,9 @@ const withGraphQL = require('next-plugin-graphql');
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
eslint: { ignoreDuringBuilds: true },
eslint: {
ignoreDuringBuilds: true,
},
compiler: {
styledComponents: true,
},

View File

@ -7,7 +7,7 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint:fix": "next lint --fix",
"lint:fix": "next lint -- --fix",
"graphql:codegen": "apollo client:codegen --target typescript",
"graphql:schema": "apollo client:download-schema services/crm/graphql/schema.graphql"
},

View File

@ -5,7 +5,7 @@ export default function NotFound(props) {
<Result
status="500"
title=""
subTitle={'Ой! Что-то сломалось.'}
subTitle="Ой! Что-то сломалось."
{...props}
/>
);

View File

@ -1,3 +1,4 @@
/* eslint-disable global-require */
import { ApolloProvider } from '@apollo/client';
import 'antd/dist/antd.less';
import { useApollo } from 'apollo/hooks';

View File

@ -7,10 +7,9 @@ export default class MyDocument extends Document {
const originalRenderPage = ctx.renderPage;
try {
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: App => props => sheet.collectStyles(<App {...props} />),
});
ctx.renderPage = () => originalRenderPage({
enhanceApp: (App) => (props) => sheet.collectStyles(<App {...props} />),
});
const initialProps = await Document.getInitialProps(ctx);
return {
@ -26,6 +25,7 @@ export default class MyDocument extends Document {
sheet.seal();
}
}
render() {
return (
<Html lang="ru" translate="no">

View File

@ -1,18 +1,22 @@
import { initializeApollo } from 'apollo/client';
import type { GetServerSideProps, NextPage } from 'next';
import type { GetServerSideProps } from 'next';
import { fetchUser } from 'services/user';
import type { BasePageProps } from 'types/page';
interface PageProps extends BasePageProps {}
const Home: NextPage<PageProps> = () => {
function Home() {
return <div>Home</div>;
};
}
export const getServerSideProps: GetServerSideProps<PageProps> = async ctx => {
export const getServerSideProps: GetServerSideProps<PageProps> = async (
ctx
) => {
const user = await fetchUser({
headers: ctx?.req?.headers?.cookie
? { cookie: ctx.req.headers.cookie }
? {
cookie: ctx.req.headers.cookie,
}
: undefined,
});