Skip to content

Commit

Permalink
chore: update lint config and fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
olegshilov committed Jun 14, 2024
1 parent 05655b1 commit bd6a93d
Show file tree
Hide file tree
Showing 50 changed files with 166 additions and 77 deletions.
36 changes: 34 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"root": true,
"ignorePatterns": ["!**/*", ".next/**/*", "storybook-static"],
"plugins": ["@nx"],
"plugins": ["@nx", "import", "prettier"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
Expand All @@ -20,5 +20,37 @@
}
}
],
"extends": ["plugin:@nx/react-typescript", "next", "next/core-web-vitals"]
"extends": ["plugin:@nx/react-typescript", "next", "next/core-web-vitals"],
"rules": {
"arrow-body-style": ["error", "always"],
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"internal",
["parent", "sibling", "index"]
],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
},
{
"pattern": "@/**",
"group": "internal"
}
],
"pathGroupsExcludedImportTypes": ["builtin"],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
},
"newlines-between": "never"
}
],
"prettier/prettier": "error"
}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"build": "nx build",
"start": "nx start",
"test": "nx test",
"lint": "nx lint",
"e2e": "nx e2e",
"storybook": "nx storybook",
"format": "prettier --write '**/*.{ts,js,tsx,jsx,cjs,mjs,css,json,md,mdx,html,yaml,yml}'"
Expand Down Expand Up @@ -82,6 +83,7 @@
"eslint-plugin-cypress": "3.3.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-react": "7.34.2",
"eslint-plugin-react-hooks": "4.6.2",
"jest": "29.7.0",
Expand Down
55 changes: 55 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/(main)/audits/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from 'next';
import { AuditsPage } from '@/components/pages/audits-page';
import { DEPLOY_URL } from '@/constants';
import { haqqOpenGraphImages } from '@/lib/shared-metadata';
import type { Metadata } from 'next';

const title = 'Audits';
const description = '';
Expand Down
4 changes: 2 additions & 2 deletions src/app/(main)/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Metadata, ResolvingMetadata } from 'next';
import { notFound } from 'next/navigation';
import { BlogPostPage } from '@/components/pages/blog-post-page';
import { DEPLOY_URL, REVALIDATE_TIME } from '@/constants';
import {
getBlogPost,
getHaqqBlogPostsFromFalconer,
} from '@/utils/get-blog-posts';
import type { Metadata, ResolvingMetadata } from 'next';
import { notFound } from 'next/navigation';

export const dynamicParams = true;
export const revalidate = REVALIDATE_TIME;
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/blog/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Metadata } from 'next';
import { BlogPage } from '@/components/pages/blog-page';
import { DEPLOY_URL, REVALIDATE_TIME } from '@/constants';
import { haqqOpenGraphImages } from '@/lib/shared-metadata';
import { getHaqqBlogPostsFromFalconer } from '@/utils/get-blog-posts';
import type { Metadata } from 'next';

export const dynamicParams = true;
export const revalidate = REVALIDATE_TIME;
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/brand-assets/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Metadata } from 'next';
import { DEPLOY_URL } from '@/constants';
import { haqqOpenGraphImages } from '@/lib/shared-metadata';
import type { Metadata } from 'next';

const title = 'Brand assets';
const description = `Download HAQQ Network's official brand assets to represent our ethical and Shariah-compliant vision.`;
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/ecosystem-fund/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Metadata } from 'next';
import { DEPLOY_URL } from '@/constants';
import { haqqOpenGraphImages } from '@/lib/shared-metadata';
import type { Metadata } from 'next';

const title = 'Ecosystem fund';
const description =
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/ecosystem/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Metadata } from 'next';
import { EcosystemPage } from '@/components/pages/ecosystem-page';
import { DEPLOY_URL } from '@/constants';
import { haqqOpenGraphImages } from '@/lib/shared-metadata';
import { getHaqqPartnersFromFalconer } from '@/utils/get-partners';
import type { Metadata } from 'next';

const title = 'Ecosystem';
const description =
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Fragment, type PropsWithChildren } from 'react';
import { Footer } from '@/components/ui/footer';
import { Header } from '@/components/ui/header';
import { Fragment, type PropsWithChildren } from 'react';

export default function MainLayout({ children }: PropsWithChildren) {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Metadata } from 'next';
import { MainPage } from '@/components/pages/main-page';
import { DEPLOY_URL } from '@/constants';
import { haqqOpenGraphImages } from '@/lib/shared-metadata';
import { getChainStatsFromFalconer } from '@/utils/get-chain-stats';
import type { Metadata } from 'next';

const title = 'Home of ethical web3';
const description =
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/privacy-policy/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Metadata } from 'next';
import { PrivacyPolicyPage } from '@/components/pages/privacy-policy-page';
import { DEPLOY_URL } from '@/constants';
import { haqqOpenGraphImages } from '@/lib/shared-metadata';
import { getPrivacyPolicyContentFromFalconer } from '@/utils/get-privacy-policy';
import type { Metadata } from 'next';

