code-style: eslint autofix
This commit is contained in:
parent
8c7ce90b4d
commit
11504e0f65
32
.prettierrc
32
.prettierrc
@ -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
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable react/prop-types */
|
||||
import styled from 'styled-components';
|
||||
import { Flex } from 'UIKit/grid';
|
||||
import { min } from 'UIKit/mq';
|
||||
|
||||
@ -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} />;
|
||||
|
||||
@ -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,
|
||||
},
|
||||
|
||||
@ -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"
|
||||
},
|
||||
|
||||
@ -5,7 +5,7 @@ export default function NotFound(props) {
|
||||
<Result
|
||||
status="500"
|
||||
title=""
|
||||
subTitle={'Ой! Что-то сломалось.'}
|
||||
subTitle="Ой! Что-то сломалось."
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/* eslint-disable global-require */
|
||||
import { ApolloProvider } from '@apollo/client';
|
||||
import 'antd/dist/antd.less';
|
||||
import { useApollo } from 'apollo/hooks';
|
||||
|
||||
@ -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">
|
||||
|
||||
@ -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,
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user