code-style: eslint autofix
This commit is contained in:
parent
8c7ce90b4d
commit
11504e0f65
32
.prettierrc
32
.prettierrc
@ -1,18 +1,18 @@
|
|||||||
{
|
{
|
||||||
"endOfLine": "auto",
|
"endOfLine": "auto",
|
||||||
"arrowParens": "always",
|
"arrowParens": "always",
|
||||||
"bracketSpacing": true,
|
"bracketSpacing": true,
|
||||||
"htmlWhitespaceSensitivity": "ignore",
|
"htmlWhitespaceSensitivity": "ignore",
|
||||||
"insertPragma": false,
|
"insertPragma": false,
|
||||||
"jsxBracketSameLine": false,
|
"jsxBracketSameLine": false,
|
||||||
"jsxSingleQuote": false,
|
"jsxSingleQuote": false,
|
||||||
"printWidth": 80,
|
"printWidth": 80,
|
||||||
"proseWrap": "preserve",
|
"proseWrap": "preserve",
|
||||||
"quoteProps": "as-needed",
|
"quoteProps": "as-needed",
|
||||||
"requirePragma": false,
|
"requirePragma": false,
|
||||||
"semi": true,
|
"semi": true,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"tabWidth": 2,
|
"tabWidth": 2,
|
||||||
"trailingComma": "es5",
|
"trailingComma": "es5",
|
||||||
"useTabs": false
|
"useTabs": false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ const Logout = styled.a`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Auth = () => {
|
function Auth() {
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
flexDirection="column"
|
flexDirection="column"
|
||||||
@ -50,6 +50,6 @@ const Auth = () => {
|
|||||||
<Logout href="/logout">Выход</Logout>
|
<Logout href="/logout">Выход</Logout>
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
export default Auth;
|
export default Auth;
|
||||||
|
|||||||
@ -29,13 +29,15 @@ const Wrapper = styled.header`
|
|||||||
z-index: 999999;
|
z-index: 999999;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Header = () => (
|
function Header() {
|
||||||
<Wrapper>
|
return (
|
||||||
<HeaderContent>
|
<Wrapper>
|
||||||
<Logo />
|
<HeaderContent>
|
||||||
<Auth />
|
<Logo />
|
||||||
</HeaderContent>
|
<Auth />
|
||||||
</Wrapper>
|
</HeaderContent>
|
||||||
);
|
</Wrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default Header;
|
export default Header;
|
||||||
|
|||||||
@ -23,17 +23,19 @@ const LogoText = styled.h3`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Logo = () => (
|
function Logo() {
|
||||||
<Flex
|
return (
|
||||||
flexDirection="column"
|
<Flex
|
||||||
alignItems="flex-start"
|
flexDirection="column"
|
||||||
justifyContent="space-between"
|
alignItems="flex-start"
|
||||||
>
|
justifyContent="space-between"
|
||||||
<ImageWrapper>
|
>
|
||||||
<Image alt="logo" src={logo} layout="responsive" objectFit="contain" />
|
<ImageWrapper>
|
||||||
</ImageWrapper>
|
<Image alt="logo" src={logo} layout="responsive" objectFit="contain" />
|
||||||
<LogoText>Лизинговый Калькулятор</LogoText>
|
</ImageWrapper>
|
||||||
</Flex>
|
<LogoText>Лизинговый Калькулятор</LogoText>
|
||||||
);
|
</Flex>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default Logo;
|
export default Logo;
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable react/prop-types */
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { Flex } from 'UIKit/grid';
|
import { Flex } from 'UIKit/grid';
|
||||||
import { min } from 'UIKit/mq';
|
import { min } from 'UIKit/mq';
|
||||||
|
|||||||
@ -3,5 +3,12 @@ import { Spin } from 'antd';
|
|||||||
|
|
||||||
export default Spin;
|
export default Spin;
|
||||||
|
|
||||||
const loadingOutlined = <LoadingOutlined style={{ fontSize: 24 }} spin />;
|
const loadingOutlined = (
|
||||||
|
<LoadingOutlined
|
||||||
|
style={{
|
||||||
|
fontSize: 24
|
||||||
|
}}
|
||||||
|
spin
|
||||||
|
/>
|
||||||
|
);
|
||||||
export const Outlined = <Spin indicator={loadingOutlined} />;
|
export const Outlined = <Spin indicator={loadingOutlined} />;
|
||||||
|
|||||||
@ -5,7 +5,9 @@ const withGraphQL = require('next-plugin-graphql');
|
|||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
eslint: { ignoreDuringBuilds: true },
|
eslint: {
|
||||||
|
ignoreDuringBuilds: true,
|
||||||
|
},
|
||||||
compiler: {
|
compiler: {
|
||||||
styledComponents: true,
|
styledComponents: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
"lint:fix": "next lint --fix",
|
"lint:fix": "next lint -- --fix",
|
||||||
"graphql:codegen": "apollo client:codegen --target typescript",
|
"graphql:codegen": "apollo client:codegen --target typescript",
|
||||||
"graphql:schema": "apollo client:download-schema services/crm/graphql/schema.graphql"
|
"graphql:schema": "apollo client:download-schema services/crm/graphql/schema.graphql"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -5,7 +5,7 @@ export default function NotFound(props) {
|
|||||||
<Result
|
<Result
|
||||||
status="500"
|
status="500"
|
||||||
title=""
|
title=""
|
||||||
subTitle={'Ой! Что-то сломалось.'}
|
subTitle="Ой! Что-то сломалось."
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable global-require */
|
||||||
import { ApolloProvider } from '@apollo/client';
|
import { ApolloProvider } from '@apollo/client';
|
||||||
import 'antd/dist/antd.less';
|
import 'antd/dist/antd.less';
|
||||||
import { useApollo } from 'apollo/hooks';
|
import { useApollo } from 'apollo/hooks';
|
||||||
|
|||||||
@ -7,10 +7,9 @@ export default class MyDocument extends Document {
|
|||||||
const originalRenderPage = ctx.renderPage;
|
const originalRenderPage = ctx.renderPage;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ctx.renderPage = () =>
|
ctx.renderPage = () => originalRenderPage({
|
||||||
originalRenderPage({
|
enhanceApp: (App) => (props) => sheet.collectStyles(<App {...props} />),
|
||||||
enhanceApp: App => props => sheet.collectStyles(<App {...props} />),
|
});
|
||||||
});
|
|
||||||
|
|
||||||
const initialProps = await Document.getInitialProps(ctx);
|
const initialProps = await Document.getInitialProps(ctx);
|
||||||
return {
|
return {
|
||||||
@ -26,6 +25,7 @@ export default class MyDocument extends Document {
|
|||||||
sheet.seal();
|
sheet.seal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Html lang="ru" translate="no">
|
<Html lang="ru" translate="no">
|
||||||
|
|||||||
@ -1,18 +1,22 @@
|
|||||||
import { initializeApollo } from 'apollo/client';
|
import { initializeApollo } from 'apollo/client';
|
||||||
import type { GetServerSideProps, NextPage } from 'next';
|
import type { GetServerSideProps } from 'next';
|
||||||
import { fetchUser } from 'services/user';
|
import { fetchUser } from 'services/user';
|
||||||
import type { BasePageProps } from 'types/page';
|
import type { BasePageProps } from 'types/page';
|
||||||
|
|
||||||
interface PageProps extends BasePageProps {}
|
interface PageProps extends BasePageProps {}
|
||||||
|
|
||||||
const Home: NextPage<PageProps> = () => {
|
function Home() {
|
||||||
return <div>Home</div>;
|
return <div>Home</div>;
|
||||||
};
|
}
|
||||||
|
|
||||||
export const getServerSideProps: GetServerSideProps<PageProps> = async ctx => {
|
export const getServerSideProps: GetServerSideProps<PageProps> = async (
|
||||||
|
ctx
|
||||||
|
) => {
|
||||||
const user = await fetchUser({
|
const user = await fetchUser({
|
||||||
headers: ctx?.req?.headers?.cookie
|
headers: ctx?.req?.headers?.cookie
|
||||||
? { cookie: ctx.req.headers.cookie }
|
? {
|
||||||
|
cookie: ctx.req.headers.cookie,
|
||||||
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user