const title = 'Privacy Policy';
const description =
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/validators/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from 'next';
import { ValidatorProgramPage } from '@/components/pages/validator-program-page';
import { DEPLOY_URL } from '@/constants';
import { haqqOpenGraphImages } from '@/lib/shared-metadata';
import type { Metadata } from 'next';

const title = 'Validators';
const description = '';
Expand Down
2 changes: 1 addition & 1 deletion src/app/(main)/wp/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Metadata } from 'next';
import { WhitepaperPage } from '@/components/pages/whitepaper-page';
import { DEPLOY_URL } from '@/constants';
import { haqqOpenGraphImages } from '@/lib/shared-metadata';
import { getWhitepaperContentFromFalconer } from '@/utils/get-whitepaper';
import type { Metadata } from 'next';

const title = 'Whitepaper';
const description =
Expand Down
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { PropsWithChildren } from 'react';
import { SpeedInsights } from '@vercel/speed-insights/next';
import clsx from 'clsx';
import type { Metadata, Viewport } from 'next';
import dynamic from 'next/dynamic';
import Script from 'next/script';
import { DEPLOY_URL, GA_ID, VERCEL_ENV } from '@/constants';
import { clashDisplayFont, hkGuiseFont } from '@/lib/fonts';
import { PHProvider } from '@/providers/posthog';
import '@/styles/global.css';
import { clashDisplayFont, hkGuiseFont } from '@/lib/fonts';
import clsx from 'clsx';

export const metadata: Metadata = {
title: {
Expand Down
6 changes: 3 additions & 3 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Metadata } from 'next';
import { Footer } from '@/components/ui/footer';
import { Header } from '@/components/ui/header';
import { NotFound } from '@/components/ui/not-found';
import { DEPLOY_URL } from '@/constants';
import { haqqOpenGraphImages } from '@/lib/shared-metadata';
import NotFound from '@/components/ui/not-found';
import { Header } from '@/components/ui/header';
import { Footer } from '@/components/ui/footer';

const title = 'Not Found';

Expand Down
6 changes: 3 additions & 3 deletions src/components/forms/feedback-form.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
'use client';
import { Fragment, useCallback, useEffect, useMemo, useState } from 'react';
import { yupResolver } from '@hookform/resolvers/yup';
import axios from 'axios';
import { usePostHog } from 'posthog-js/react';
import { useForm } from 'react-hook-form';
import Turnstile from 'react-turnstile';
import * as yup from 'yup';
import axios from 'axios';
import {
ContactFormFields,
FormState,
HookedFormInput,
} from './hooked-form-input';
import { HookedFormTextarea } from './hooked-form-textarea';
import { Button } from '../ui/button';
import { Modal } from '../ui/modal';
import { Heading } from '../ui/heading';
import { Modal } from '../ui/modal';
import { Ruler } from '../ui/ruler';
import { Text } from '../ui/text';
import { HookedFormTextarea } from './hooked-form-textarea';

const MESSAGE_MIN_LENGTH = 100;

Expand Down
6 changes: 3 additions & 3 deletions src/components/forms/subscribe-form.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
'use client';
import { Fragment, useCallback, useEffect, useMemo, useState } from 'react';
import { yupResolver } from '@hookform/resolvers/yup';
import axios from 'axios';
import clsx from 'clsx';
import Link from 'next/link';
import { usePostHog } from 'posthog-js/react';
import { useForm } from 'react-hook-form';
import Turnstile from 'react-turnstile';
import * as yup from 'yup';
import axios from 'axios';
import {
FormState,
HookedFormInput,
SubscribeFormFields,
} from './hooked-form-input';
import { Button } from '../ui/button';
import { Modal } from '../ui/modal';
import { Heading } from '../ui/heading';
import { Text } from '../ui/text';
import { Modal } from '../ui/modal';
import { Ruler } from '../ui/ruler';
import { Text } from '../ui/text';

const schema: yup.ObjectSchema<SubscribeFormFields> = yup
.object({
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/blog-post-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import blogPlaceholderImage1 from '@/assets/images/blog-post-placeholder-1.png';
import blogPlaceholderImage2 from '@/assets/images/blog-post-placeholder-2.png';
import blogPlaceholderImage3 from '@/assets/images/blog-post-placeholder-3.png';
import { Post } from '@/types';
import { Breadcrumb } from '../ui/breadcrumb';
import { BlogArticle } from '../ui/blog-article';
import { Breadcrumb } from '../ui/breadcrumb';
import { RecentPostsBlock } from '../ui/recent-posts-block';

const placeholderImagesArray = [
Expand Down
Loading

0 comments on commit bd6a93d

Please sign in to comment.